Skip to content

Instantly share code, notes, and snippets.

@mwoodpatrick
Forked from xquangdang/rn-with-wsl-wsa.md
Last active October 11, 2023 09:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwoodpatrick/91606d1cff580265470fa604f900adfc to your computer and use it in GitHub Desktop.
Save mwoodpatrick/91606d1cff580265470fa604f900adfc to your computer and use it in GitHub Desktop.
Develop React Native app with WSL and WSA

Develop React Native app with WSL and WSA

Requirement

  • Windows Subsystem for Linux 2 (WSL2)
  • Windows Subsystem for Android (WSA)
  • NodeJS install inside WSL2

Steps

WSA

  1. Enable developer mode for WSA image

WSL2

This tutorial will run on Ubuntu 20.04

  1. Install Android debug bridge (adb)
$ sudo apt install adb
  1. Connect to WSA

image

  • Connect to WSA via IP
$ adb connect <wsa-ip>

image

  • Make sure ADB connect successfully
$ adb devices -l
List of devices attached
172.21.210.88:5555     device product:windows_x86_64 model:Subsystem_for_Android_TM_ device:windows_x86_64 transport_id:4

React Native setup

I'll follow tutorial on ReactNative.dev

# Assuming that you have Node 12 LTS or greater installed, you can use npm to install the Expo CLI command line utility
$ sudo npm install -g expo-cli
# Then run the following commands to create a new React Native project called "AwesomeProject"
$ expo init AwesomeProject

cd AwesomeProject
$ npm start # you can also use: expo start

Select Run on Android device/emulator in expo web client image

FAQ

@TheoLAFARGE
Copy link

you're the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment