我想写个自动化操作的机器人,需要模拟用户行为,听说adb可以,请问android adb如何模拟用户点击、滑动、输入、按键?
网友回复
//模拟输入“001”
adb shell input text “001” //模拟home按键 adb shell input keyevent 3 //模拟点击(540, 1104)坐标 adb shell input tap 540 1104 //模拟滑动,从(250,250)滑动到(300,300) adb shell input swipe 250 250 300 300 keyevent code:KEYCODE_UNKNOWN=0; KEYCODE_SOFT_LEFT=1; KEYCODE_SOFT_RIGHT=2; KEYCODE_HOME=3; //home键 KEYCODE_BACK=4; //back键 KEYCODE_CALL=5; KEYCODE_ENDCALL=6; KEYCODE_0=7; KEYCODE_1=8; KEYCODE_2=9; KEYCODE_3=10; KEYCODE_4=11; KEYCODE_5=12; KEYCODE_6=13; KEYCODE_7=14; KEYCODE_8=15; KEYCODE_9=16; KEYCODE_STAR=17; KEYCODE_POUND=18; KEYCODE_DPAD_UP=19; KEYCODE_DPAD_DOWN=20; KEYCODE_DPAD_LEFT=21; KEYCODE_DPAD_RIGHT=22; KEYCODE_DPAD_C...
点击查看剩余70%