Can't open data directory on rooted android phone

In current versions of Android you don't need to do this. Just put android:debuggable="true" in your manifest and then you can use the shell's "run-as <package_name>" to switch to the uid of your application so you can access its data directory.

This definitely works on 2.3 or later; it might work on 2.2 I don't remember exactly when it went in.


Yet another option is to check the database using Root Explorer from the device itself. It can read .db files. If you need to modify them, there is SQLite editor (by the same company), but I do not have much experience with it.


Update: I was playing with my phone after reaching this page: http://www.screaming-penguin.com/node/7742

Instead of the emulator as in that post, I had my phone connected to the usb (Samsung Captivate, custom 2.2 ROM), with usb debugging enabled.

I run the following commands, as an example:

$adb -d shell
# su
# cd /dbdata/databases/com.android.browser
# sqlite3 browser.db
sqlite> .tables
.tables
android_metadata  bookmarks    folders    searches
sqlite> select * from bookmarks;
(listed all my bookmarks)

Basically, you can run any SQL command from adb on any database you open (provided you run it as su)