mundopana.blogg.se

Run react native in android studio
Run react native in android studio











run react native in android studio

iex "netsh interface portproxy delete v4tov4 listenport=8081 listenaddress=127.0.0.1" | out-null A work around is to use the following script. Sometimes there are problems with the network forwarding. So the app can connect to the metro bundler from the emulator via Windows localhost. Windows 10 version 2004 brings network forwarding from The metro bundler is running in WSL2, listening on port 8081. 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 access to metro bundler from Windows 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

run react native in android studio

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. To debug on a virtual device create a virtual device (e.g. To debug on a hardware device connect to android device via usbip from WSL2 (thanks to Connect USB device to WSLĬonnect to android virtual device in Windows PATH=$PATH:$ANDROID_SDK_ROOT/platform-toolsĮxport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64Ĭonnect to android hardware device from WSL2 bash_profile export ANDROID_HOME=/home/xxx/Android/cmdline-tools/latestĮxport ANDROID_SDK_ROOT=/home/xxx/Android

  • 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.
  • Connect to Windows Subsystem for Android.
  • Enable access to metro bundler from Windows.
  • Start android virtual device in Windows.
  • run react native in android studio

  • Connect to android virtual device in Windows.
  • Connect to android hardware device from WSL2.
  • Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.













    Run react native in android studio