HomeSmartphoneHow to Make Calls and Send SMS via ADB Commands

How to Make Calls and Send SMS via ADB Commands

Published on

Sometimes you may want to make phone calls or send text messages using ADB (Android Debug Bridge) commands on your Android phone, for example, 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

To use ADB commands on your device, you need some expertise and certain prerequisites. You should enable USB Debugging, install ADB drivers on your computer, and requires Google Platform Tools to execute the commands.

If you already have these set up on your phone and computer, 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.

ALSO READ: How to Use ChatGPT to Identify Phishing Emails, Spam SMS & Scam Calls

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 enhances your Android development process and automate tasks efficiently. With this guide, you can easily execute these commands and enhance your productivity.

Explore More:

Ishanvi
Ishanvi
Ishanvi is a backend software engineer who mentors others to grow, combining deep technical expertise with a focus on practical, impactful solutions, continuous learning, and helping teams work smarter.

Latest articles

Embed YouTube Videos in Excel Spreadsheets: A Step-by-Step Guide

By adding videos in your Excel spreadsheet you can explain what your spreadsheet data...

How to Create Professional Name Stickers in Microsoft Word

Microsoft Word is an excellent tool for designing and printing custom name stickers at...

Learn How to Use VLOOKUP in Google Sheets: A Practical Guide for Beginners

VLOOKUP or vertical lookup in Google Sheets ia s search and retrieve function for...

Can Google Sheets Be Password Protected? A Complete Guide

Can Google Sheets be password protected? The short answer is Yes, but not in...