Skip to content

Instantly share code, notes, and snippets.

@ekiara
Created May 14, 2023 06:16
Show Gist options
  • Save ekiara/5b817b5acab77c38c5e4641fd6b0e04e to your computer and use it in GitHub Desktop.
Save ekiara/5b817b5acab77c38c5e4641fd6b0e04e to your computer and use it in GitHub Desktop.
adb_ussd_command.sh
# Start the phone dialer activity
adb shell am start -a android.intent.action.CALL -d "tel:*123#"
# Wait for the dialer to open
sleep 2
# Input the USSD command
adb shell input text "<your_ussd_code><parameter>"
# Send the USSD command
adb shell input keyevent 66
# Wait for the response to be displayed
sleep 5
# Take a screenshot (optional)
adb shell screencap -p /sdcard/ussd_response.png
# Pull the screenshot to your computer (optional)
adb pull /sdcard/ussd_response.png <path_to_save_screenshot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment