简体   繁体   English

在 Android 电话上使用 adb bridge 从 Linux 终端发送短信

[英]Send SMS from Linux Terminal using adb bridge on Android Phone

I tried to follow Solution 1 and also Solution 2 .我试图遵循Solution 1Solution 2 Unfortunately, I receive the following:不幸的是,我收到以下信息:

$ adb shell service call isms 5 s16 "1234564789" i32 0 i32 0 s16 "SMS TEXT HERE"

service: unknown option TEXT服务:未知选项 TEXT

Result: Parcel(a Copying message to Icc: Neither user 2000 nor current process has android permission RECEIVE SMS)结果:Parcel(a Copying message to Icc: Neither user 2000 nor current process has android permission RECEIVE SMS)

$ adb shell service call isms 5 s16 "+1234564789" i32 0 i32 0 s16 "SMS TEXT HERE"

service: unknown option TEXT服务:未知选项 TEXT

Result: Parcel(a Copying message to Icc: Neither user 2000 nor current process has android permission RECEIVE SMS)结果:Parcel(a Copying message to Icc: Neither user 2000 nor current process has android permission RECEIVE SMS)

$ adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+1234564789" s16 "null" s16 "keje" s16 "null" s16 0

Result: Parcel(Attempt to get length of null array)结果:包裹(尝试获取null数组的长度)

$adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+1234564789" s16 0 s16 "Hey you !" s16 0 s16 0

Result: Parcel(Attempt to get length of null array)结果:包裹(尝试获取null数组的长度)

$adb shell service call isms 5 s16 "com.android.mms" s16 "+1234564789" s16 "+61418706275" s16 "Hey you !" i32 0 i32 0

Result: Parcel(Attempt to get length of null array)结果:包裹(尝试获取null数组的长度)

I tried different combinations of the above, but I am unable to understand how others are able to send SMS using the command but I cannot.我尝试了上述的不同组合,但我无法理解其他人如何使用该命令发送短信,但我不能。 I'll appreciate if anyone can point out what I am doing wrong.如果有人能指出我做错了什么,我将不胜感激。

I am using a linux machine and an android phone with 5.1 connected with USB cable with USB debugging ON.我正在使用一台 linux 机器和一部 android 手机,5.1 连接 USB 电缆,USB 调试开启。

ro.build.version.release=5.1
TAG=android-5.1.0_r1
 

At last I found out how it should work on Android 5.1.最后我发现它应该如何在 Android 5.1 上工作。

$ adb shell service call isms 9 s16 "com.android.mms" s16 "DEST_NUMBER" s16 "null" s16 "MESSAGE\ BODY" s16 "null" s16 "null"

You can also use the following format to compensate for spaces in the message:您还可以使用以下格式来补偿消息中的空格:

$ adb shell service call isms 9 s16 "com.android.mms" s16 "DEST_NUMBER" s16 "null" s16 "'MESSAGEBODY 2 with spaces'" s16 "null" s16 "null"

This query is now closed.此查询现已关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM