

- #React native android emulator mac how to#
- #React native android emulator mac install#
- #React native android emulator mac full#
- #React native android emulator mac pro#
- #React native android emulator mac windows#
You may be able to run your app using services like Appetize (which I haven’t tested), but given that my main development environment is macOS, this is what I’ll focus on this article.

To use iOS simulators, you’ll need a Mac.
#React native android emulator mac how to#
Fortunately, Airbnb published a very nice article covering this subject, so make sure you read it.Īnd after doing your own reserch, you decided that React Native will work just fine for your needs, so now what? Well, this article will show how to get your app up and running on simulators for both iOS and Android devices, as well as how to set up your project.

#React native android emulator mac full#
Instead of using a hybrid approach like several projects out there, React Native aims to develop native applications with the tooling we already use in web development.įor the most part, this approach works perfectly, specially if you’re part of small team and lack the resources to develop full native code for both Apple and Android devices, but you need to be aware of its pros and cons, as in any other decision you have to make. React Native is the go-to platform if you’re versed in React and need to develop mobile applications.
#React native android emulator mac windows#
VS Code UI runs in windows and the VS Code Server runs in WSL2, see hereĪdd a launch configuration in file launch.Ler blog em Português Setting up React Native on macOS Mojave Start metro builder npx react-native startīuild app, set device as parameter deviceId from result of adb devices npx react-native run-android -variant=debug -deviceId emulator-5554ĭebug app in Visual Studio Code from WSL2
#React native android emulator mac pro#
pro to ignore okhttp3 warnings -dontwarn .* Iex "netsh interface portproxy add v4tov4 listenport=8081 listenaddress=127.0.0.1 connectport=8081 connectaddress=$WSL_CLIENT"Ĭreate react native app in WSL2 npx react-native init AwesomeProjectĪdd parameter in file proguard-rules. $WSL_CLIENT = bash.exe -c "ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+)' Socat relays the requests from wsl2 to windows using the following command: socat -d -d TCP-LISTEN:5037,reuseaddr,fork TCP:$(cat /etc/nf | tail -n1 | cut -d " " -f 2):5037Įnable port fowarding to metro bundler from WindowsĪdd port fowarding from windows to metro bundler running in WSL2, listening on port 8081,Įnabling a connection via adb from the emulator to WSL2.īelow, in Powershell: iex "netsh interface portproxy delete v4tov4 listenport=8081 listenaddress=127.0.0.1" | out-null One solution is to use socat (thanks to the environment variable if necessary. Somtimes adb crashes using the environment variable config. Set environment variable to access adb server, WSL_HOST is ip of vEthernet (WSL) interface in windows export WSL_HOST=$(tail -1 /etc/nf | cut -d' ' -f2)Įxport ADB_SERVER_SOCKET=tcp:$WSL_HOST:5037 The vEthernet (Wsl) adapter belongs to the public profile Enable access to adb server from WSL2 With Windows Defender Firewall allowing access for the public profile, because Start adb server in Windows adb kill-serverĬhange firewall rule for adb.exe on first usage in Defender Popup or Nexus_5X_API_29) in windows "C:\Program Files (x86)\Android\android-sdk\emulator\emulator.exe" -avd Nexus_5X_API_29 Nexus_5X_API_29) in windows with Android Virtual Device Manager from Android Studio. PATH=$PATH:$ANDROID_SDK_ROOT/platform-toolsĮxport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64Ĭreate a virtual device (e.g. bash_profile export ANDROID_HOME=/home/xxx/Android/cmdline-tools/latestĮxport ANDROID_SDK_ROOT=/home/xxx/Android
#React native android emulator mac install#
Install Android SDK cmdline tools in WSL2, see here and adjust directory structure, see here.Install java-8-openjdk in WSL2 ( sudo apt-get install openjdk-8-jre).Debug app in Visual Studio Code from WSL2.Enable port fowarding to metro bundler from Windows.Start android virtual device in Windows.Create android virtual device in Windows.

Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
