Cannot open data directory on Android root phone

I just founded my phone because I need to access the database, my application is uisng. However, despite the fact that my phone is connected, I still cannot open the data folder in Eclipse File Explorer.

Is there something I forgot? Should I tell Eclipse that I'm superuser or something else? I can access the data folder on the emulator, but not on my device itself.

And I really want to develop on my device, the emulator is much slower, and I can not make the Internet connection work.

Any ideas?

+6
source share
3 answers

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 a SQLite editor (from the same company), but I do not have much experience with it.


Update : I played with the phone after reaching this page: http://www.screaming-penguin.com/node/7742

Instead of the emulator, as in this post, I had a phone connected to USB (Samsung Captivate, a user file with 2.2 ROM) with usb debugging turned on.

As an example, run the following commands:

 $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 in any database you open (if you run it as su)

+5
source

In current versions of Android you do not need to do this. Just put android: debuggable = "true" in your manifest, and then you can use the shell "run-as <package name>"; to switch to the uid of your application so that you can access its data directory.

It definitely works on 2.3 or later; It can work on 2.2. I donโ€™t remember exactly when he entered.

+5
source

Another consideration is the creation of a test assembly of your application, which adds a button to copy the database to the SD card, where you can view it from a PC.

Alternatively, you can set the file sharing mode of the database file, but you still cannot view it - you will need to tell the file browser to go directly to the database file (i.e. enter its full path), since you cannot Browse through intermediate levels of folders, such as / data. I donโ€™t know if the browser allows this (today it doesnโ€™t open at all for me, but I never use it because I like command line shells;)

+2
source

Source: https://habr.com/ru/post/887052/


All Articles