Check out what’s new from Firebase@ Google I/O 2021, and join our alpha program for early access to the new Remote Config personalization feature. Learn more

Test your Crashlytics implementation

Force a crash to test your implementation

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


Button crashButton = new Button(this);
crashButton.setOnClickListener(new View.OnClickListener() {
   public void onClick(View view) {
       throw new RuntimeException("Test Crash"); // Force a crash

addContentView(crashButton, new ViewGroup.LayoutParams(


val crashButton = Button(this)
crashButton.text = "Crash!"
crashButton.setOnClickListener {
   throw RuntimeException("Test 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.

Your test crash should quickly appear in the Firebase console. If you've refreshed the console and you're still not seeing your test crash after five minutes, reach out to Firebase Support.

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.

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

adb shell setprop log.tag.FirebaseCrashlytics DEBUG

To view the logs in your device logs, run:

adb logcat -s FirebaseCrashlytics

To disable debug logging, set the flag back to INFO:

adb shell setprop log.tag.FirebaseCrashlytics INFO

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.