Simulating an Incoming Call on Android Emulator

Simulating an Incoming Call on Android Emulator

30 November 2024 Stephan Petzl Leave a comment Tech-Help

Simulating an incoming call on an Android emulator can be an essential feature for developers who need to test call-related functionalities within their applications. This guide will walk you through different methods to achieve this, using Android Studio, command lines, and other tools.

Using Android Device Monitor

The Android Device Monitor (ADM) provides a user-friendly way to simulate calls directly from within Android Studio. Follow these steps:

  • Open Android Studio, then navigate to Tools > Android > Android Device Monitor.
  • In the Device Monitor, locate the emulator you are using.
  • Enter the desired incoming phone number and select “Voice”.
  • Press “Call” to simulate the incoming call.

This method is straightforward and requires no additional setup outside of Android Studio.

Command Line Method

For developers who prefer command line operations, simulating a call can be done using telnet:

  • Open a terminal and connect to the emulator using the command: telnet localhost 5554. Here, 5554 is the default port number for the emulator.
  • Once connected, simulate the call by entering: gsm call 123456789, replacing 123456789 with your desired phone number.

This method provides a quick way to simulate calls without using a graphical interface.

Using Putty

Another method involves using Putty, a popular SSH and telnet client:

  • Download and install Putty from its official website.
  • Run Putty and enter 127.0.0.1 as the address and the emulator’s port number (usually 5554) in the port box.
  • Set the connection type to ‘telnet’ and click ‘Open’.
  • In the terminal window, type: gsm call 123456789 and press enter.

This method is particularly useful for developers who are already familiar with Putty.

Additional Considerations

Simulating an incoming call is crucial for testing various application features such as call logs, custom ringtones, and call-related notifications. Depending on your development environment and personal preferences, you might choose one method over another.

Enhancing Your Testing with Repeato

While manual testing of call simulations is effective, leveraging automated testing tools like Repeato can significantly streamline your testing process. Repeato’s no-code test automation capabilities allow you to create, run, and maintain automated tests for your Android applications with ease. With built-in ADB support, Repeato enables you to execute ADB commands in sequence, enhancing the precision and efficiency of your testing scenarios.

Like this article? there’s more where that came from!