Appearance
adb push and pull: copy files to and from an Android phone
In short: adb push copies a file or folder from your computer to an Android phone, and adb pull copies one from the phone to your computer. For example, adb push report.pdf /sdcard/Download/ puts a file in the phone's Download folder, and adb pull /sdcard/DCIM/Camera copies its photos. /sdcard is the phone's shared storage.
adb copies files over the same connection as every other command, so it works by USB or Wi-Fi without any app on the phone, and it handles big folders that a file manager struggles with.
Syntax
bash
adb push [--sync] local/file-or-folder /sdcard/destination/
adb pull [-a] /sdcard/file-or-folder [local/destination]| Option | What it does |
|---|---|
--sync | With push: copies only files that are newer on your computer than on the phone |
-a | With pull: keeps the files' dates and permissions |
| Several sources | Both accept more than one file or folder, with the destination last |
Where things are on the phone
| Folder | What is in it |
|---|---|
/sdcard/Download/ | Downloads, and a good place for files you push |
/sdcard/DCIM/Camera/ | Photos and videos from the camera |
/sdcard/Pictures/Screenshots/ | Screenshots on Pixel and many other phones |
/sdcard/DCIM/Screenshots/ | Screenshots on Samsung phones |
/sdcard/Documents/ | Documents saved by apps |
/data/ | Apps' private data; closed to adb on normal phones |
adb shell ls /sdcard/ lists what is there; paths on the phone are case-sensitive.
Examples
bash
# A test file into the Download folder
adb push testdata.json /sdcard/Download/
# Every photo, into a folder called phone-photos, keeping their dates
adb pull -a /sdcard/DCIM/Camera phone-photos
# Several files at once
adb push one.pdf two.pdf /sdcard/Documents/
# A file from your own debuggable app's private folder
adb shell run-as com.example.app cat files/settings.json > settings.jsonPhotos you push may not appear in the gallery until the phone scans its storage again, for example after a restart.
On many phones at once
bash
for s in $(adb devices | awk 'NR>1 && $2=="device" {print $1}'); do
adb -s "$s" push testdata.json /sdcard/Download/
donepowershell
adb devices | Select-Object -Skip 1 | ForEach-Object {
$serial, $state = $_ -split '\s+'
if ($state -eq 'device') { adb -s $serial push testdata.json /sdcard/Download/ }
}To collect from every phone, pull into a folder per phone, as the ADB command builder writes for you. In BenchFleet, each phone's page has a file browser with drag and drop, on every plan, next to the live screen.
Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.
Common errors and fixes
| Error | What it means | Fix |
|---|---|---|
remote object '…' does not exist | The path on the phone is wrong | Check it with adb shell ls; paths are case-sensitive |
Permission denied | That place on the phone is protected | Use /sdcard/, or run-as for your own debuggable app |
Read-only file system | The destination is part of the system | Push to /sdcard/ instead |
No space left on device | The phone is full | Free up storage on the phone |
| A Windows path with spaces fails | The shell split the path in two | Put the path in quotes |
Related
- adb screenshot: capture screenshots and recordings to pull.
- adb shell: list, move and delete files on the phone.
- adb install: install APKs rather than copying them.
- All ADB commands and the ADB command builder.
Questions
How do I copy a file from my computer to an Android phone with adb?
Run adb push with the file and a folder on the phone, for example adb push report.pdf /sdcard/Download/. The file then appears in the phone's Download folder.
How do I copy photos from an Android phone with adb?
Run adb pull /sdcard/DCIM/Camera. adb copies the whole folder into a Camera folder where your terminal is; add a folder name at the end to choose where it goes, and -a to keep the photos' dates.
Where is /sdcard on an Android phone?
It is the phone's shared storage, the same place a file manager calls Internal storage, with folders such as Download, DCIM, Pictures and Documents. On most phones it is also reachable as /storage/emulated/0.
Can adb pull an app's private data?
Not on a normal phone, because each app's data is private. For an app you build yourself as debuggable, adb shell run-as with its package name can read its files; other apps' data needs a rooted test phone.
Can I copy a whole folder?
Yes. adb push and adb pull copy folders with everything in them, and adb push --sync copies only the files that are newer on your computer.
Start with the Free plan
Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.
- A full refund within 14 days of your first payment
- Starts in Local mode, with no telemetry or analytics
- Made by WOODCOMMERCE LTD, a company registered in the UK