gpt4 book ai didi

Android 模拟器 "adb push"不工作(没有那个文件或目录)

转载 作者:太空狗 更新时间:2023-10-29 15:36:06 46 4
gpt4 key购买 nike

我想在 Android 模拟器上打开本地网页,因此我创建了一个模拟器 API 14 (Android 4.0) 并从 AVD 管理器启动了它。下一步:将我的文件从 pc 移动到模拟器并在浏览器中打开它。这就是问题...

我正在尝试以下命令:

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

结果总是一样的:

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

如果我运行 shell,我可以看到 sdcard 文件夹:

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

有什么帮助吗?谢谢 #

最佳答案

终于明白是sdcard权限的问题了。我在 adb shell 中按照以下步骤更改了读写权限:

https://stackoverflow.com/a/19221592/2090803

之后,adb push 命令运行良好:

adb push C:\My\local\directory /sdcard/myFolder

adb 自动创建新文件夹 myFolder 并正确推送目录和所有子目录和文件。

关于Android 模拟器 "adb push"不工作(没有那个文件或目录),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27104165/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com