How to access data/data folder in Android device?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The /data/data/ directory on Android contains private application data — databases, shared preferences, cache files, and internal storage for each installed app. Accessing this directory is restricted by Android's security model, but developers need to reach it for debugging, database inspection, and troubleshooting. The methods available depend on whether the device is rooted, an emulator, or a debuggable build.
Method 1: Android Studio Device Explorer (Recommended)
The easiest approach for debuggable apps:
- Open Android Studio > View > Tool Windows > Device Explorer
- Navigate to
/data/data/<your.package.name>/ - Browse, download, or upload files directly
This works on:
- Emulators: Full access to all app directories
- Physical devices: Only for apps with
android:debuggable="true"in the manifest (debug builds)
Method 2: ADB Shell (run-as)
Access your own app's data directory without root:
The run-as command only works for apps signed with a debug key or with android:debuggable="true".
Method 3: ADB Pull (Emulators Only)
On emulators (which typically run as root):
This does not work on non-rooted physical devices — you get "Permission denied".
Method 4: Rooted Device
On a rooted device, you have unrestricted filesystem access:
Method 5: Backup and Extract (No Root)
Use adb backup to extract app data:
Note: Many apps disable backups with android:allowBackup="false", which blocks this method.
Method 6: Content Providers (Programmatic Access)
Access other apps' shared data through content providers:
Directory Structure
Common Pitfalls
- Permission denied on physical devices:
adb pull /data/data/...only works on emulators or rooted devices. Userun-asor Device Explorer for debug builds on physical devices. - run-as fails on release builds:
run-asrequiresandroid:debuggable="true". Release builds (from Play Store or signed with a release key) do not allowrun-as. - Security risks of rooting: Rooting a device exposes all app data, including credentials and tokens. Never root a device that contains sensitive personal data.
- Scoped storage (Android 10+): Starting with Android 10, apps have restricted access to external storage. Internal storage (
/data/data/) access rules remain unchanged, but the methods to share files between apps have changed. - SELinux enforcement: Even with root, SELinux policies may prevent access to certain directories. Use
setenforce 0temporarily (development only) or checkadb shell getenforce.
Summary
- Use Android Studio Device Explorer for the easiest GUI-based access to debuggable apps
- Use
adb shell run-as <package>to access your own debug app's data on physical devices - Use
adb pullon emulators where root access is available by default - Root access gives full filesystem access but carries security risks
- The
/data/data/<package>/directory contains databases, shared preferences, cache, and internal files - Release builds restrict access to app data — plan your debugging workflow around debug builds

