mock events are all implemented through the input command, starting with the use of the input command:
usage: input … p> input text & lt; string>
input keyevent & lt; key code number or name>
input tap & lt; x> < y>
input swipe & lt; x1> < y1> < x2> < y2>
1. Keyevent refers to the corresponding android keycode, such as the home key keycode=3 and the back key =4.
please refer to < Android Keycode Details & GT; http://blog.csdn.net/huiguixian/article/details/8550170 p>
is easy to use, for example, if you want to simulate the home button:
adb shell input keyevent 3
please refer to the above article and edit according to the specific keycode.
2. For tap, it simulates events on the touch screen, giving only x and y coordinates.
this x and y coordinate corresponds to the real screen resolution, so it should be seen according to the specific phone. For example, if you want to click the screen (x, y) = (250, 250) position:
adb shell input tap 250 250
3. Swipe is the same as tap, except that it is a simulated sliding event, and the coordinates of starting point and ending point are given. For example, going from screen (250, 250) to screen (300, 300) is
adb shell input swipe 250 250 300 300
Read More:
- Android ADB command adb devices error: protocol fault (no status)
- Android error: ADB port is occupied( adb.exe ,start-server’ failed — run manually if necessary)
- After adb is connected to an android phone, remount failed: operation not permitted when adb remount is a roundabout solution
- Android monitor EditText text input EditText monitor events and input events
- Android listview entry button click state chaos solution
- Install Android SDK — stopping ADB server failed (code – 1)
- Android Error: Consumer closed input channel or an error occurred. events=0x9
- Using CV2 to solve sliding verification code
- Error running app:Instant Run requires Tools | Android Enable ADB integration‘ to be enabled.
- Click the button to use in the react project window.open Methods open a new page and click the data again
- How to Fix adb_server_notify: ADB server connection failed
- Solutions to the lack of minimize and maximize buttons in CentOS Chrome browser
- This version of chromedriver only supports chrome version 92 crawler simulates the problem of Google plug-in version when the browser clicks and reports an error
- After using fastlick, double-click the error reporting solution
- Error: Error parsing D:\new_android\Android SDK\system-images\android-25\android-wear\armeabi-v7a\de
- Events.js:167 throw er appears when starting node service under linux; // Unhandled ‘error’ event solution
- Uiautomatiorviewer connect to the machine and click to report unexpected error while observing UI hierarchy
- Viewing events.out.tfevents file visually in tensorboard
- Command not found: ADB appears on Mac
- Velt-0.1.3 development: generating events