Fake Incoming Call Android

AndroidAdb

Android Problem Overview


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.

Android Solutions


Solution 1 - Android

You can use DDMS in Eclipse, Android Device Monitor in Android Studio or run command lines on terminal

Using DDMS:

  • Open DDMS/ADM
  • in Eclipse: Window > Open Perspective > DDMS
  • in Android Studio: Tools > Android > Android Device Monitor
  • Enter the fake incomming phone number
  • Choose "Voice"
  • Press call

enter image description here

After that, you will see the emulator receive this phone call as follows

enter image description here

Using command lines

> $ telnet localhost 5554
$ gsm call 123456789

Note: 5554: console port number for emulator instance
12345678: incoming phone number

Solution 2 - Android

Actually in android Studio 2.1 Its easy!

enter image description here

enter image description here

Solution 3 - Android

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:

gsm call <the number you want the phone to see>

Press enter and you're done.

EDIT: You can also send fake sms:

sms send <the number you want the phone to see> <the message>

Solution 4 - 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

Solution 5 - Android

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).

voice call

Solution 6 - Android

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.

enter image description here

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.

enter image description here

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

enter image description here

Solution 7 - Android

Shell script incoming_call.sh:

#!/bin/sh
expect << EOF
spawn telnet localhost 5554
expect -re ".*>"
send "gsm call $1\r"
expect -re ".*>"
send "exit\r"
EOF

Usage:

incoming_call.sh +55555555555

Solution 8 - Android

Handy one-liner on unix-like systems using telnet and netcat:

 $ echo "gsm call 123456789" | nc -v  localhost 5554

Solution 9 - Android

You can do this by connecting to your emulator via telnet.
Open Command Prompt and enter

telnet localhost <console-port>

You can find your <console-port> on the title bar of the emulator.
enter image description here

According to the above instance my <console-port> is 5554.

After connecting to the emulator via telnet, enter

gsm call <telephone-number>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionandyView Question on Stackoverflow
Solution 1 - AndroidNguyenView Answer on Stackoverflow
Solution 2 - AndroidDavid HackroView Answer on Stackoverflow
Solution 3 - AndroidPop-A-StashView Answer on Stackoverflow
Solution 4 - AndroidJaiprakash SoniView Answer on Stackoverflow
Solution 5 - Androiduser3251189View Answer on Stackoverflow
Solution 6 - AndroidNafeez QuraishiView Answer on Stackoverflow
Solution 7 - AndroidfalkoView Answer on Stackoverflow
Solution 8 - AndroidMatouš BorákView Answer on Stackoverflow
Solution 9 - AndroidSudaraView Answer on Stackoverflow