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 " 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.

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 " 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.

And the ugly hack equivalent on an already rooted device is probably to use 'su' from the adb shell. More importantly, as far as I know neither this nor the more official run-as is going to let the file browser from the PC see things under /data, though changing the ro secure setting on the device (major bad idea unless its a test-only one with no sim) presumably would. – Chris Stratton May 1 at 16:52.

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: 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).

Yes - but hackbod has a good point, that you don't need to be root to do this if its your own app. You can set debuggable in its build, then use run-as, then either cd directly to your application's private path under /data or give sqlite3 the full path name of the database you want to explore. – Chris Stratton May 1 at 23:19 in which terminal am I supposed to write these commands, is this something inside the DDMS?

I've never been able to find it.. – Sled May 2 at 17:00 @Sled nope, just the command prompt (you may need to add adb to your PATH) – Aleadam May 2 at 17:04 It's giving me permission denied as soon as I type "su" though. Any idea how to fix that? – Sled May 2 at 17:09 1 @Sled If you have SuperUser installed in your phone, turn it on while connected and try again adb shell su.

You'll get a popup in the phone asking for your permission. If that doesn't work, xda-developers is full of tips for rooting each phone. – Aleadam May 2 at 17:21.

There is some daemon process in Android that is the counterpart to DDMS/adb on your development machine. That process would need to have superuser privileges to accomplish your ends. That being said, I don't know what that process is or how to get it to run as a superuser.

I believe that process is adbd, and the way to get it to run as superuser is to set the ro secure flag to false on the device, but that's not something to be done lightly. – Chris Stratton May 1 at 16:57.

Another option to consider would be making a test build of your application which adds a button to copy the database over to the sdcard where you can browse it from the PC. Alternatively, you could set the mode of the database file to shared, but you still won't be able to browse to it - you would have to tell the file browser to go directly to the database file (ie, type its full path in) since you can't browse intervening levels of folders such as /data itself. I don't know if the browser lets you do that (it's not opening at all for me today, but then I never use it since I like command line shells ;-).

I just rooted my phone because I need acces to the database my application is uisng. However, even though my phone is rooted, I still can't open the data folder in Eclipse File Explorer. Is there something I've forgotten?

Do I need to tell Eclipse I'm a superuser or something? I can acces the data folder on the emulator, but not on my actual device. And I really want to develop on my device, the emulator is much slower and I can't get the internet connection to work.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions