I82Much I82Much - 1 year ago 65
Android Question

Where does Android emulator store SQLite database?

I'm working on an Android application that stores data in a SQLite database. My question is, where does this database file get stored on the filesystem when you're using an emulator?

I have seen that it's stored in

/data/data/package_name/databases


but I need to know where on my local machine's hard drive that actually maps to. The database persists on multiple runs of the emulator, even after having shut down the machine, so it can't just reside in RAM...

Answer Source

The filesystem of the emulator doesn't map to a directory on your hard drive. The emulator's disk image is stored as an image file, which you can manage through either Eclipse (look for the G1-looking icon in the toolbar), or through the emulator binary itself (run "emulator -help" for a description of options).

You're best off using adb from the command line to jack into a running emulator. If you can get the specific directory and filename, you can do an "adb pull" to get the database file off of the emulator and onto your regular hard drive.

Edit: Removed suggestion that this works for unrooted devices too - it only works for emulators, and devices where you are operating adb as root.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download