模拟器经常断开连接,Android Studio 卡住.如何解决? [英] Emulator disconnect frequently and Android Studio Stuck. How To fix it?

查看:221
本文介绍了模拟器经常断开连接,Android Studio 卡住.如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,找不到任何解决方法.第一次打开模拟器,AVD 运行正常,一切正常.但是 5-10 分钟后,模拟器断开连接,它失去了互联网连接,我无法连接到它,Android Studio 也完全卡住了,什么也没发生!我应该关闭模拟器,然后一切都会恢复正常.

I have a strange problem which cannot find any fix for it. Every thing is OK for the first time when i open emulator and AVD run normally. but after 5-10 minutes, the emulator disconnect,it lose it's internet connection and i cant connect to it,also the Android Studio completely stuck and nothing happen ! I should close the emulator and after that everything become normal again.

这些是我测试过的:

adb kill-server 然后adb start-server

我也尝试再次连接和断开连接

I also tried connecting and disconnecting again

adb connect localhost:5554adb connect emualtor-5554 但仍然没有结果.

adb connect localhost:5554 and also adb connect emualtor-5554 but still no result.

更糟糕的是我不能再使用Android Studio了,连点击代码行都不行!

The worse part is that I can't use Android Studio anymore, even clicking on lines of codes don't work!

每次我都应该关闭模拟器并再次打开它.

Every time I should close the emulator and open it again.

注意:我不能使用 Genymotion,而且我不想使用我的设备进行调试!

NOTE : I can't use Genymotion, and I don't want to use my device for debugging!

任何机构都可以修复这个该死的错误.这让我发疯了......提前致谢

Can any body have any fix for this damn bug. it made me crazy ... thanks in advance

问题与模拟器无关.今天我尝试使用WiFi连接进行调试.一切都很好,直到问题再次发生在我的真实设备上.在日志中它说:

The problem is not something related to emulator. Today I try to debug with WiFi connection. Everything was good for a while till the problem happened again with my real device. In log it said :

deviceXXXXX 已断开连接

deviceXXXXX disconnected

所以问题出在我的 ADB 连接上!

So the problem is with my ADB connection !

我测试的是将5555端口添加到防火墙也添加了ADB通过防火墙.但问题依然存在.

What I tested was adding port 5555 to firewall also added ADB to pass through firewall. But still the problem persists.

推荐答案

你的android studio版本、jdk版本、os是什么?

What's your android studio version, jdk version, os?

你的目标是什么 API?

What api are you targeting?

android studio 2 的新功能可能有问题 instant运行.

Can be a problem with new feature of android studio 2 instant run.

第一次尝试将关闭.

请注意,如果您的目标是 N Developer Preview,则需要使用 Java 8.

Be aware if you are targeting N Developer Preview is required to use Java 8.

更激进的方法是回滚到android studio 1.5并测试.

More radical way is to rollback to android studio 1.5 and test.

这篇关于模拟器经常断开连接,Android Studio 卡住.如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆