title: How to setup 2 android emulators in android studio to test react native app
body: <p>I added one more android emulator for react native 0.59 app test. I am able to launch 2 emulators. The <code>adb devices</code> command has the following output:</p>
  
  <pre><code>List of devices attached
  emulator-5554   device
  emulator-5556   device
  </code></pre>
  
  <p>When there is one emulator, I use on cmd terminal to do <code>react-native run-android</code> and another one to do <code>react-native log-android</code>. The backend server is running on the same PC. Here is the virtual devices in android studio:</p>
  
  <p><a href="https://i.stack.imgur.com/2NMIx.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/2NMIx.jpg" alt="enter image description here"></a></p>
  
  <p>What I would like to do is to launch 2 app representing 2 users connecting to the backend at the same time for testing. I tried to launched one app when 2 emulators are running and the loading of the app is extremely slow. It seems that the 2 app need to be launched on 2 different ports and the solutions I found online seems not working here. Also <code>react-native log-android</code> throws error when encountering 2 emulators. </p>