Setting react-native run-android to use a custom adb.exe
See original GitHub issueI have been trying to deploy a react-native app to the Nox emulator. Apparently, the emulator comes with its own adb.exe. More info about this: https://www.bignox.com/blog/how-to-connect-android-studio-with-nox-app-player-for-android-development-and-debug/
The problem is, everytime I run react-native run-android, the cli will fail to find a device, eventhough the custom adb.exe clearly found a device before. My guess is react-native doesn’t call the right adb.exe, because everytime I run react-native run-android, a new adb.exe process will be started. So I add a PATH to the custom adb.exe, and remove the PATH adb.exe that comes with the Android SDK. It still fails. The same thing still happens.
- Before running 
react-native run-android: 
C:\Users\Jacky>adb devices
List of devices attached
127.0.0.1:62001 device
- On running 
react-native run-android: 
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 33.883 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
- After running `react-native run-android:
 
C:\Users\Jacky>adb devices
adb server is out of date.  killing...
* daemon started successfully *
List of devices attached
The reason that I want to use nox emulator is because the other emulators are simply too slow on my machine. I tried AVD and genymotion, both are really slow on my machine, for whatever reason. Nox though, runs very smoothly on my machine, I have even played some games on it for several months.
Can anyone help me with this? It will be really appreciated! Thanks!
Issue Analytics
- State:
 - Created 6 years ago
 - Reactions:2
 - Comments:11 (1 by maintainers)
 

Top Related StackOverflow Question
Somehow I managed to solve this issue. Let me share it on this thread for future references. This solution has three parts
Mobile Emulator (NOX) (For this solution to work, you need to have NOX emulator with api >= 5) here are the steps to do that:
Connectivity:
then just go to the react native project folder and write
react-native run-androidPs. For me this solution works with a smalllllllll exception, sometimes I get that the nox_adb.exe (check step 2 in connectivity) has stopped working but just close that window cause the emulator is working perfectly for me.
@makiabuan I have same problem in my mac, but I already solved.
.bash_profile, make sure the following lines to your.bash_profileconfig file:WARNING: PLEASE make sure
ANDROID_HOME=$HOME/Library/Android/sdkNot the other.Windows can Refer to this configure-the-android-home-environment-variable. Don’t forget to choose the
Windowsenvironment.If the above still doesn’t work, Do the second step:
/RNProject/android/) in your Android Studio. And then Run the App(^R). Then you can usereact-native run-androidnormally.