Export Local SQLite Database from Android app


Step 1:Connect your device or launch emulator 

Connect your Device or Launch Emulator .
(In my case I used emulator because I can not  use real device without rooting )

Step 2: Find devices 

Open command prompt and enter  “adb devices


Step 3:Go to ADB Shell


  1. Decide the application which DB needs to export
  2. I have choosed some demo application which using localDB(sqllite)
  3. Enter command “adb shell



Note: adb shell command will not work there is no any device or emulator connected


Step 4:Find the DB directory


Normally the localDB of any application will be located in the path of
/data/data/<PACKAGE_NAME>/databases

To open directory enter command
“cd /data/data/chintan.khetiya.sqlite.cursor/databases

Note : chintan.khetiya.sqllite.cursor : package name



From the above screenshots DharmaDBDemo is the DB file

Step 5: Export DB file from the emulator


Open command prompt and got to thee directory where you wants to save the DB file
I am going to export it in D Drive

Enter the DB export command
“/data/data/chintan.khetiya.sqlite.cursor/databases/DharmaDBDemo”



Now you can verify it by seeing that file in the D drive.


Step 6: Open the DB file in SQLLite Viewer.


  1. Download SQLLite Browser from here
  2. Install and Launch it
  3. GO to File and Open Database and choose your DB file from the D driver
  4. Go to Browse data Tab and choose your table then you can view the rows of the table




For reference APK. Download from this link

TechieQA

Dharma is a QA for more than 3 years of experience in Android and iOS application testing and developement.Like to explore all domain and new technologies.

1 comment: