gpt4 book ai didi

android - React Native adb反向错误: more than one device

转载 作者:行者123 更新时间:2023-12-04 13:20:59 28 4
gpt4 key购买 nike

我正在学习 React Native。我可以使用 USB 成功连接我的 android 设备。但是当我尝试使用 wifi 连接它时,它给了我一个错误。

$ adb kill-server      
$ adb version
Android Debug Bridge version 1.0.40
Version 4986621
Installed as /home/subtleseeker/Android/Sdk/platform-tools/adb
$ adb connect 172.26.40.211:8081

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 172.26.40.211:8081
$ adb devices
List of devices attached
172.26.40.211:8081 device

$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
cache results.bin (/home/subtleseeker/.gradle/caches/transforms-1/metadata-1.1/results.bin) is corrupt. Discarding.

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'POCO F1 - 8.1.0' for app:debug
Installed on 1 device.

BUILD SUCCESSFUL in 31s
27 actionable tasks: 1 executed, 26 up-to-date
Running /home/subtleseeker/Android/Sdk/platform-tools/adb -s 172.26.40.211:8081 reverse tcp:8081 tcp:8081
error: more than one device/emulator
Could not run adb reverse: Command failed: /home/subtleseeker/Android/Sdk/platform-tools/adb -s 172.26.40.211:8081 reverse tcp:8081 tcp:8081
Starting the app on 172.26.40.211:8081 (/home/subtleseeker/Android/Sdk/platform-tools/adb -s 172.26.40.211:8081 shell am start -n com.awe4/com.awe4.MainActivity)...
Starting: Intent { cmp=com.awe4/.MainActivity }

在应用程序的 Dev 设置 中,我已将 Debug server host & port for device 配置为我计算机的 ip 地址 172.26.43.71: 8081。从输出中也可以清楚地看到,连接成功并且安装了 apk。

我看不出如何解决这个错误:错误:不止一个设备/模拟器。任何帮助表示赞赏。
注意:此问题可能与 this 重复, 但它没有任何答案。

最佳答案

当我遇到与以下相同的问题时:

  • Restart adb by issuing adb kill-server followed by adb start-server in a command prompt.
  • Disable and re-enable USB debugging on the phone Rebooting the phone if it still doesn't work.

我的问题已通过这些步骤得到解决。

关于android - React Native adb反向错误: more than one device,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52749158/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com