当我需要看医生时,我必须:
致电 666666666
等待 5 秒
按1
等待 5 秒
按 20301990
等待 5 秒
按1
所以我想自动化所有这些步骤
我知道我可以触发电话做:
adb shell am start -a android.intent.action.CALL -d tel:666666666
我可以通过以下方式模拟输入:
sleep 5
adb shell input text "1"
sleep 5
adb shell input text "20*30*1990"
sleep 5
adb shell input text "1"
但是如果我在adb shell am start -a android.intent.action.CALL -d tel:666666666
之后和adb shell input text "1"
之前没有打开 de 拨号盘,它将无法工作
所以我的问题是:我怎么能在使用亚行通话时打开拨号盘?
您可以找到表盘按键的坐标,然后通过发送input tap x y
来模拟按下。
如果您的自动化将在不同类型的多个设备上使用,我建议您编写一个使用uiautomator的简单 python 脚本来完成该任务。
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(52条)