


Changing log level to Error will help trim things down so it’s easier to find the critical issue that caused the app to crash. The Logcat window allows you to search and filter logs. To switch to Logcat view on Android Studio, click on the Logcat label in the bottom tool window.īelow is the report from Logcat just after the crash occurred: With our device connected via USB before the crash, Android Studio’s Logcat feature will display information about our app and the crash. Went back to the main settings UI, selected Additional settings, and looked for Developer options -in Developer options, you can turn on USB debugging.Tapped on Build number (MIUI version on my device) multiple times until I got a message reading “You are now a developer”.Opened settings and went to About phone.To enable USB debugging on my Redmi device, which is running a recent build of the MIUI, I did the following: The UI for doing this varies on different devices from different original equipment manufacturers (OEMs). To enable communication between ADB and a physical Android device, we’ll need to turn Developer options on and enable USB debugging. You can use an emulator as an alternative if you don’t have an Android phone. I’ll use Android Studio and run the example app on a physical Android phone. Getting the Crash Logįirst, let’s walk through the four steps you need to follow to get the crash log after the app crashes.

Source code for the example app is available here. You can set up an emulator on Android Studio via the AVD Manager. An Android device or emulator to run our example app.Android SDK will auto-install the first time you launch Android Studio. You can get Android Studio for Windows, Mac, or Linux from the official download page. A recent version of the Android Studio IDE and Android SDK installed.Prerequisitesīefore we get started, make sure you have the following so you can follow along: I’m going to walk you through how I diagnosed and fixed this issue using crash logs. For some users, the app crashed whenever they attempted to dial USSD codes from the app. The issue we’ll be diagnosing occurred in an early release of this app. Our Short Code Manager app is based on an app I built and published two years ago. Have a user interface (UI) enabling the app user to dial shortcodes directly from the app.Let users store short USSD codes like *123#.Short Code Manager is an Android app I built for this post. To show you what I mean, I’m going to walk you through a root cause analysis after a crash in an example app called Short Code Manager. Looking at these logs is a great place to start your effort toward diagnosing and fixing the crash. When apps crash, they generate logs containing information related to where the issues causing the crash occurred.
