【发布时间】:2021-04-30 16:04:41
【问题描述】:
大家好,刚接触 shell 脚本。如果表现得像个菜鸟,请不要介意。
当我尝试在我的安卓设备上运行 shell 脚本时,不断弹出以下错误
#!/bin/bash
for i in $(seq 100)
do
echo "Time: $i"
adb -s $* shell am start com.android.camera/.Camera -W -S
adb -s $* shell sleep 3
adb -s $* shell input tap 540 1994
adb -s $* shell input tap 540 1994
adb -s $* shell input tap 540 1994
count=`adb -s $* shell ls /sdcard/DCIM/Camera/ | wc |awk '{print $1}'`
echo Count: $count
if [[ count -gt 500 ]]; then
break
fi
adb -s $* reboot
adb -s $* wait-for-device
adb -s $* shell sleep 40
adb -s $* shell input tap 500 1200
done
结果: adb.exe:未知命令 am adb.exe:未知命令休眠
【问题讨论】:
标签: android bash shell scripting