Skip to content Skip to sidebar Skip to footer

Retrieve Sqlite Table When Debugging App In Phone

as per question, I know if I run my app on an emulator, I can retrieve a copy of the generated sqlite table by just going to the /bin folder. But how can I do the same, if I run my

Solution 1:

You can retrieve your sqlite-databases even if your device isn't rooted. Here's how:

Step 1 - Open adb command prompt

Go to your android-sdk folder --> platform-tools and open the command prompt.

Step 2 - Backup

Enter the following line in your command prompt:

adb backup -f my_backup.ab -noapk com.mypackage.name

Unlock your device and you should see something like this:

adb backup screenshot

Confirm the backup-operation without entering a password

Note:This will only work on devices running Android 4.0 and above

Step 3 - Unpacking the backup

Now you should see a file called my_backup.ab in your platform-tools folder. That's a compressed and encrypted backup file of android which we need to extract now. Download the following tool called Android Backup Extractor.

Now extract the *.zip file of the Android Backup Extractor and copy your *.ab file into this directory. And run the following command:

java -jar abe.jar unpack my_backup.ab my_backup.tar

Afterwards a new archive should appear called my_backup.tar. Open it an browse to the /db/ directory. There you'll see all of your databases. Done!

Post a Comment for "Retrieve Sqlite Table When Debugging App In Phone"