0
0
Firebasecloud~10 mins

Crash reporting in Firebase - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Crash reporting
App runs on device
Crash occurs?
NoApp continues
Yes
Crash detected by SDK
Crash data collected
Crash report sent to Firebase
Crash appears in Firebase Console
Developer reviews and fixes crash
The app runs and if a crash happens, the Firebase SDK detects it, collects data, sends it to Firebase, and the developer can then see and fix it.
Execution Sample
Firebase
firebase.crashlytics().log('App started');
// code that might crash:
throw new Error('Simulated crash');
This code logs app start, simulates risky code that causes a crash, and the Firebase Crashlytics SDK automatically detects it, collects data, and reports it.
Process Table
StepActionEvaluationResult
1App startsNo crash yetApp runs normally
2Crash occurs in risky codeCrash detectedCrashlytics SDK captures crash
3Crash data collectedStack trace and device info gatheredCrash report prepared
4Crash report sentNetwork availableReport sent to Firebase
5Crash appears in Firebase ConsoleReport receivedDeveloper notified
6Developer fixes crashCode updatedCrash prevented in future runs
7App runs againNo crashNormal operation
💡 Crash handled and reported; app continues or developer fixes issue
Status Tracker
VariableStartAfter CrashAfter Report SentFinal
appStaterunningcrashedreportingrunning
crashDatanonecollectedsentnone
networkStatusavailableavailableavailableavailable
Key Moments - 2 Insights
Why doesn't the app crash stop immediately when the error happens?
Because the Crashlytics SDK catches the crash event and collects data before the app fully stops, as shown in steps 2 and 3 of the execution table.
What happens if the network is not available when the crash report is sent?
The SDK stores the crash report locally and sends it later when the network is available, ensuring no data loss. This is implied in step 4 where network availability is checked.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step does the crash data get collected?
AStep 3
BStep 2
CStep 4
DStep 5
💡 Hint
Check the 'Action' and 'Result' columns in the execution table rows.
According to the variable tracker, what is the state of 'appState' after the crash but before the report is sent?
Arunning
Breporting
Ccrashed
Dnone
💡 Hint
Look at the 'After Crash' column for 'appState' in the variable tracker.
If the network was unavailable at step 4, how would the execution table change?
ACrash report would be sent immediately anyway
BCrash report sending would be delayed until network is available
CCrash data would not be collected
DApp would crash again
💡 Hint
Refer to the key moment about network availability and step 4 in the execution table.
Concept Snapshot
Crash Reporting with Firebase Crashlytics:
- SDK detects app crashes automatically
- Collects crash data like stack trace and device info
- Sends reports to Firebase Console
- Developer reviews crashes and fixes bugs
- Handles offline by storing reports locally
- Helps improve app stability over time
Full Transcript
Crash reporting in Firebase works by the app running normally until a crash happens. When a crash occurs, the Firebase Crashlytics SDK detects it and collects important data like the error and device details. Then it sends this crash report to the Firebase Console where developers can see it. If the network is down, the SDK saves the report and sends it later. Developers use this information to fix bugs and improve the app. This process helps keep apps stable and reliable.