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

107016 次浏览

If you NEED to do it on your phone, I use a terminal emulator and standard linux commands.

Example:

  1. su
  2. cd data
  3. cd com.yourappp
  4. ls or cd into cache/shared_prefs

http://www.appbrain.com/app/android-terminal-emulator/jackpal.androidterm

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.

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.

On rooted device you can do this:

  1. Open cmd
  2. Type adb shell
  3. su
  4. Press 'Allow' on device
  5. chmod 777 /data /data/data /data/data/com.application.package/data/data/com.application.package/*
  6. Go to the DDMS view in Eclipse

After this you should be able to browse the files on the device.

To get the databases:

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

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.

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

If it retures "permission denied" on adb shell -> su...

Go to "Developer Options" -> Root access -> "Apps and ADB"

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.

  1. First be sure that ADB can have root access on your device (or emulator):
    (Settings -> Developer Options -> Root-Access for ADB or Apps & ADB.
  2. Restart the ADB-Service with root-permissions:
    Open a command prompt and type: adb.exe root
  3. Restart ADM (Android Device Manager):
    Enjoy browsing all files
  4. To negate this process:
    Type adb.exe unroot in your command prompt.