在AVD的更多選項中,sensors 的 move,拉動 Y 軸可以模擬前後晃動,對部分 app 有模擬步數的效果。
不想一直手拉,可以用下面的指令不段重複,直到 crtl + c 離開:
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










