Saturday, April 2, 2022

[SOLVED] How do I send SMS using the adb shell command on all versions from Android 6 to Android 12?

Issue

I'm trying to send messages using adb shell commands. I sent on Android 10 but not on Android 11. I tried everything but without success. I found source code of isms service for android 11 href="https://github.com/aosp-mirror/platform_frameworks_base/blob/android11-release/telephony/java/com/android/internal/telephony/ISms.aidl" rel="nofollow noreferrer">here. I have 2 more Android 11 phones and when I test them the result is the same. To test that my shell commands are working on the device, I tried the input command and it does. I read this and still it didn't help.

The command I use:

adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "%number%" s16 "null" s16 "%message%" s16 "null" s16 "null"

Output of this command:

Result: Parcel(00000000 '....')

Can someone help, how do I send messages with adb shell commands on Android 11?

(I tried on Android 12 and result is same)


Solution

After Android 10:

adb shell service call isms 5 i32 1 s16 "com.android.mms" s16 "null" s16 "number" s16 "null" s16 "message" s16 "null" s16 "null" i32 0 i64 0

Before Android 10:

adb shell service call isms 7 i32 1 s16 "com.android.mms" s16 "number" s16 "null" s16 "message" s16 "null" s16 "null"


Answered By - Abdulkadir Can Kinsiz
Answer Checked By - Mildred Charles (WPSolving Admin)