使用ADB访问屏幕上的特定UI控件 [英] Using ADB to access a particular UI control on the screen

查看:947
本文介绍了使用ADB访问屏幕上的特定UI控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

adb shell 控制台是否可以使用其ID访问Android应用的特定按钮?或文字?

Is it possible for adb shell console to access an Android app's specific button using its id? or text?

我正在尝试自动在设备上单击按钮。这是一个可从浏览器访问的Web应用程序。因此,如果我有该按钮ID,我可以向该按钮发送操作吗?

I'm trying to automate the button click on the device. This is a web app accessed from a browser. So if I have that button id can I send an action to that button?

推荐答案

我认为您可以做的最好是

I think the best you can do is to inject touch based on a coordinate.

请参见将触摸事件从ADB发送到设备
使用ADB模拟触摸

您可能会从dumpsys窗口或活动中获得按钮的坐标。

You might get a coordinate of a button from dumpsys window or activity.

您还可以签出 Monkeyrunner

这篇关于使用ADB访问屏幕上的特定UI控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆