Wednesday, May 5, 2010

Manually accessing SQLite databases on Android

Start the Android emulator or connect a device.
To see available devices, run: tools\android list avd
If emulator not started, using the name fround above, run: tools\emulator [avdname]
To see if devices connected run: tools/adb.exe devices
Open the adb shell: tools\adb.exe shell
Once the shell is started you have access to a Linux ash shell, with a limited commands. At the shell type, to show the list of files: ls -l
The of databases are in /data/data directory, execute: ls -R /data/data/*/databases
SQLite can be invoked: sqlite3 [database_name]
To quit SQLite, type: .exit
To copy the database to desktop PC, use : adb pull [database_name] [local path name]
Use adb push [local] [remote] to copy back the file

No comments:

Post a Comment