The Settings app on Android includes a screen called Developer options that lets you configure system behaviors that help you profile and debug your app performance. For example, you can enable debugging over USB, capture a bug report, enable visual feedback for taps, flash window surfaces when they update, use the GPU for 2D graphics rendering, and more.
Note: The list of developer options can vary between Android versions.
Figure 1. Developer options
On Android 4.1 and lower, the Developer options screen is available by default. On Android 4.2 and higher, you must enable this screen as follows:
Open the Settings app.
(Only on Android 8.0 or higher) Select System.
Scroll to the bottom and select About phone.
Scroll to the bottom and tap Build number 7 times.
Return to the previous screen to find Developer options near the bottom.
At the top of the Developer options screen, you can toggle the options on and off (figure 1). You probably want to keep this on. When off, most options are disabled except those that don't require communication between the device and your development computer.
Next, you should scroll down a little and enable USB debugging. This allows Android Studio and other SDK tools to recognize your device when connected via USB, so you can use the debugger and other tools.
The rest of this page describes some of the other options available on this screen.
On Android 8.0 and higher, you can tap Quick settings developer tiles to add selected developer options to your Quick Settings panel. After you select one or more of the available tiles (figure 2), open the Quick Settings panel and tap the pencil to enter edit mode. Then, drag the developer tiles from the tiles pane onto the Quick settings panel, and tap the pencil again to exit edit mode.
Figure 2. Add to Quick Settings panel
Other general options include the following:
Memory: (On Android 8.0 and higher) Display memory stats, such as average memory usage, memory performance, total memory available, average memory used, how much free memory is available, and how much memory is being used by apps.
Take bug report: Get a copy of the current device log files to share with someone. When you get a notification that the bug report is ready, tap the notification to share it.
System UI demo mode: Makes it easier to take clean screenshots by displaying a generic, preset notification bar that does not show notifications or low battery warnings. Enable Demo Mode allows you to change the appearance of the status bar using adb demo mode commands. Or you can use Show Demo Mode to hide notifications and display a preset status bar.
Note: The adb demo mode commands might not work on all devices because they are not verified during Android certification testing. They're only verified to work on Nexus and Pixel devices.
Desktop backup password: Sets a backup password so you can use adb commands to back up and restore device apps and data under password protection.
Stay awake: Sets your screen to stay on every time you plug it in.
Enable Bluetooth Host Controller Interface (HCI) snoop log: Captures all Bluetooth HCI packets in a file stored at /sdcard/btsnoop_hci.log. You can retrieve the packets, and then use a program like Wireshark to analyze and troubleshoot the information.
Figure 3. Debugging options enabled
Debugging options provide ways to configure on-device debugging, and to establish communication between the device and your development computer.
Enable USB debugging (figure 3) so your Android device can communicate with your development machine through Android Debug Bridge (adb). The Wait for Debugger option is unavailable until you use Select debug app to select the app to debug. If you enable Wait for Debugger, the selected app waits for the debugger to attach before it executes.
Other debugging options include the following:
Store logger data persistently on device: Select the type of log messages you want to store persistently on the device. Options are off, all, all but radio, or kernal only.
Select mock location app: Use this option to fake the GPS location of the device to test whether your app behaves the same in other locations. To use this option, download and install a GPS mock location app.
Figure 4. View attributes
Enable view attribute inspection: Saves view attribute information in the mAttributes member variable of a View instance so it can be used for debugging. You can access the attribute information through the Hierarchy Viewer user interface, as shown in Figure 4.
Figure 5. Select USB Configuration
Networking options provide ways to configure Wi-Fi and DHCP settings.
Tap Select USB Configuration to specify how you want the computer to identify the device. As shown in figure 5, you can configure devices for charging only, to transfer files (MTP), to transfer pictures (PTP), to use your mobile internet on the PC (RNDIS), or to transfer audio or MIDI files.