如何发送从shell短信? [英] How do I send an SMS from a shell?

查看:544
本文介绍了如何发送从shell短信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够从只使用命令行,而不是依赖于任何APK这样做的一个shell发送实际的短信。我感兴趣的发送此邮件手机之间,而不是从模拟器到手机上。例如,通过运行以下命令:

I would like to be able to send an actual SMS message from a shell using just the command line and not relying on any apk to do so. I am interested in sending this message between phones, not from the emulator to the phone. For example, by running the command:

service call phone 2 s16 "1234567890"

我可以使用命令行发出呼叫从电话到电话。在服务列表命令显示的主义服务,我似乎无法提供正确的论据。我会假设参数的个数应该是一个PDU串,但还没有任何运气至今。

I can place a call from phone to phone using the command line. The 'service list' command shows an isms service, which I can't seem to provide the correct arguments for. I would assume that one of the args should be a PDU string but haven't had any luck so far.

推荐答案

其实,这是可以做到,但需要亚行进行安装(Android SDK的部分)

In fact, this can be done but requires adb to be installed (Part of the 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

在哪里CCXXXXXXXXXX的国家 - code后面的电话号码。非标准的Andr​​oid设备,这可能无法正常工作,你需要找到正确的KeyEvent值传递。

Where CCXXXXXXXXXX is country-code followed by phone number. This may not work correctly on non-standard android installations, you will need to find the correct keyevent values to pass.

这篇关于如何发送从shell短信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆