Fake Incoming Call Android
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.
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
After that, you will see the emulator receive this phone call as follows
Using command lines
$ telnet localhost 5554
$ gsm call 123456789
Note: 5554: console port number for emulator instance
12345678: incoming phone number
Actually in android Studio 2.1 Its easy!
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>
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
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).