如何在使用 adb 通话期间打开拨号盘?

How can I open the dial pad during a call using adb?

当我需要看医生时,我必须:

  1. 拨打666666666
  2. 等待 5 秒
  3. 按 1
  4. 等待 5 秒
  5. 按 20301990
  6. 等5秒
  7. 按 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"

之前不打开拨号盘,它就无法工作

所以我的问题是:如何在使用 adb 通话期间打开拨号盘?

您可以找到拨号盘按键的坐标,然后发送input tap x y模拟按下。
如果您的自动化将用于不同类型的多个设备,我建议您编写一个简单的 python 脚本,使用 uiautomator 来完成该任务。