Test your Firebase Crashlytics implementation

Force a crash to test your implementation

You don't have to wait for a crash to know that Crashlytics is working. You can add a button to your app's MainActivity to force a crash:


Button crashButton = new Button(this);
crashButton.setOnClickListener(new View.OnClickListener() {
    public void onClick(View view) {
        Crashlytics.getInstance().crash(); // Force a crash

addContentView(crashButton, new ViewGroup.LayoutParams(


val crashButton = Button(this)
crashButton.text = "Crash!"
crashButton.setOnClickListener {
    Crashlytics.getInstance().crash() // Force a crash

addContentView(crashButton, ViewGroup.LayoutParams(

To test the implementation, press the button in your app to force the crash, then reopen your app so that Crashlytics can send the crash report to Firebase. It may take up to five minutes for the report to appear in the Firebase console.

Enable Crashlytics debug logging

If your forced crash didn't crash, crashed before you wanted it to, or you're experiencing some other issue with Crashlytics, you can enable Crashlytics debug logging to track down the problem.

Crashlytics 2.9.6 +

To enable debug logging on your development device, set two adb shell flags before running your app:

      adb shell setprop log.tag.Fabric DEBUG
      adb shell setprop log.tag.CrashlyticsCore DEBUG

View the logs in the device logs by running:

adb logcat -s Fabric CrashlyticsCore

To disable debug mode, set the flags back to INFO.

      adb shell setprop log.tag.Fabric INFO
      adb shell setprop log.tag.CrashlyticsCore INFO
Previous Versions

To enable debug mode on Android, you first need to disable automatic initialization by adding a line to your AndroidManifest.xml:

    android:value="false" />

You can then manually initialize Crashlytics with the debugger enabled:


final Fabric fabric = new Fabric.Builder(this)
        .kits(new Crashlytics())
        .debuggable(true)  // Enables Crashlytics debugger


val fabric = Fabric.Builder(this)
        .debuggable(true) // Enables Crashlytics debugger

Next steps

  • Customize crash reports— Crashlytics automatically starts collecting crash reports as soon as you add the SDK, but you can also customize your setup by adding opt-in reporting, logs, keys, and even tracking of non-fatal errors.