Working with Android app files can feel like digging through someone else’s attic: useful things are tucked away behind locked doors, scattered in odd corners, and sometimes only visible with the right tools. The most direct tool for the job is the Android Debug Bridge (ADB). This guide explains how to use adb pull app data effectively — practical steps, real-world examples, and the caveats you must know before you start. If you prefer a quick resource or want to cross-check something later, this page links to an external site: keywords.
Why "adb pull app data" matters
When you want to extract files from an Android app — logs, databases, media cache, saved games, or configuration — adb pull is the command that copies files from the device to your computer. But because most app data lives in a protected area (/data/data/package), you’ll often run into permission barriers. Understanding the device state (rooted vs non-rooted), Android version (scoped storage rules), and app configuration (is it debuggable?) determines which method will work.
Preparation: what you need and why it matters
Before attempting adb pull app data, prepare the following:
- A computer with ADB installed (Android SDK platform-tools).
- USB debugging enabled on the target device (Settings → Developer options → USB debugging).
- A USB cable and drivers (Windows may need OEM drivers; macOS and Linux usually work out of the box).
- Knowledge of the app’s package name (e.g.,
com.example.app).
Enable Developer Options by tapping Build Number several times if you haven’t already. Then, connect and verify the device with adb devices. If the device is listed as "unauthorized," accept the debugging prompt on the device screen. This first handshake is often where many people get stuck — it’s like knocking and waiting for permission to enter the attic.
Common workflows for adb pull app data
1) Non-rooted device, app is debuggable
Some apps are built with the android:debuggable="true" flag (commonly the case for development builds). You can use the run-as trick to access the app’s data directory without root:
adb shell
run-as com.example.app
cd /data/data/com.example.app
ls -la
exit
exit
adb pull /data/data/com.example.app/databases/mydb.db ./mydb.db
Note: run-as only works if the app is debuggable and the APK's signing and permissions allow it. If it fails with "run-as: Package '...' is unknown" or "Permission denied," try a different approach.
2) Non-rooted device, use app-exposed storage
Some apps store user-visible files under external storage locations that are accessible without special privileges: /sdcard/Android/data/ or /sdcard/Android/obb/. On newer Android versions (Android 11+), access to these folders can be restricted by scoped storage, but ADB often still can read them.
adb shell ls -la /sdcard/Android/data/com.example.app
adb pull /sdcard/Android/data/com.example.app ./app-data
3) Use adb backup (unreliable on modern devices)
The older method of creating an ADB backup file can capture app data without root:
adb backup -f mybackup.ab -noapk com.example.app
Then use tools (like android-backup-extractor) to unpack .ab files. Warning: This method is increasingly unreliable — device OEMs and Android versions may disable or alter ADB backup behavior. Treat it as a fallback rather than a primary technique.
4) Rooted device or ADB root access
With root, everything changes: you can read any file under /data. If the device allows adb root (usually on emulators or engineering builds) or is rooted, do this:
adb root
adb remount
adb pull /data/data/com.example.app /local/path/com.example.app
Root makes extraction straightforward, but rooting has consequences: warranty, security, and potential bricking. Use it only when you understand those trade-offs.
How to find the app package name
You’ll often need the package name. Here are reliable ways to get it:
- From the Play Store web page URL (the package appears after
?id=). - On device:
adb shell pm list packages | grep -i part_of_name. - From the device UI: Settings → Apps → Select app → App details (some OEMs display package names).
Step-by-step example: extract a SQLite DB from a non-rooted test device
I once needed to retrieve a small SQLite database for debugging a sync issue. The app was a debug build, so run-as was available. Steps I took:
- Enabled USB Debugging and connected the device. Verified with
adb devices. - Confirmed package name with
adb shell pm list packages | grep myapp. - Used
run-asto ensure permissions and inspected the files:adb shell run-as com.my.app ls /data/data/com.my.app/databases. - Pulled the DB:
adb pull /data/data/com.my.app/databases/app.db ./app.db.
The whole operation took under 10 minutes. The key lesson: confirming the app’s build configuration saved me from attempting root or backups.
Troubleshooting common errors
Here are errors you’ll likely see and how to respond:
- Permission denied: The target file is in a protected area. Try
run-as(if app is debuggable) or use root. Alternatively, ask the app developer to expose the data or produce an export feature. - No such file or directory: Verify package name and path. Use
adb shell ls -la /data/datato confirm existence (requires permissions). - Device unauthorized: Check the device screen for an authorization prompt and accept it. If it doesn’t appear, revoke USB debugging authorizations on the device and reconnect.
- adb: error: insufficient permissions for device: On Windows, ensure proper drivers; on the device, ensure debugging is allowed. For certain OEMs, try changing USB mode (File Transfer / MTP).
Security, privacy, and legal considerations
Extracting app data often involves personal or sensitive information. Keep these rules in mind:
- Only access data for which you have explicit permission. Extracting someone else’s messages or private files without consent can be illegal.
- Maintain data security while moving files — use encrypted storage and delete local copies you no longer need.
- If you’re a developer, consider building an export feature into the app to simplify legal and secure data access for users and support teams.
Best practices and safety tips
Think of adb pull as a scalpel: precise when used correctly, dangerous when wielded carelessly. Follow these best practices:
- Create a working directory on your PC for extracted data and include timestamps in filenames for provenance.
- Document steps and commands you used in case you need to repeat the process or explain what you extracted and why.
- If you are debugging an app, use development builds with debuggable flags rather than trying to extract data from production builds.
- When possible, export or sync data from within the app (many apps have backup/export features designed for user data portability).
Commands quick reference
Here’s a compact list to copy and adapt:
# Verify device
adb devices
# List packages
adb shell pm list packages | grep myapp
# Try run-as for a debuggable app
adb shell run-as com.example.app ls /data/data/com.example.app
# Pull external storage app data
adb pull /sdcard/Android/data/com.example.app ./app-data
# Pull internal data (requires root or run-as)
adb pull /data/data/com.example.app/databases/app.db ./app-db
# Create an adb backup (may not work on all devices)
adb backup -f backup.ab -noapk com.example.app
When all else fails
If you can’t access files with these approaches, consider alternatives:
- Ask the app developer for an export or diagnostic bundle. Developers are often happy to help if you explain the issue.
- Use the app’s own cloud sync or account features to get data off the device.
- For forensic or advanced debugging scenarios, consult a professional who can analyze the device safely and legally.
Final thoughts and real-world perspective
Recovering app files via adb pull app data is part technical skill, part detective work. The specific Android version, device manufacturer, and the app’s build configuration shape what’s possible. In my experience helping teams debug synchronization problems, the fastest path is often simply asking for a debug build with android:debuggable="true" or an export routine — that approach preserves user privacy and reduces the need for risky root access.
For a quick refresher or to share this with teammates, save the commands above and test them on an emulated device or a dedicated test phone first. If you want a general resource to bookmark, this page offers one such pointer: keywords.
If you have a specific scenario (device make/model, Android version, and the app package name), tell me the details and I can walk you through a tailored set of commands and options.