Adb sleep 函数在 adb 上工作但不在 .sh 文件中

Mno*_*def 1 bash shell powershell android

我正在尝试制作一个简单的“点击并等待”脚本,通过 adb 在我的 Android 设备上运行。

使用命令在 Powershell 上打开 adb./adb shell有效,运行input tap 300 300有效,运行sleep 1确实会休眠一秒钟。

但是,如果我使用test.shPowershell 命令运行脚本,./adb shell "sh /sdcard/Download/test.sh"点击部分仍然有效,但sleep调用会给出以下信息:'sdcard/Download/MIOPROGRAMMA.sh[2]: sleep: syntax error: Invalid argument '1

知道为什么会发生这种情况吗?

Ped*_*ito 5

;只需在 , 后面添加即可int

input tap 250 250
sleep 3;
input tap 350 250
sleep 3;
input tap 450 250
sleep 3;
input tap 550 250
sleep 3;
input tap 650 250
sleep 3;
Run Code Online (Sandbox Code Playgroud)