简体   繁体   English

Android Studio - 无法打开调试器端口:java.io.IOException

[英]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”即可检查。

    • if its working then check devices by 'adb devices', it will show all connected devices.如果它工作,然后通过“adb devices”检查设备,它将显示所有连接的设备。
    • add kill-server then enter and adb start-server添加 kill-server 然后输入和 adb start-server

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.

相关问题 Android / Java.io.IOException(313) - Android/ Java.io.IOException(313) 如何在android中解决Java.Io.IoException - how to solve Java.Io.IoException in android android java.io.IOException:服务不可用 - android java.io.IOException: Service not Available Android:java.io.IOException:未验证主机名 - Android : java.io.IOException: Hostname was not verified 带有音频流的 Android java.io.IOException - Android java.io.IOException with audio streaming java.io.IOException:无法在指定的端口范围内为Blob服务器分配套接字:0 - java.io.IOException: Unable to allocate socket for blob server in specified port range: 0 Android画布保存总是java.io.IOException:打开失败:ENOENT(没有这样的文件或目录) - Android canvas save always java.io.IOException: open failed: ENOENT (No such file or directory) 在Android中使用java.io.IOException写入文件失败:打开失败:EACCES(权限被拒绝) - File write failed in android with java.io.IOException: open failed: EACCES (Permission denied) java.io.IOException:HTTP请求失败,HTTP状态:ANDROID STUDIO中为400 - java.io.IOException: HTTP request failed, HTTP status: 400 in ANDROID STUDIO 错误:任务“:app:processDebugResources”的执行失败。 > java.io.IOException: 无法在 android studio 中删除文件夹“” - Error:Execution failed for task ':app:processDebugResources'. > java.io.IOException: Could not delete folder “” in android studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM