adb -s 192.168.1.6:5555 … error: more than one device/emulator

后端 未结 3 757
野的像风
野的像风 2021-02-07 20:48

I am working with react native, and would like to switch adb to wifi for easier debugging.

I connect my device using usb, then type these commands.

adb t         


        
3条回答
  •  伪装坚强ぢ
    2021-02-07 21:13

    I made two changes to the steps to get this working.

    1) BEFORE disconnecting the wire from my phone, I ran adb reverse tcp:8081 tcp:5555 (note the 5555 port number for the phone) and adb connectMY.PHONE.IP.ADDRESS:5555` (with port number).

    Only now did I disconnect the wire.

    Then I installed the app, although it probably would work if the app was already installed.

    2) After the app was installed and I was getting errors "Unable to load Script” and “Could not connect to development server”,

    • opened the developer menu (shake the phone with the React Native app open) and selected “Dev Settings”. Selected “Debug server host & port for device” from the menu.
    • In the window on my phone I entered MY.COMPUTER.IP.ADDRESS:8081

    Now I could open/close the app for a reload, and shake -> debug JS remotely.

提交回复
热议问题