Android eclipse DDMS - Can't access data/data/ on phone to pull files
While testing my apps, I use emulators and my own phone to see if everything is working ok. My apps are also writing data to shared preferences and a text file.
I ca开发者_如何学运维n pull the data from my emulators through the DDMS
in eclipse so I can read the data files on my computer, but when I try to open those folders through the DDMS
on my phone, nothing happens. I click the data folder and nothing happens.
My phone is rooted. Is there any way I could pull the files from my phone? I know that Android keeps these folders private, but there must be a way. The emulator is just way too slow.
On rooted device you can do this:
- Open cmd
- Type
adb shell
su
- Press 'Allow' on device
chmod 777 /data /data/data /data/data/com.application.package/data/data/com.application.package/*
- Go to the DDMS view in Eclipse
After this you should be able to browse the files on the device.
To get the databases:
chmod 777 /data/data/com.application.package/databases /data/data/com.application.package/databases/*
If it returns permission denied
on su
Go to Settings
> Developer Options
> Root access
> Apps and ADB
No one seems to understand that a retail Nexus One even after being rooted still will not let you browse the file system using DDMS File Explorer. We are talking about real phones here and not the emulator. If you happen to have a Nexus One Developer Phone you can browse the file system using DDMS Filer Explorer, but a retail Nexus One that has been rooted you can't. Got it?
So I hope that answers the question of not being able to use the DDMS File Explorer to browse the file system of a rooted retail Nexus One. After rooting a retail Nexus One there is still something that remains to be done to use DDMS to use the File Explorer to browse the phones File System. I don't know what it is. Maybe someone else knowns.
If gives "permission denied" on adb shell -> su...
Some ROMs are running adbd daemon in secure mode (adbd has no root access and su command does not even show permission ask dialog on the device). In this case you will get "permission denied" when you try cmd -> adb shell -> su. The solution I've found is one app from the famous modder Chainfire called Adbd Insecure.
You must edit permission of data folder.
I use "Root Explorer" (see market) app on root mode.
On top select "Monunted as r/w"
then press over data folder (long click) and find Permission option
Have a somenthing like that
read write execute
User
Group
Others
Make sure that "Others" have a check for read
Then go Eclpse and try again.
Sorry about my english,I hope can help you.
To set permission on the data
folder and all it's subfolders and files:
Open command prompt from the ADB folder:
>> adb shell
>> su
>> find /data -type d -exec chmod 777 {} \;
Much simpler than messing around with permissions
in the android FS (which always feels like
a hack for me - because i believe there must be a kind of integrated way
) is just to:
Allow ADB root access
and Restart the deamon
with root permissions
.
- First be sure that ADB can have root access on your device (or emulator):
(Settings
->Developer Options
->Root-Access for ADB
orApps & ADB
. - Restart the ADB-Service with root-permissions:
Open acommand prompt
and type:adb.exe root
- Restart ADM (Android Device Manager):
Enjoy
browsing all files - To negate this process:
Typeadb.exe unroot
in yourcommand prompt
.
Event though it's a bit too late to try to answer this I'll leave what worked for me.
Peceps's solution didn't work because the SuperUser app didn't allow "shell" to have root access. So my solution is to directly use another app like RootExplorer and browse the folders from it.
If it retures "permission denied" on adb shell -> su...
Go to "Developer Options" -> Root access -> "Apps and ADB"
When I say file system I meant the whole file system. But you can only browse part of the file system on a retail phone, perhaps even most of file system but not ./data. Sorry for any confusion this may have caused.
This is alarming to me because I have a rooted my retail Nexus One and a developer/unlocked Nexus One. Since I rooted my retail Nexus One I can't figure out why I can't browse the whole file system like I can on my developer Nexus One.
If you NEED to do it on your phone, I use a terminal emulator and standard linux commands.
Example:
- su
- cd data
- cd com.yourappp
- ls or cd into cache/shared_prefs
http://www.appbrain.com/app/android-terminal-emulator/jackpal.androidterm
精彩评论