Android 假来电
如何在 Android 模拟器中伪造来电?
下面让我拨打电话,但我想强制模拟器接收 一个电话,最好是我选择的号码。
adb shell am start -a android.intent.action.CALL tel:1112223333
因此,与上面的命令直接相反。
How can I fake an incoming call inside the android emulator?
The following lets me make a call but I'd like to force the emulator to receive
a call, preferably from a number I've selected.
adb shell am start -a android.intent.action.CALL tel:1112223333
So, the direct opposite of the command above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
您可以在 Eclipse 中使用 DDMS、Android Studio 中的 Android Device Monitor 或在终端上运行命令行
使用 DDMS:
之后,你会看到模拟器收到这个电话,如下
使用命令行
注意:5554:模拟器实例的控制台端口号
12345678:来电号码
You can use DDMS in Eclipse, Android Device Monitor in Android Studio or run command lines on terminal
Using DDMS:
After that, you will see the emulator receive this phone call as follows
Using command lines
Note: 5554: console port number for emulator instance
12345678: incoming phone number
其实在 android Studio 2.1 中很简单!
Actually in android Studio 2.1 Its easy!
您可以使用 Putty 来完成此操作。下载并安装 Putty http://www.chiark.greenend.org.uk/ ~sgtatham/putty/
第 1 步:
运行 Putty
第 2 步:在地址框中输入 127.0.0.1
在端口框中输入运行模拟器的端口号。它位于模拟器窗口的左上角(通常为 5554)。确保类型设置为“telnet”。点击“打开”
第 3 步:
将打开一个终端。输入:
按 Enter 键即可完成。
编辑:
您还可以发送虚假短信:
You can do this with Putty. Download and install Putty http://www.chiark.greenend.org.uk/~sgtatham/putty/
Step 1:
Run Putty
Step 2: In the address box put 127.0.0.1
In the port box put the port number your emulator is running on. It's in the top left corner of the emulator window (usually 5554). Make sure type is set to 'telnet'. Click 'Open'
Step 3:
A terminal will open. Type:
Press enter and you're done.
EDIT:
You can also send fake sms:
如果您使用的是 eclipse 那么您可以简单地使用模拟器控件来完成此操作
为此,单击 Eclipse 菜单中的窗口,然后显示视图,现在单击其他
将打开一个小窗口,选择 android,然后模拟器控件
使用它在模拟器中进行呼叫
if you are using eclipse then you can simply do this using emulator control
for this click on window in eclipse menu then show view now click on other
a small window will open select android and then emulator control
use it for making call in emulator
测试相同行为的另一个选择是使用真实手机和 Google 的两步授权设置来生成呼叫(见图)。
Another option for testing the same behavior is to use a real phone and Google's two step authorization settings to generate calls (see image).
我最近检查了三个选项,以在 Android 模拟设备 (AVD) 上进行模拟呼叫。
选项 1:
转到模拟设备的“更多”选项,如下所示,然后点击“呼叫设备”以接听来自提到的号码的电话。
选项 2:
使用模拟设备 UI 通过转到“设置”-->“检查电话号码”系统-->关于模拟设备如下图所示。从其他设备拨打此号码。
选项 3:
启动 Android 设备监视器(例如,在 Windows 上“C:\Users\xyz\AppData\Local\Android\Sdk\tools”启动监视器),设置您的自己的来电号码并拨打,如下所示
There are three options which i recently checked to get simulated call on a Android emulated device (AVD).
option 1:
Go to emulated device "more" option as shown below and hit on "Call device" to get a call from number mentioned.
option 2:
Using emulated device UI check the phone number by going to Settings--> System --> About emulated device as shown below. Call to this number from the other device.
option 3:
Launch Android device monitor (e.g. on windows "C:\Users\xyz\AppData\Local\Android\Sdk\tools" launch monitor), set your own incoming number and call as shown below
Shell 脚本 incoming_call.sh:
用法:
Shell script incoming_call.sh:
Usage:
在类 UNIX 系统上使用 telnet 和 netcat 的便捷单行代码:
Handy one-liner on unix-like systems using telnet and netcat:
在真实设备上
CC 是国家/地区代码,XX 是电话号码
on a real device
CC is country code , XX is phone number
您可以通过 telnet 连接到模拟器来完成此操作。
打开命令提示符并输入
You can find your
on the title bar of the emulator.根据上面的实例,我的
是 5554。通过telnet连接到模拟器后,输入
You can do this by connecting to your emulator via telnet.
Open Command Prompt and enter
You can find your
<console-port>
on the title bar of the emulator.According to the above instance my
<console-port>
is 5554.After connecting to the emulator via telnet, enter