Android emulator "adb push" not working (No such file or directory)
Solution 1
Finally I understood the problem was the sdcard permissions. I changed the read-write permissions following this steps in the adb shell:
https://stackoverflow.com/a/19221592/2090803
After that, the adb push
command worked fine:
adb push C:\My\local\directory /sdcard/myFolder
The adb automatically created the new folder myFolder
and pushed correctly the directory and all the subdirectories and files.
Solution 2
I think the problem is destination path. you should add /
to beginning of your destination path. Try this:
adb push C:\My\local\directory\file.txt '/sdcard/path'
ainos984
Frontend, backend and anyend programmers! I just love programming since I was ten years old ;)
Updated on August 20, 2021Comments
-
ainos984 almost 3 years
I'd like to open local web pages on an android emulator, so I created an emulator API 14 (Android 4.0) and I launched it from the AVD manager. Next step: move my files from pc to emulator and open it in a browser. That's the problem...
I'm trying the following commands:
adb push C:\My\local\directory sdcard adb push C:\My\local\directory /sdcard adb push C:\My\local\directory /mnt/sdcard adb push C:\My\local\directory /storage/sdcard
The result is always the same:
push: C:\My\local\directory/subdirectory/file2.txt -> sdcard/subdirectory/file2.txt failed to copy 'C:\My\local\directory/subdirectory/file2.txt' to 'sdcard/subdirectory/file2.txt': No such file or directory
If I run the shell I can see the sdcard folder:
C:\Users\me\Desktop\and-s-ws\sdk\platform-tools>adb shell # ls ls acct cache config d data default.prop dev etc init init.goldfish.rc init.rc mnt proc root sbin sdcard sys system ueventd.goldfish.rc ueventd.rc vendor # cd sdcard cd sdcard # ls ls
Any help? Thanks #
-
ainos984 over 9 yearsas You can see in the question, even this test gives error. thanks anyway
-
ainos984 over 9 yearsNo it wasn't. As you can see in my answer, the problem was the read-write permission on the sdcard folder. Thanks anyway.