sir*_*von 2 adb android-intent android-activity
如果我正在测试应用程序,请在android / adb shell中使用am start命令。并且该应用要求用户先登录才能继续浏览主要内容。如何使用am start命令从android命令行登录应用程序。
我缺乏理解是如何从shell / am start命令访问那些表单字段。
亚历克斯的回答很好,我放弃了。更加具体。这是我的一些代码,在您执行am start命令之后。
adb shell input keyevent 20 # or 61 for TAB, you might need to do more than once
adb shell input text "myusername"
adb shell input keyevent 66 #or 61 for TAB
adb shell input text "mypassword"
adb shell input keyevent 66 # or 61 to tab to the login button then add a 66
Run Code Online (Sandbox Code Playgroud)
我的问题是,必须使屏幕首先聚焦才能使此代码正常工作。我只需要触摸一下屏幕,那么代码就可以了。否则,它有时会起作用,但有时会不起作用。
我不知道什么代码可以实现“聚焦”功能。低级触摸事件将起作用,但是对于不同的android版本它是不同的,所以我不想使用它。
| 归档时间: |
|
| 查看次数: |
4635 次 |
| 最近记录: |