Search code examples
androidandroid-studioadbddms

Why DDMS will disable ADB integration in android studio


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


Solution

  • 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.