Not Able To Debug App In Android Studio

前端 未结 30 2577
小蘑菇
小蘑菇 2020-12-01 02:30

I am making an app in Android Studio, now trying to debug it through adb. When I click on the word Android and the logo on the bottom bar, logcat comes up and recognizes my

相关标签:
30条回答
  • 2020-12-01 03:08

    Over the years I have visited this thread many times and there was always a different response that helped me. This time I figure out that it's my USB hub that was preventing debugger to work properly. As strange as it sounds, instead of having a phone connected to my computer via a USB hub, I had to connect it directly to my mac and debugging started to work.

    0 讨论(0)
  • 2020-12-01 03:09

    I also randomly had this problem even after debugging many times in Android Studio. One day the debugger just wouldn't attach. I just had to quit Android Studio and reopen it and the debugger started working again.

    0 讨论(0)
  • 2020-12-01 03:11

    Be sure to enable developer mode and USB debugging on the device or emulator. (Easy to forget when setting up a new one.)

    0 讨论(0)
  • 2020-12-01 03:12

    Also make sure you're not using other applications that might be using ADB too, like Eclipse for example.

    0 讨论(0)
  • 2020-12-01 03:13

    You also should have Tools->Android->Enable ADB Integration active.

    0 讨论(0)
  • 2020-12-01 03:14

    There is a Debug icon on the toolbar. It looks like a little "bug" and is located right next to the Run icon (which looks like a play button). Try launching the application with that.

    Edit: The following is deprecated when using Android Studio with Gradle.

    There is also a debug flag in the AndroidManifest.xml file. It is located under the application tag, and should be set to "true", as follows:

    <application android:debuggable="true">
    </application>
    
    0 讨论(0)
提交回复
热议问题