How to execute commands on a 3rd party app using adb commands or something similar

不想你离开。 提交于 2021-01-29 13:53:27

问题


I have a use case which requires an app, not developed by me, to be controlled. I have adb access to the android device. These are the steps that are required to be performed:

  1. Input text in two fields
  2. Press Enter
  3. Select checkboxes
  4. Enter text into another text field
  5. Enter

I know I can use adb input keyevent <event-code> and adb input touchpad tap <x> <y>, but these are brutish methods that won't work every time. I have looked into appium, but it seems to be limited to mobile web applications. Other frameworks like Espresso work, if you've built the app yourself.

I could not find any good answer to this problem. Any help is highly appreciated!


回答1:


Take a look at UiAutomator. It will enable you to launch a third-party app and perform any actions you want with it. In order to examine the UI and create the right locators, there's a command-line tool called uiautomatorviewer, bundled along with Android SDK.



来源:https://stackoverflow.com/questions/63295856/how-to-execute-commands-on-a-3rd-party-app-using-adb-commands-or-something-simil

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