How to Extract Database from Android Application


Android uses SQLite database to store the local data on the android phone. SQLite Database is the Default Database which is used by Android applications for the local storage.Today I will show you a easy way that how you can pull SQLite database from an Android Device and after that, you can also edit them on your PC.Just Follow the Simple steps and then you can Export SQLite Database in your System.

Requirements for Extracting SQLite Database

  1. Android SDK Installed on your System
  2. Android application which has SQLite Database Installed on your Android Device
  3. Android Device should be rooted

Steps to Extract SQLite Database from Android Application 


Step 1. Turn on USB Debugging on your Android Device.

For Enable USB Debugging Go to Settings > Developer options

By Default Developer options is hidden, use the following steps to enable USB Debugging
On your Android Device, go to Settings > About Device
Tap on the Build number 7 times to make Developer options available, After 7 times Tap you will see a Toast message which Says "You are now a Developer".
Then enable the USB Debugging option.

Step 2. Now Connect your Android Device to your PC or Laptop.

Step 3. Now you will see a dialog to "Allow USB Debugging" on your Android Device, Select OK.

Step 4. Now open Command prompt, To open command prompt Press Windows Key + R and type cmd and hit Enter.This will open Command Prompt Window.

Step 5. Type adb devices in Command Prompt, this will show the connected Devices to your PC or Laptop. 

Step 6. Type adb shell in Command Prompt, now you will get the android shell on your PC or Laptop.

Step 7. Type su, this will give us the root Privileges.

Step 8. Type cd /data/data . This is the Default Location where all the data is Stored of the Installed Application.

Step 9. Now we need the Package name to Extract the SQLite Database.To get the package name, in your Android go to Settings > Installed Apps > Click on Android Application whose Database we are Extracting.
Now you can see the package name as shown below.




Step 10. Type cd com.yourpackage.name . There type the Package name which you get from the above step.

Step 11. Type cd databases. All the Databases files are stored at this location.

Step 12. Type ls.This will list all the available databases, now get the database name from this Step.

Step 13. Type cp databasename.db /sdcard/databasename.db . using this Step we are copying the database file to sdcard so that we can easily copy it to our System.

Step 14. Press Ctrl+c to exit from the Android Shell.

Step 15. Type adb pull /sdcard/databasename.db . This Command will pull the SQLite Database file to your PC or Laptop.

Now we have a copy of the Database on our System, but we still need some kind of SQLite viewer to view the database Entries.I am using SQLite Database Browser because it is a simple to use the tool and it is free. Now.Follow the Next Steps to Open the SQLite Database in our System.

View or Edit the SQLite Database


Step 1. You need a Tool to see or edit the SQLite Database entries. DB Browser for SQLite is a very good Windows Tool to see or edit the SQLite Database. Download DB Browser for SQLite and Install it in your System.

Step 2. Open DB Browser for SQLite on your PC or Laptop, Click on Open Database, Now select the SQLite Database file which we extract from the Android Device from the above steps.  

Step 3. Click on Browse data and Select the table.



Now you can see the Entries of the SQLite database and you can also edit the Database .

So above is all about how to extract androids applications SQLite Database from an Android Device and after that open the Database file in SQLite Database Browser to view the entries or edit the entries.It is not very difficult to get a look at the SQLite Database you create in your Android applications, it requires only a few steps.Hope you all like this post, share it with others too and Leave a comment below if you need any suggestion at any steps.



1 comment:

  1. Hi I get permission denied error when i extract caknowledge.com app

    ReplyDelete

Powered by Blogger.