- Initialize React Native project in your WSL2 Linux with:
npx create-expo-app <PROJECT_NAME_HERE>
Simply follow official docs "Expo Go Quickstart": https://reactnative.dev/docs/environment-setup
-
Allow inbound and outbound traffic in your Windows Firewall on port
19000
. -
In PowerShell terminal of your WSL2 user find IP address:
bash.exe -c "ifconfig eth0 | grep 'inet '"
- Run new PowerShell terminal window as admin :
Start-Process powershell -verb runas
- Set up port forwarding using
<WSL2_IP_ADDRESS>
from pt. 3
netsh interface portproxy add v4tov4 listenport=19000 listenaddress=0.0.0.0 connectport=19000 connectaddress=<WSL2_IP_ADDRESS>
- In the WSL2 Linux terminal set up your Windows host's IP for
Metro
which will run your app:
export REACT_NATIVE_PACKAGER_HOSTNAME=$(netsh.exe interface ip show address "Wi-Fi" | grep 'IP Address' | sed -r 's/^.*IP Address:\W*//')
- In the WSL2 Linux terminal run run app with:
npm start
- Using provided QR code load app on your phone through
Expo Go
app.