android - 如何: get the port number of AVD and send a message to itself

标签 android

我怎样才能做到以下几点?

  1. 获取我的 AVD 的端口号 [从我的代码而不是命令行。]

  2. 使用步骤 1 中获得的端口号从 AVD 向自身发送消息。

(有可能: could one emulator send a SMS to itself )

最佳答案

从控制台发送短信:

1) 打开控制台;

2) 输入“telnet localhost xxxx”,其中 xxxx 是模拟器 ID。这与标题栏中模拟器名称前面的数字相同,通常是 5554,除非您正在运行其他模拟器;

3) 输入 'sms send 1234567 message' 其中 message 是 SMS 消息的文本

4) 查看模拟器上的通知栏,您会看到一条已发送的短信

只要你愿意做肉件短信网关,手动在模拟器之间传递消息,你就可以得到你想要的。

在模拟器实例之间发送短信:

使用模拟器 ID 作为电话号码。模拟器似乎使用格式为 1 555 521 xxxx 的虚拟电话号码,其中 xxxx 是模拟器 ID,例如1 555 521 5554。

关于android - 如何: get the port number of AVD and send a message to itself,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16382188/

相关文章:

java - android.support.v7.widget.SearchView 设置查询提示?

Android - AppWidget AppWidgetManager.updateAppWidget() 没有被立即调用

android - 按查询分组在 android 2.1 中不起作用

android - 如何使 Firebase 存储仅供应用程序用户使用

android - 以编程方式连接到 Android Q 中的 Wifi

android - Android中高效记录流数据

android - 如何为 Android 使用重新编译的 OpenCV 构建

Android:如何在 Android 中创建直接下载链接

android - 已弃用的方法令人困惑

android - 当服务调用 Activity 时唤醒手机并播放 MediaPlayer,Android