Android 无法获取路径在Windows shell中工作的ADB shell命令
我试图从屏幕转储中获取像素的颜色。当我首先使用“adb shell”时,我可以让命令工作,但我希望能够从windows shell直接运行该命令。我已经试过了所有的建议,但都没用Android 无法获取路径在Windows shell中工作的ADB shell命令,android,windows,shell,adb,Android,Windows,Shell,Adb,我试图从屏幕转储中获取像素的颜色。当我首先使用“adb shell”时,我可以让命令工作,但我希望能够从windows shell直接运行该命令。我已经试过了所有的建议,但都没用 “C:\Program Files\Microvirt\MEmu\adb.exe”-s 127.0.0.1:21503 shell dd if='/sdcard/screen.dump'bs=4 count=1 skip=54950 2>/dev/null | hd 这是回报 '系统找不到指定的路径' 如果我尝试: “
“C:\Program Files\Microvirt\MEmu\adb.exe”-s 127.0.0.1:21503 shell dd if='/sdcard/screen.dump'bs=4 count=1 skip=54950 2>/dev/null | hd
这是回报
'系统找不到指定的路径'
如果我尝试:
“C:\Program Files\Microvirt\MEmu\adb.exe”-s 127.0.0.1:21503 shell\“dd if=”/sdcard/screen.dump'bs=4 count=1 skip=54950 2>/dev/null | hd\”
它返回:
/system/bin/sh:dd if='/sdcard/screen.dump'bs=4 count=1 skip=54950
2> /dev/null |未找到hd
sh文件确实存在于/system/bin/中,因此我不知道发生了什么。您不需要转义
“
字符来输入adb shell的命令
"C:\Program Files\Microvirt\MEmu\adb.exe" -s 127.0.0.1:21503 shell "dd if='/sdcard/screen.dump' bs=4 count=1 skip=54950 2>/dev/null | hd"
好的
而且你的评论说,
该文件夹已在my PATH环境变量中
然后,您不需要指定adb
的完整路径
adb -s 127.0.0.1:21503 shell "dd if='/sdcard/screen.dump' bs=4 count=1 skip=54950 2>/dev/null | hd"
也可以
错误消息
/system/bin/sh:dd if='/sdcard/screen.dump'bs=4 count=1 skip=54950 2>/dev/null |未找到hd
指示没有名为“dd if=”/sdcard…null | hd的可执行文件,但您只需要将其作为参数,而不是完整的可执行文件名
对于你的第一次尝试
"C:\Program Files\Microvirt\MEmu\adb.exe" -s 127.0.0.1:21503 shell dd if='/sdcard/screen.dump' bs=4 count=1 skip=54950 2>/dev/null | hd
此命令将考虑hd
之外的adb外壳
,它将由Windows的命令行执行
更新:我们可以使用od
或hd
的参数来做一些技巧。
例如,在我的设备上,busybox od
具有参数[-t TYPE]
,[-A基数]
,[-N大小]
和[-j SKIP]
,然后在我的手机上我可以这样做
adb shell od -N4 -j54950 -tx1 -Ax /sdcard/screen.dump
adb shell dd if='/sdcard/screen.dump'bs=4 count=1 skip=54950 2>/dev/null | hd
返回与系统找不到指定路径相同的错误。包含adb.exe的文件夹拼写为MEmu(它是一个模拟器)。该文件夹已在我的PATH环境变量中。其他命令,如adb shell screencap/sdcard/screen.dump
工作正常。@JonGoodwin这是原始作者将adb连接到设备的配置,可能在同一台机器上有一个模拟器。因此我保留它。@JonGoodwin我不确定源代码是否正确al author的收件箱中会有我们的评论信息……但是,我们知道,当他回到这个问题时,他会看到我们的答案和评论。此外,如果我尝试提及两个人,就会出现错误,“只能通知另外一个@用户;如果我尝试“C:\Program Files\Microvirt\MEmu\adb.exe”-s 127.0.0.1:21503 shell“dd If=”/sdcard/screen.dump'bs=4 count=1 skip=54950 2>/dev/null | hd”
它返回:用法:hd[-b base][-C count r delay]文件
@JoeBriggs然后是时候尝试如何在您的机器中使用hd
。例如,使用busybox hd
或hd-
?这是更具体的设备。