Why can't 'data' folder be displayed just like in DDMS file explorer?

herbertD picture herbertD · Sep 28, 2010 · Viewed 7.4k times · Source

I list out files in '/' by:

File directory = new File("/");
fill_listview(directory.listFiles());

And I get those in list:

sqlite_stmt_journals
config
cache
sdcard
d
etc
system
sys
sbin
proc
init.rc
init.goldfish.rc
init
default.prop
data
root
dev

I have two questions:

1.Why cann't I access '/data' folder just like Eclipse DDMS file explorer?

2.Why it is different from the DDMS which show only:

data
sdcard
system

Thanks!

Answer

peceps picture peceps · Jan 17, 2012

On rooted device you can do this to access the /data folder:

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

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