Skip to content

Instantly share code, notes, and snippets.

@ramiloif
Last active August 19, 2020 04:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramiloif/7f42087badfe9dcf44497bcb8d15f560 to your computer and use it in GitHub Desktop.
Save ramiloif/7f42087badfe9dcf44497bcb8d15f560 to your computer and use it in GitHub Desktop.
Make the broadcast receiver to receive a missed or answered call
phoneNumber=$1
echo Faking answered call to $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "RINGING" --es incoming_number $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "OFFHOOK" --es incoming_number $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "IDLE" --es incoming_number $phoneNumber
phoneNumber=$1
echo Faking missed call to $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "RINGING" --es incoming_number $phoneNumber
adb shell am broadcast -a android.intent.action.PHONE_STATE --es state "IDLE" --es incoming_number $phoneNumber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment