How to push a file from computer to a android device having no SD Card in it. I tried:
C:\anand>adb push anand.jpg /data/local
3399 KB/s (111387 bytes in 0.032s)
C:\anand>adb push anand.jpg /data/opt
3199 KB/s (111387 bytes in 0.034s)
C:\anand>adb push anand.jpg /data/tmp
3884 KB/s (111387 bytes in 0.028s)
above commands to move a file anand.jpg
to device but I didn't get this jpg
file in the device.
I didn't get any success result on cmd prompt, I only got:
3399 KB/s (111387 bytes in 0.032s).
Sometimes you need the extension,
As there are different paths for different versions. Here is a generic solution:
Find the path...
adb shell
in command line.ls
and Enter.Now you'll see the files and directories of Android device. Now with combination of
ls
andcd dirName
find the path to the Internal or External storage.In the root directory, the directories names will be like
mnt, sdcard, emulator0,
etcExample:
adb push file.txt mnt/sdcard/myDir/Projects/
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 :
now you will see the list of Directories and files from your android device there you may find /sdcard as well as /storage
you may see sdcard0 (generally sdcard0 is internal storage) and sdcard1 (if External SDCard is present)
to come out of adb shell
to copy file
I've got a Nexus 4, that is without external storage. However Android thinks to have one because it mount a separated partition called "storage", mounted in "/storage/emulated/legacy", so try pushing there:
adb push anand.jpg /storage/emulated/legacy
You are trying to write to system folders. With ADB you have root (admin) access so you see the system folders of which sdcard is one of them so to send a picture you could use
D:\Program Files\Android\sdk\platform-tools\adb push am files\android sdk\adb.exe push C:\Downloads\anand.jpg /sdcard/pictures/
NB: C:\Downloads\anand.jpg replace with path and name to picture..
From Ubuntu Terminal, below works for me.