ADB provides a plethora of features for executing various tasks on connected Android devices or emulators.  The scope of what ADB and fastboot commands can do on Android devices is unlimited. In this tutorial, we’ll see how to make calls and send text messages using ADB Shell commands on Windows, Mac, and Linux.

ADB allows for a wide range of actions such as installing and uninstalling apps, capturing screenshots, recording screen activity, and transferring files between devices and computers. This versatile tool has extensive capabilities and flexibility in controlling different aspects of an Android device via USB connection or wireless network protocols like Wi-Fi or Bluetooth.

You can send and execute ADB commands in 3 ways.

Table of Content

ADB Command to Make a Call

The best and quickest way to make phone calls is via the Phone app. However, if there’s some physical damage to your Android phone and the touchscreen is not functioning, you can use ADB Shell commands for the purpose. Follow the steps below to make a call from your Android device without touching it.

  1. Launch a PowerShell window with the path of the ‘platform-tools’ folder.
  2. To enable ADB Shell mode, type adb shell in the command window and press Enter.
  3. Now type or paste the following command in PowerShell.
    am start -a android.intent.action.CALL -d tel:+19792211000
  4. Replace the phone number given in the command with the number you want to make a call to.
  5. As soon as you hit Enter, your Android device will dial the number.adb shell command to make phone calls

Picking up and Ending a Call with a Command

You can make calls, pick up an incoming call, or cancel it. Here’s how to do that.

Launch a PowerShell window and execute the following command to accept an incoming call on Android:

adb shell input keyevent KEYCODE_CALL

To cut or hang up an incoming call, execute the command given below:adb command to hang up phone call on android

adb shell input keyevent KEYCODE_ENDCALL

ADB Command to Send Text Message

You can also send text messages to any phone number from your Android device from the command-line interface on your Windows, Mac, or Linux computer.

  1. Open a PowerShell window and execute the adb shell command.
  2. Right after the dollar sign ($), type the following command. Do not forget to replace the phone number and message body (highlighted in blue).
    am start -a android.intent.action.SENDTO -d sms:+17007800006 --es sms_body "Test Message from Technastic.com"
  3. This command will open the Messages app and input the message content in the text field.
  4. To send your message, you’ll need to execute the following key event commands one after another to send your message to the recipient.
    input keyevent 22 
    input keyevent 66

    adb command to send text message

Note: The key event codes to emulate the send button may not work on Android devices with Gboard or any 3rd part keyboard app. Please use the default keyboard of your device. You may need to find the correct key event values to trigger the send button.

5 Ways to Restore Deleted Contacts on Android

ADB Command to Input Text on Android

If you want to input text in apps like Instagram, WhatsApp, Facebook, Twitter, etc., or search for something on Google with a text query, there is an ADB command for this as well.

Open a PowerShell or Command Prompt window on your Windows PC. Then type or paste the following command.

adb shell input text 'I love this adb command'

Feel free to replace the highlighted text body in the above command with yours and press Enter.print text on android using adb command

Now that ADB has printed the text on your Android device, execute the following key event code shown in the screenshot.

adb shell input keyevent 22

The text will be printed in the currently open app’s text field. If no app is open on your phone, this command will send the text to the Google Search box.

If you want to save yourself from navigating to the ‘platform-tools’ folder to launch a command window with a path, consider setting up system-wide ADB on Windows.

Was this Article helpful?
YesNo