Android Monitor has a main window that contains
the logcat, Memory, CPU, GPU, and Network
Monitors. From this window, you can select a device and app process to work with, terminate an
dumpsys system information, and create screenshots and videos of the
Prerequisites and Dependencies
Before you start using Android Monitor, you need to set up your environment, as well as the hardware device or emulator. All of the monitors require the following:
- If you want to run your app on a hardware device (as opposed to the emulator), connect it to the USB port. Make sure your development computer detects your device, which often happens automatically when you connect it.
- Enable ADB integration by selecting Tools > Android > Enable ADB Integration. Enable ADB Integration should have a check mark next to it in the menu to indicate it's enabled.
- Android Device Monitor can’t be running.
All but the logcat Monitor have these additional requirements:
- Enable USB debugging in Developer Options on the device or emulator.
- In your app, set the
truein the manifest or
build.gradlefile (it’s initially set by default).
The GPU Monitor has this requirement as well:
- For Android 5.0 (API level 21) and Android 5.1 (API level 22), in Developer Options on the device or emulator, set Profile GPU rendering to In adb shell dumpsys gfxinfo.
The Network Monitor and the Video Capture tool work with a hardware device only, not the emulator.
Displaying Android Monitor
Android Monitor is integrated into the Android Studio main window:
- To display Android Monitor, click , which by default is at the bottom of the main window.
- To hide Android Monitor, click again.
- Or select View > Tool Windows > Android Monitor.
Note: If you don't see the sidebar buttons, you can display them by selecting View > Tool Buttons.
Android Monitor looks like the following figure:
Profiling a Running App in Android Monitor
After you've met the prerequisites and optionally connected a hardware device, you're ready to profile an app in Android Monitor:
- Open an app project and run the app on a device or emulator.
- Display Android Monitor and click the tab for the monitor you want to view.
- Follow the instructions about using the monitor:
Switching between Devices and Apps
By default, Android Monitor displays data for your most recently run app. You can switch to another device and app as needed. In addition to currently running apps, you can view information about apps that are no longer running so you can continue to see any information about them that you gathered previously.
At the top of the Android Monitor main window are two menus listing devices and processes. To switch to another device, process, or both:
- Select the device or emulator.
The Device menu lists the devices and emulators that are running or have run during your current session. There are various status messages that can appear in the Device menu:
- DISCONNECTED - You closed an emulator or unplugged a device from the computer.
- UNAUTHORIZED - A device needs you to accept the incoming computer connection. For example, if the connected device displays an Allow USB Debugging dialog, click OK to allow the connection.
- OFFLINE - Android Monitor can’t communicate with a device, even though it has detected that device.
The Process menu lists the processes that are running or have run during your current session. If a process is no longer running, the menu displays a status of DEAD.
Rearranging Android Monitor Windows
You can rearrange the Android Monitor windows for optimal viewing during your tests:
- To move a monitor up or down, click Move Monitor Up or Move Monitor Down .
- To minimize or maximize a monitor, click Minimize Monitor or Maximize Monitor .
To rearrange the logcat and Monitors tabs:
- To reorder the logcat or monitor group, move the tabs back and forth.
- To move the logcat or monitor group to a standalone window, drag a tab to a different location on the screen. Or, select > Floating Mode.
- To dock a standalone window, drag it to the Android Monitor tab area.
- To combine the logcat and monitor group displays together, drag a tab and move it onto another monitor.
- To hide a tab, click the icon. To make it reappear, click Restore Monitors View or the Restore logcat View on the far right of the row of tabs.
Terminating an App
To stop an app you’ve run from Android Studio:
- Select the device and the process in the Android Monitor menus, if needed.
- Click Terminate Application .
The process status changes to DEAD in the Processes menu. The emulator or device continues to run, but the app closes. Any running monitors in Android Monitor stop.
Removing an App from a Device
To remove an app from a device you use for development, use the normal uninstall procedure on the device.
If you run a new version of an app from Android Studio that’s been already installed on a hardware device, the device displays an Application Installation Failed dialog. Click OK to install the new version of the app.
Using Other Main Window Features
From the Android Monitor main window, you can also do the following: