DEV Community

Discussion on: Web & React Native development in WSL

Collapse
 
xquangdang profile image
Đặng Xuân Quang

Error image
I have problem with adb devices on wsl2. If I set ADB_SERVER_SOCKET, adb always throw segmentation fault error. Any idea how to resolve this problem?

Collapse
 
victorwads profile image
Victor Wads

Some my problem:

  • adb -a -P 5037 nodaemon server on Windows side
  • wsl --shutdown on Windows side
  • adb devices on WLS2 side

My .zshrc / .bash_profile:

export $(dbus-launch)
export LIBGL_ALWAYS_INDIRECT=1
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export DISPLAY=$WSL_HOST:0

# Android Config
export ADB_SERVER_SOCKET=tcp:$WSL_HOST:5037
if [ -d "$HOME/Android/sdk" ] ; then
    ANDROID_HOME="$HOME/Android/sdk" #location same as step 3
    PATH="$ANDROID_HOME/emulator:$PATH"
    PATH="$ANDROID_HOME/tools:$PATH"
    PATH="$ANDROID_HOME/tools/bin:$PATH"
    PATH="$ANDROID_HOME/platform-tools:$PATH"
fi
Collapse
 
mikolaj6r profile image
Mikołaj Romanowski

Sorry, I've switched from windows to linux so I can't test whether it still works with current windows & wsl version...

Collapse
 
murbanowicz profile image
Marek • Edited

In my case export $(dbus-launch) hangs forever :/ any tip?

Without it when I run adb devices it shows List of devices... and waits forever :/

Thread Thread
 
mikolaj6r profile image
Mikołaj Romanowski

dbus part is actually more about GUI aps rather than adb...have you followed these steps gist.github.com/bergmannjg/461958d... ?