Android – Where does Android emulator store SQLite database

androidsqlite

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…

Best Answer

An update mentioned in the comments below:

You don't need to be on the DDMS perspective anymore, just open the File Explorer from Eclipse Window > Show View > Other... It seems the app doesn't need to be running even, I can browse around in different apps file contents. I'm running ADB version 1.0.29


Or, you can try the old approach:

Open the DDMS perspective on your Eclipse IDE

(Window > Open Perspective > Other > DDMS)

and the most important:

YOUR APPLICATION MUST BE RUNNING SO YOU CAN SEE THE HIERARCHY OF FOLDERS AND FILES.

Then in the File Explorer Tab you will follow the path :

data > data > your-package-name > databases > your-database-file.

Then select the file, click on the disket icon in the right corner of the screen to download the .db file. If you want to upload a database file to the emulator you can click on the phone icon(beside disket icon) and choose the file to upload.

If you want to see the content of the .db file, I advise you to use SQLite Database Browser, which you can download here.

PS: If you want to see the database from a real device, you must root your phone.

Related Topic