In this post I am going to demonstrate how to access system folder ie “data” folder in real android devices using DDMS. At times it is necessary to view the contents of ‘data’ folder which contains all the files such as shared preferences, database or text file of a particular application. By default data folder is accessible while using an emulator but while using real devices the folder is private and it is not accessible by using DDMS. The hierarchy of data folder is shown
(Image courtesy: Xplore File Explorer for Android)
So inorder to get access use the following steps
- Connect your device. Make sure that device has ROOT access.
- Open command prompt (For windows).
- Set path for android platform tools ie set path=”C:\Program Files\Android\android-sdk\platform-tools” and type enter.
- Type adb devices and make sure that the phone is listed after executing the command.
- Type adb shell.
- Type su.
- Type chmod 777 /data /data/data /data/data/<packagename>/*
- For example chmod 777 /data /data/data /data/data/com.sample.app/*
- Now goto DDMS and check whether the data folder is accessible.