[英]Android Studio - Unable to open debugger port: java.io.IOException
I am stuck in a problem here.我在这里遇到了一个问题。
I cannot attach debug using Android Studio 3.5.1.我无法使用 Android Studio 3.5.1 附加调试。
Its keeping showing me the message "Error running 'Android Debugger (8600)': Unable to open debugger port (localhost:8600): java.io.IOException"它不断向我显示消息“运行'Android 调试器(8600)'时出错:无法打开调试器端口(localhost:8600):java.io.IOException”
I tried a lot of things like:我尝试了很多东西,例如:
adb reset
invalidate
restart windows
reinstall android studio
and none of them works.而且它们都不起作用。
And I cannot find Enable ADB Integration on this version.而且我在这个版本上找不到启用 ADB 集成。
Anyone knows how to fix it?任何人都知道如何解决它?
EDIT编辑
Debugging with emulator is working with all versions.使用模拟器进行调试适用于所有版本。
Debugging with devices is working only with devices with Android 9.0+使用设备进行调试仅适用于具有 Android 9.0+ 的设备
Kill and start adb didn't work.杀死并启动 adb 不起作用。 I dont think its a local problem because its happen with a lot of people here.
我不认为这是一个本地问题,因为它发生在很多人身上。 Its seems to be a project problem
它似乎是一个项目问题
You might check this 3 things:你可以检查这三件事:
1. Youre not running a not debuggable version. 1.您没有运行不可调试的版本。
android:debuggable="false" in Android Manifest android:debuggable="false" 在 Android 清单中
2. In Android studio you re not building a release version 2. 在 Android 工作室中,您没有构建发布版本
Check in Build variants in bottom left corner.签入左下角的构建变体。
3. If nothing works use Troubleshoot device connections 3. 如果没有任何效果,请使用设备连接故障排除
Tools -> Connection Assistant工具 -> 连接助手
or older version或更旧的版本
Tools -> Troubleshoot device connections工具 -> 设备连接故障排除
And try out the helper page from google (seems for older versions)并尝试谷歌的帮助页面(似乎是旧版本)
https://developer.android.com/studio/run/device#assistant https://developer.android.com/studio/run/device#assistant
its your connection issue, cant find your device DNS.这是您的连接问题,找不到您的设备 DNS。
what is your OS?你的操作系统是什么?
In windows:在 windows 中:
you must go to network and find duplicate dns and clear it (Search for it)
您必须 go 联网并找到重复的 dns 并清除它(搜索它)
In mac:在 mac 中:
you must kill adb or delete that and run a new version
您必须杀死 adb 或删除它并运行新版本
last hit is Update emulator in sdk最后一击是 sdk 中的更新模拟器
Try this:尝试这个:
adb kill-server
adb start-server
adb usb
For linux
, eg, ubuntu
: start all commands with sudo
like this:对于
linux
,例如ubuntu
:使用sudo
启动所有命令,如下所示:
sudo adb kill-server
. sudo adb kill-server
。
.First you need to check your build.gradle(app) file, and ensure that your build is debuggable. .首先您需要检查您的 build.gradle(app) 文件,并确保您的构建是可调试的。
.If debuggable then you need to check adb is working or not in your system, you can check by just press 'adb'. .如果可调试,那么您需要检查系统中的 adb 是否正常工作,您只需按“adb”即可检查。
Try this.尝试这个。 I have had luck with this approach when I run into problems with adb.
当我遇到 adb 问题时,我对这种方法很幸运。
You can check if the device is recognised or not using您可以检查设备是否被识别或不使用
adb devices
If it is indeed recognised you may try to kill adb and start it again如果确实可以识别,您可以尝试杀死 adb 并重新启动它
add kill-server
adb start-server
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.