Skip to content

How to Make Calls and Send SMS via ADB Commands

May 23, 20254 minute read

In certain situations, you may want to make phone calls or send text messages using ADB (Android Debug Bridge) commands on your Android phone, especially if the touchscreen becomes non-functional unexpectedly. In this article, we will learn how to make phone calls and send SMS using ADB commands.

How to Make Calls and Send Text via ADB Commands

Also, if you’re looking to enhance your Android development skills or automate tasks on your device, using ADB (Android Debug Bridge) commands to make calls and send SMS can be incredibly useful. Here is how to execute these commands effectively.

To use ADB commands on your device, you need some expertise and certain prerequisites. For instance, you must enable USB debugging, install ADB drivers on your computer, and have Google Platform Tools to execute the commands. If you already have these set up, then follow the guide below to make calls and send SMS via ADB.

How to Make Phone Calls Via ADB Commands?

Ensure that you have connected your phone to your PC, enabled USB debugging on your device and installed the Platform Tools on your computer.

1. Launch a PowerShell window from the Platform Tools folder (on Windows 11, right-click and select ‘Open in Terminal’).

2. Type adb shell in the command window and press Enter.

3. Next, type or paste the following command in PowerShell and press Enter:

am start -a android.intent.action.CALL -d tel:+910123456789

[Replace the phone number in the command with the number you want to call.]

4. When you hit Enter, your Android device will dial the number.

5. If you receive a phone call on your Android phone and want to answer it via ADB, enter the following command:
adb shell input keyevent KEYCODE_CALL

6. To end or hang up an incoming phone call, enter this command:
adb shell input keyevent KEYCODE_ENDCALL

That is all about how to make phone calls, receive, cut or hang up incoming calls via ADB commands. Now, here is how to send text messages via ADB commands.

Sending Text Messages Using ADB Commands

1. Launch a PowerShell window on your computer, type adb shell in the command window and press Enter.

2. To open the Messages app and pre-fill the message content, use the following command.

am start -a android.intent.action.SENDTO -d sms:+ 910123456789 --es sms_body "your text message"
[Make sure to replace the phone number and message body with your own]

3. To send the message, you need to simulate key events. Execute the following commands one after the other:
input keyevent 22
input keyevent 66

[The key event codes mentioned above may not work with third-party keyboard apps. It’s recommended to use the default keyboard on your device. You may need to find the correct key event values for your specific setup.]

4. Now, to input text in applications like Instagram, WhatsApp, Facebook, Twitter, etc., follow these steps: Use the following command to input your desired text. Replace “your text message” with your actual message:

adb shell input text 'your text message'

5. After the text is inputted, execute the following command to simulate the “Enter” key:
adb shell input keyevent 22

This will input the text into the currently open app’s text field. If no app is open, the text will be sent to the Google Search box.

By following these steps, you can effectively make phone calls and send text messages and input text in various applications using ADB commands.

Conclusion:

Using ADB commands to make calls and send SMS can streamline your Android development process and automate tasks efficiently. With this guide, you can easily execute these commands and enhance your productivity.

Tips for Using ADB Commands

ADB, or Android Debug Bridge, is a versatile command-line tool that allows you to communicate with an Android device. It enables developers to perform various tasks, including installing applications, debugging, and executing commands directly on the device.

Use adb devices command to ensure your device is recognized. Make sure your app has the necessary permissions to make calls and send SMS. Also, always test commands with caution to avoid unintended actions.

InfoInTech staffs have knowledge and practical experience to advice on how to use tech more efficiently.

Previous Article --- Next Article

No Comments

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts
Recent Articles
Tutorials
Back To Top