React native android emulator mac

broken image

Note: For this to work your project needs to be located in the native Windows file system i.e.I've tested this out with some fairly complex projects using multiple native Android components.

broken image

Once the APK has been assembled and uploaded to your device or emulator, run the debug server from within WSL using the command react-native start. From the /android directory inside your project, execute the gradle wrapper gradlew.bat installDebug, or with the Creator's Update, you can do this from inside the WSL bash shell /mnt/c/Windows/System32/cmd.exe /C gradlew.bat installDebug. No need for a duplicate windows binary node/npm stack.ĭon't use react-native run-android, instead compile and deploy from cmd. react-native-cli installed globally in WSL.

broken image

The trick is to separate out the Gradle based Android compile.Īll project setup and package management performed in WSL with npm/yarn. Realistically, you'll want to install the native Windows Android Studio/SDK to use the Intellij IDE and the emulator anyway. However, I've found a workaround that combines a native windows android build with a npm stack in WSL. AFAIK it is not possible to use react-native in WSL due to a number of issues.