Debug Retool Mobile Android Crashes with Logcat

It might be difficult to debug why the android app is crashing when executing some user code. Looking at native Android logs via Logcat can be helpful in such cases.

Here are the instructions to view native Android logs using Logcat

Guide - Investigate crash using log cat

Step 1: Install Android Studio

  1. Download Android Studio:
  1. Install Android Studio:
  • Run the downloaded installer and follow the on-screen instructions to install Android Studio.
  • During the installation process, make sure to install the Android SDK and the necessary emulator images.

Step 2: Set Up Your Device

  1. Enable Developer Options on your Android device:
  • Go to Settings > About phone.
  • Tap Build number seven times to unlock Developer Options.
  1. Enable USB Debugging:
  • Go to Settings > Developer options.
  • Enable USB debugging.
  1. Connect Your Device:
  • Connect your Android device to your computer using a USB cable.
  • Allow USB debugging on your device if prompted.

Step 3: Set Up Android Studio for Logcat

  1. Open Android Studio:
  • Launch Android Studio from your installed applications.
  1. Create a New Project (optional):
  • If you're opening Android Studio for the first time, create a new project. You can name it anything, as you won't be using it directly.
  1. Open Logcat:
  • In Android Studio, go to View > Tool Windows > Logcat.
  • Alternatively, you can find the Logcat window at the bottom of the Android Studio interface.

Step 4: Capture Logs from com.retool.retool

  1. Filter Logcat for the Retool App:
  • In the Logcat window, there's a filter bar. Type com.retool.retool to filter logs specific to the Retool app.
  1. Reproduce the Crash:
  • Open the com.retool.retool app on your Android device and reproduce the crash.
  1. Capture the Logs:
  • Observe the logs in the Logcat window. Look for any error messages or stack traces that occur at the time of the crash.
  • Right-click within the Logcat window and select Save Logcat to File to save the logs for further analysis.

Next time, when the app crashes and you need help, send us this log file and we can look into it!

1 Like