I have difficulties with with debugging at Android Studio. After trying to launch application in debug mode device show alert with "Waiting For Debugger" title that never disappear. Also I have android:debuggable="true"
in my manifest file and seems like device connected correctly, because I can simply run my application without any problem. What I'm doing wrong?
9 Answers
Remove android:debuggable="true"
, because when you run/debug an application in Android Studio is signed with a debug certificate so that setting is not mandatory.
Then check from console if the device is correctly attached with an adb devices
. You should see it listed.
Then try in this way:
1 - close Android Studio and any other IDE you have opened (maybe you have Eclipse also running?) and emulator instances;
2 - remove USB cable from PC;
3 - run adb kill-server
from console;
4 - open Android Studio;
5 - click on run/debug;
6 - when the window to select the device appears, attach your device to USB and USB to your computer;
-
2@cheeesus in that case, try step 3 as first thing. Kill the server, then wait few seconds, then re-issue the
adb devices
command. Server will be restarted and you should see your devices listed.– fastequeAug 22, 2014 at 11:36 -
Thank you!!! I had no idea why adb was hanging when I launched Android Studio but unplugging the device before launch worked perfectly.– JedidjaOct 9, 2014 at 13:18
-
Great! Works for me. Just need to say it's a bit annoying as I need to repeat it several times a day... can't the guys from JetBrains fix the tool?– pepanMar 20, 2015 at 11:07
-
2@AlexanderSolonik in your shell or terminal. If you have the Android Platform Tools in your path, you can run it from any location, otherwise
adb
is stored intYOUR_ANDROID_SDK_FOLDER/platform-tools
.– fastequeJul 15, 2015 at 7:52 -
@fasteque , thanks one more question where do i change from MTP to PTP ? any idea ? Jul 15, 2015 at 9:26
I have similar issue (running Android Studio on Ubuntu)
What I do:
- Close Android Studio (and Emulator(s) if running)
Go to adb folder (/wherever_location_is/sdk/platform-tools) and run command:
./adb kill-server
Open Android Studio.
Now Logcat messages appear again.
Remove those lines related to debugging. When you launch an application from Android Studio it is signed with a debug key. Any debugging information you need can be viewed in logcat from Android Studio. Also make sure you are running the latest version (help -> check for updates) I think that's where its at.
I'm struggling with similar issue every day and as restarting the studio or the device is pretty time consuming (and sometimes even does not work), I was trying many things and by coincidence I found an awkward (but working) solution.
When you are in the situation when you hit debug button in Android Studio, the studio says it's connected and the device says: Waiting for Debugger, but the device waits forever, do this:
- In Android Studio, hit the 'Edit Configurations' pop-up button
- Once the Run/Debug Configurations dialog opens, the debug process starts!
Works like a miracle!
Try this way - it works for me:
open
Run
run/debug configuration
Android app
app
Debugger
Debug type
set Auto
I had the same problem when i enabled the Proguard for debug!, Please disable it and try !!!
I think this might help. After launching application, click on Run and find Attach Debugger to Android Process
[
Check in gradle. if you apply proguard for debug then dubugging process not applicable to app.Make sure minifyEnabled false in debug.