在 AVD 的更多選項中,sensors 的 move,拉動 Y 軸可以模擬前後晃動,對部分 app 有模擬步數的效果。
不想一直手拉,可以用下面的指令不斷重複,直到 crtl + c 離開:
上面 5554 為 AVD port,可以先用指令確認 port:trap "echo Stopped; exit" INT while true; do { echo "auth $(cat ~/.emulator_console_auth_token)" echo "sensor set acceleration 0:9:0" } | nc localhost 5554 sleep 0.1 { echo "auth $(cat ~/.emulator_console_auth_token)" echo "sensor set acceleration 0:13:0" } | nc localhost 5554 sleep 0.1 done
adb devices
若輸出為 emulator-5556 或是其他數字可以自行修改。

沒有留言:
張貼留言