The problem you are facing is common and not well explained in the documentation. Regular devices do not include the sqlite3 binary database, so you get an error. Android Emeulator, OSX, Linux (if installed) and Windows (after installation) have a binary file, so you can open the database locally on your computer.
The workaround is to copy the database from your device to the local computer. This can be done using ADB, but requires a few steps.
Before you begin, you will need information:
- SDK path (if it is not included in your OS environment)
- your
<package name> e.g. com.example.application - a
<local path> to host your database, for example. ~/Desktop or %userprofile%\Desktop
Next, you will need to understand which terminal each command will be written to the first character in the examples below, is not entered, but allows you to find out which shell we are in:
> = OS command line command$ = ADB Shell Command Hint! = ADB shell on admin command line%
Next, enter the following commands from the terminal or command (do not enter the first character or text in () )
> adb shell $ su ! cp /data/data/<package name>/Databases/<database name> /sdcard ! exit $ exit > adb pull /sdcard/<database name> <local path> > sqlite3 <local db path> % .dump % .exit (to exit sqldb)
This is a really round-robin way to copy a database to a local machine and read the database locally. There are SO and other resources explaining how to install the sqlite3 binary on your device from the emulator, but within one time this process works.
If you need to access the database interactively, I would suggest running your application in an emulator (already having sqlite3) or installing sqlite on your devices / xbin path .
hoss Aug 22 '13 at 13:26 2013-08-22 13:26
source share