简体   繁体   中英

Android emulator "adb push" not working (No such file or directory)

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 #

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.

I think the problem is destination path. you should add / to beginning of your destination path. try :

adb push  C:\My\local\directory\file.txt '/sdcard/path'

I think the problem is the folder structure. The folders have to be there before you start to copy because adb can't create them.

try this it worked for me:

adb push "local path" sdcard/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM