React Native run on multiple simultaneous Android emulators

Viewed 10483

I would like to test my app on at least 2 Android emulators simultaneously. I can start 2 emulators but can't seem to find how to react-native run-android my app on 2 emulators with ADB. If possible I would also like to be able to run a react-native log-android on each one while testing my app.

Is there a way to do so ?

4 Answers

In order to run your react application on multiple emulators, just start 2 emulators as usual and then use the command react-native run-android.

You can even specify any port number as react-native run-android --port 8084 if you want. Your app will start on both the emulators simultaneously. :)

Have a look here

The accepted answer by @Burhan Yılmaz did NOT work for me. This is probably due to new updates and development in the relevant software. The following steps demonstrate what worked for me.

  1. Start the 1st emulator, e.g. emulator -avd Nexus_S_API_28

  2. Start the 2nd emulator, e.g. emulator -avd Nexus_S_API_28_2

  3. Start React-Native in the same way, which you would usually use (without specifying any ports.) react-native run-android

This sends a copy of the code to both devices. However, each device runs its copy in isolation from the other device.

Environment Details:

  • MS Windows 10
  • Android SDK 29.0.2
  • React-Native: 0.61.2

Using Genymotion, you just have to start 2 instances and start them as if there was only one (react-native run-android to install the app and react-native start)

Related