简体   繁体   中英

Detach debugger in Android Studio

In Android Studio, how do you detach the debugger once it's connected and debugging a running app?

In Eclipse, the icon looked like this .

I've been disconnecting the USB cable but that seems like a brute method.

The answer is the Close button. As of Android Studio v3.4 it's a red square block icon (previously was a red X).

It turns out I couldn't see it because it was hidden under the more >> icon.

I'm writing this assuming that Android Studio uses the same convention as IntelliJ IDEA .

Click "close" (the button with the red ✕ in the debug panel):

在此处输入图像描述

You will be prompted. Choose whether to disconnect and/or terminate:

在此处输入图像描述

In case the X (Close) button is not shown because it is collapsed in the toolbar:

1. Resize the Debugger window to see the button 按钮


OR

2. Press (CMD + F4 on MAC). (MAC 上的 CMD + F4)。


OR

3. Right click on the Debugger Tab and select .


Then press Disconnect in the Dialog.

On android studio 3.3.1 I also can't find an easy way to disconnect the emulator. I've resorted to the terminal command adb kill-server (use adb start-server to start it again)

In newer versions of Android Studio, the (X) Close button in the sidebar no longer exists. If that is your case and you want to detach the debugger from Android Studio, you can tap the "X" in the tab at the top of the debugging window that says "Android Debugger (XXXX)"

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM