Technical docs‎ > ‎

Use the Experimental Java-aware C++ Debugger

If your target device is running Android 7.0 (API level 24) or higher, you can use this experimental feature with the Auto and Native debug types, and inspect Java and C/C++ code with a single LLDB process, as shown in figure 1.
Figure 1. Debugging Java breakpoints with LLDB.

Using a single LLDB process to debug your code has the benefit of sharing state information between Java and native breakpoints, and it may appeal to developers who are already familiar with LLDB and want to use it to debug Java code. However, there is additional overhead associated with processing the relevant Java code, so this option is not appropriate for projects with a significant amount of Java. To enable this feature, you need to edit your Edit Your Run/Debug Configuration as follows:
  1. Select Run > Edit Configurations from the main menu
  2. Select your run/debug configuration and navigate to the Debugger tab.
  3. Select either Auto or Native from the Debug type dropdown menu.
  4. Check the box next to Experimental Java aware C++ debugger, as shown in figure 2.
    Figure 2. Enabling the experimental Java aware C++ debugger.
  5. Click OK.
The Auto debug mode only uses this feature if your project uses native code. If you enable this feature with the Native debug type, however, Android Studio uses LLDB to debug all your breakpoints, even if you only have Java code in your project.