Skip to content

Android

Bobby Galli edited this page Feb 22, 2025 · 2 revisions

Android Debugging

This guide will help you attach the debugger in Android studio to the C++ code in bugsplatunitylib-release.aar.

  1. Clone and build the debug version of this project using Android Studio. Be sure to checkout the debug-info branch before building ​
  2. Copy bugsplatunitylib-debug.aar to my-unreal-crasher/Plugins/BugSplat/Source/ThirdParty/Android. ​
  3. Replace bugsplatunitylib-release.aar with bugsplatunitylib-debug.aar in Bugsplat_Android_UPL.xml
  4. Trigger a full rebuild/package of Android in Unreal. ​
  5. Open the Unreal Android project in Android Studio ​
  6. Add CRASHPAD_WRAPPER_PROJECT_DIR/crashpad-wrapper-lib-android/bugsplatunitylib/build/intermediates/merged_native_libs/debug/out/lib/arm64-v8a in Edit Configuration > Debugger > Symbols, being sure to replace CRASHPAD_WRAPPER_PROJECT_DIR with the full path on your system. ​
  7. Repeat step 6 with the other 2 ABI folders next to arm64-v8a
  8. Set the Debugger Debug Type to Native Only
  9. Open the file crashpad-wrapper-lib-android/bugsplatunitylib/src/main/cpp/native-lib.cpp in Android Studio and set a breakpoint in Java_com_ninevastudios_bugsplatunitylib_BugSplatBridge_jniInitBugSplat
  10. Run the app connected to the debugger, step through the entire function, and let me know what it returns.

Attaching to process

You can't step into the crashpad_handler process if the app is launched by the debugger. This used to work as the debugger could jump across forked processes, but that doesn't seem to be the case anymore. To debug a forked process the Android docs mention you need to either use an emulator or a rooted device.

Clone this wiki locally