As many of You, I like Windows for it's simplicity, but developing software on that OS sometimes can turn into a nightmare. Recently Windows released WSL2 - big update to Windows Subsystem for Linux, which brought:
- new architecture
- full Linux kernel
- much, much faster IO
- easy to install Docker
- more info here
Although WSL2 has many improvements towards its predecessor, it has also some downsides like virtual network hidden behind NAT and lack of access to USB devices.
First, assure that You have WSL2 installed (check this link).
Secondly, I strongly encourage to check Windows Terminal (which is open-sourced on Github)
Add the snippet below to the end of Your shell config file (usually
export $(dbus-launch) export LIBGL_ALWAYS_INDIRECT=1 export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2) export DISPLAY=$WSL_HOST:0 export ADB_SERVER_SOCKET=tcp:$WSL_HOST:5037
Now Your WSL is ready.
- install some GUI on linux and use Windows X Server to run graphic apps from linux (e.g develop some Electron-based apps)
- develop mobile apps using React Native (just follow official instructions for Linux)
There's one more thing about adb. You have to start it under Windows (e.g. cmd)
As You remember, there's no USB support in WSL :)
1) Start adb server in windows
2) Enable port fowarding to metro bundler from Windows
3) Follow React Native docs. Remember to execute commands under WSL, not Windows.
That's my first post in the DEV community :) Please give me some feedback.