Retrieve sqlite table when debugging application in phone

according to the question, I know that if I run the application on the emulator, I can get a copy of the generated sqlite table just by going to the / bin folder. But how can I do the same if I run the application on my device?

edit: it seems that I was right in the part that I can get the sqlite table by going to the / bin folder only if I use Eclipse. But I'm currently using Android Studio ... so does anyone know how to get the created sqlite table?

+1
source share
1 answer

You can get your sqlite databases even if your device is not deployed. Here's how:

Step 1 - Open the adb Command Prompt

Go to android-sdk → platform-tools folder and open a command prompt.

Step 2 - Backup

Enter the following line at the command prompt:

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

Unlock the device and you will see something like this:

adb backup screenshot

Confirm backup operation without entering password

Note. . This will only work on devices running Android 4.0 and higher.

Step 3 - Unpacking the Backup

You should now see a file called my_backup.ab in the platform-tools folder. This is a compressed and encrypted android backup file that we need to extract now. The following tool called All Android Backup Extractor .

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

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

Then a new archive my_backup.tar will appear. Open it, go to the /db/ directory. There you will see all your databases. Done!

0
source

Source: https://habr.com/ru/post/1201299/


All Articles