Hsüan's Blog

2023-10-21

windows wsl2 adb connect host phone via usb

別這方式搞,直接用 adb 連入宿主機的 ip 就好

此篇

  • Install platform-tools on Windows

    • Install Android Studio 就會有了
  • Install platform-tools on wsl

    • apt install android-tools-adb
  • 用 USB 線將手機連到電腦上,手機上 debug 記得要同意打開

  • 依照 此篇 先找到 device ip

  • 然後依照 https://stackoverflow.com/questions/60166965/adb-device-list-empty-using-wsl2, binding device from host to wsl。之後就可以在 wsl 裡面直接 adb 了。

    • host adb 先 bind ip and port

      adb tcpip 5555
    • wsl connect to host device

      adb connect <device ip>:<port>

© 2019 ~ 2024 Hsüan, Powered by Gatsby, Theme Material UI