React Native Android设备连接到ADB后 yarn start操作后找不到设备

时间:2024-03-01 13:24:33

warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading app...
warn No apps connected. Sending "devMenu" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Opening developer menu...

因为你没有连接到开发服务器所以npx react-native run-android能跑但是

yarn start操作后 "r" "d" 提示,确保您的应用程序正在模拟器或通过USB连接的手机上运行。

  1. 查看的连接adb设备 获取设备名

    $ adb devices
    List of devices attached
    adb-RF8M90J9D9M-IFr04K._adb-tls-connect._tcp    device

    上述设备名(adb-RF8M90J9D9M-IFr04K._adb-tls-connect._tcp)

  2. $ adb -s adb-RF8M90J9D9M-IFr04K._adb-tls-connect._tcp reverse tcp:8081 tcp:8081
    8081

    *adb.exe: unknown command tcp:8081 端口被占用

    adb reverse tcp:8081 tcp:8081