问题
I was confused about a new problem since yesterday. I am now using DDMS to debug my app on my android device. It used to appear that I instant run the app from android studio it notices me i need to enable ADB integration, but not often. Since last night, once I enable ADB integration, ddms will not be able to capture log from device it goes "Adb connection Error:An existing connection was forcibly closed by the remote host" in DDMS. and if I restart the DDMS, it will turn ADB integration disable which results I cant pass app to my device. if enable it, DDMS not working again. I know there must be something like port conflicted but i totally have no idea how to solve it. BTW, I noticed there is another android monitor in studio which is not so powerful, i am not going to use it. Is it the reason due to NO TWO MONITORS AT SAME TIME? many thanks for anyone's any help
回答1:
you can resolve this by following steps:
- click on sdk Manager
then on Build,Execution,Deployment
in Build,Execution,Deployment click on instant run
- uncheck the "Enable Instant Run to hot swap code/resource changes on deploy"
- Click on apply and then check it should work.
回答2:
I worked out it, just have a record here, in case someone meet same problem. The issue caused by AS 2.0 update which introduce a new feature: hot swap code (which will save you time to build the app) however, this feature will require ADB integration to 'instant run' the app on your device which the previous edition is not required. So if you met this problem, just go settings => Build, execution, deployment =>instant run => uncheck 'Enable Instant Run to hot swap code/resource changes on depoly'. PS. If it is possible, check this option, as this new feature is quite helpful.
回答3:
Since the latest versions of Android Studio, you can explore the data by clicking on "Device File Explorer" that located at the bottom right corner. See the attached snap.
来源:https://stackoverflow.com/questions/36208467/why-ddms-will-disable-adb-integration-in-android-studio