4

您知道 Android 上带有 adb shell 的命令“服务调用 isms”吗?这是我使用的完整命令:service callisms 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText"。

有一些参数,但我不知道它是什么意思(5,s16,i32,0)。哪里有说明书?对我来说最重要的是当短信未成功发送时出现错误(大约 10% 的短信未发送)=> 这个问题已经问过但没有答案(https://stackoverflow.com /questions/17395546/get-status-sms-from-isms-service-using-shell-adb-android-sdk)。

我不想使用命令(adb shell am start -a android.intent.action.SENDTO -d sms:CCXXXXXXXXXX --es sms_body "SMS BODY GOES HERE" --ez exit_on_sent true adb shell input keyevent 22 adb shell input keyevent 66) 因为它使用图形界面。

你可以帮帮我吗?(对不起,我不会说英语。所以,我希望你能理解我的要求)

非常感谢

4

1 回答 1

7

In every "service call" command, you need to enter:

  • the service you want to call, in this case it is "isms";
  • the "function" you want to call, in this case it is "5" (more about that later);
  • the function parameters.

There's two types of possible parameters: Strings and Integers. Before entering an Integer parameter you need to specify its type using i32. Same thing for a String parameter, but instead you need to write s16.

Most of the "service call" commands have no documentation, or very little.
For the ISms you can look here: http://www.androidjavadoc.com/1.0_r1_src/constant-values.html to get a list of the possible functions and their number code. Hit ctrl-f and enter ISms for quick access.

The "5" function for the ISms service is the sendMultipartText function from the ISms interface of the Android API. Here is the doc about this function. And here is the implementation class from the API.

So, service call isms 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText", equals:

Call the sendMultipartText function from the ISms service with the String parameter "PhoneNumber", the Integer parameter 0, the Integer parameter 0 and the String parameter "BodyText".

To answer your question, I am pretty sure there's no way to know if the sms are being sent or not from the command line... But maybe if you dig a little deeper than I did in the API you'll find a way.

于 2013-07-23T19:17:06.130 回答