How to use adb command to push a file on device without sd card
I did it using the push
command, which has syntax:
adb push filename.extension /sdcard/0/
Example of copying directory, and sub-directory content:
adb push C:\my-location\data\. /storage/emulated/0/Android/data
Note that
push
did just hang in latest platform-tools (33.0.1
, at time of writing) for a certain amount of files, beside theadb.exe
suddenly taking 5MB+ instead of 1.5MB, hence I just did replace theadb.exe
with one I had from28.0.0
version of platform-tools (I did not downgrade the entire platform-tools, becauseadb.exe
is kind of stand-alone).I don't say there is any conspiracy around
data
folder,But my Samsung device puts limits on my USB file transfer, beside Android
v11+
not allowing access todata
folder anymore, hence I needed above command to work with 100% speed (without hanging one hour for little more files).
Follow these steps :
go to Android Sdk then 'platform-tools' path on your Terminal or Console
(on mac, default path is : /Users/USERNAME/Library/Android/sdk/platform-tools)
To check the SDCards(External and Internal) installed on your device fire these commands :
- 1) ./adb shell (hit return/enter)
- 2) cd -(hit return/enter)
now you will see the list of Directories and files from your android device there you may find /sdcard as well as /storage
- 3) cd /storage (hit return/enter)
- 4) ls (hit return/enter)
you may see sdcard0 (generally sdcard0 is internal storage) and sdcard1 (if External SDCard is present)
- 5) exit (hit return/enter)
to come out of adb shell
- 6) ./adb push '/Users/SML/Documents/filename.zip' /storage/sdcard0/path_to_store/ (hit return/enter)
to copy file
From Ubuntu Terminal, below works for me.
./adb push '/home/hardik.trivedi/Downloads/one.jpg' '/data/local/'