How to select all the text in a editText with adb?

泄露秘密 提交于 2019-12-11 13:04:35

问题


Is it possible to select all the text in an editText with ADB in android? Right now, I'm using the command:

sudo /Applications/sdk/platform-tools/adb shell input keyevent KEYCODE_DEL

50 times, so that it erases the whole sentence, but it is very slow.


回答1:


Throw the following command on an active text box

start /B adb shell input keyevent KEYCODE_MENU & adb shell input keyevent KEYCODE_A perl -e 'select(undef,undef,undef,.3)' & adb shell input keyevent KEYCODE_BACK

The second line removes the activated menu from your app if it has one. If it does not, run only the first line.




回答2:


try long press on the textedit with adb swipe

adb shell input swipe 100 200 100 200 1000


来源:https://stackoverflow.com/questions/21896134/how-to-select-all-the-text-in-a-edittext-with-adb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!