How to copy files using adb commands | adb push | adb pull

How to copy files using adb commands | adb push | adb pull

How to copy files using adb commands | adb push | adb pull

1. How to push or copy files from computer to device, UE, mobile phones?

To copy files using adb commands run these commands in sequences. You should know the exact directory path of the mobile device.

adb push <file path at your computer>  <directory path of your device>

Example:
a. adb root
b. adb disable-verity
c. adb remount adb push example.txt bin/
d. adb push example.txt /sdcard/Download/

2. How to pull or copy files from device to computer?

a. adb root
b. adb pull /sdcard/Download/example.txt

Options for push and pull commands

push [–sync] [-z ALGORITHM] [-Z] LOCAL… REMOTE
copy local files/directories to device
–sync: only push files that are newer on the host than the device
-n: dry run: push files to device without storing to the filesystem
-z: enable compression with a specified algorithm (any, none, brotli)
-Z: disable compression
pull [-a] [-z ALGORITHM] [-Z] REMOTE… LOCAL
copy files/dirs from device
-a: preserve file timestamp and mode
-z: enable compression with a specified algorithm (any, none, brotli)
-Z: disable compression
sync [-l] [-z ALGORITHM] [-Z] [all|data|odm|oem|product|system|system_ext|vendor]
sync a local build from $ANDROID_PRODUCT_OUT to the device (default all)
-n: dry run: push files to device without storing to the filesystem
-l: list files that would be copied, but don’t copy them
-z: enable compression with a specified algorithm (any, none, brotli)
-Z: disable compression

Click here for adb commands | adb devices | adb device not found | adb push | adb shell.

External source https://developer.android.com/studio/command-line/adb.

One thought on “How to copy files using adb commands | adb push | adb pull

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.