How to make a call via pc by ADB command on android?

后端 未结 6 405
旧巷少年郎
旧巷少年郎 2020-12-07 16:16

I would like to make call via ADB command on android\'s command line.

How should I use ADB command in order to make a call via PC?

please provide source code

6条回答
  •  Happy的楠姐
    2020-12-07 16:34

    you can launch the dialler, by first finding the package using

    adb shell dumpsys window windows | grep -E 'mCurrentFocus'
    

    then launching it using

    adb shell monkey -p  1 (probably com.android.contacts)
    

    ensure you're on the dialler and not the contacts page by clicking the coordinates of the dialler

    adb shell input tap   (in my case 65, 80)
    

    type the number

    adb shell input text 
    

    and then hit the dial coordinates

    adb shell input tap   (in my case 220, 750)
    

    For sure this answer is overkill. However, all of the previous answers i've encountered will then launch a dialog asking which application you wish to use to complete the action - skype, viber, etc., meaning if you have either not chosen a default dialler but have ott calling apps installed, or else have specified an alternative default dialler, the call will not be made over gsm. This method will ensure that gsm is used.

提交回复
热议问题