How to access database inside an Android Emulator

Hey everybody,

So I was stuck trying to debug a problem with a missing table in an Android app.  I knew the table was in the original database, but I had to be sure it was in the actual database the emulator was using.  The easiest way to check this is as follows:

1.  Run the adb program.  Use “adb shell” to create a shell in which you can access the emulator.
2.  Switch to the directory where the database is located.  The “cd data/data/<application package name>/databases should do it.
3.   Execute sqlite3 <database name>
4.  Run whatever SQL commands you need to do in order to prove your sanity.

Big ups go out to Chris Kopec for his excellent tutorial located here.

gb

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>