Overview
Android logging is handled throughadb logcat, which displays system and application logs from connected Android devices and emulators.
Usage
Basic Logcat
Filter React Native Logs
Your App’s Logs
Common Filters
By Tag
By Priority
V- VerboseD- DebugI- InfoW- WarningE- ErrorF- FatalS- Silent (suppress all)
Multiple Filters
Output Formats
Brief (Default)
Time
Threadtime
Long
Useful Commands
Clear Logs
Save to File
Follow Logs in Real-Time
Last 100 Lines
Colored Output
Usepidcat for colored, filtered logs:
JavaScript Console Logs
console.log()
console.warn()
console.error()
console.debug()
Native Module Logs
Android Log API
In native Android code:React Native Bridge
Filtering Techniques
Grep Patterns
By Process ID
By Package
Multiple Devices
List Devices
Target Specific Device
Advanced Filtering
Custom Filter Script
Createfilter-logs.sh:
filter-logs.sh
Color-coded Grep
Performance Monitoring
Memory Logs
CPU and Threading
Crashes
Network
Crash Debugging
View Stack Traces
After Crash
Native Crashes
Integration with Development
React Native CLI
When running:Metro Bundler
When running:Separate Log Window
Debugging Tools
React Native Debugger
Standalone app with integrated Chrome DevTools:- Console logs
- Network inspector
- Redux DevTools
- React DevTools
Flipper
Desktop debugging platform:- Logs viewer
- Network inspector
- Layout inspector
- Database viewer
Chrome DevTools
- Open developer menu (Cmd+M or Ctrl+M)
- Select “Debug”
- Open Chrome DevTools
- View Console tab
Log Management
Rotate Logs
Multiple Buffers
Troubleshooting
No Logs Appearing
Solution:- Check device connection:
- Restart ADB:
- Check log buffers:
Too Much Noise
Solution: Use more specific filters:Logs Cut Off
Solution: Increase buffer size:Can’t Find App Logs
Solution: Verify app package name:Best Practices
Use Appropriate Log Levels
Use Appropriate Log Levels
- Use
console.log()for general information - Use
console.warn()for warnings - Use
console.error()for errors - Use
console.debug()for verbose debugging
Tag Your Native Logs
Tag Your Native Logs
Always use descriptive tags in native code:
Clean Up Debug Logs
Clean Up Debug Logs
Remove or disable verbose logging before production:
Use Proper Tools
Use Proper Tools
- Development: Metro bundler console
- Debugging: React Native Debugger or Flipper
- Native issues: adb logcat with filters
- Production: Error tracking services (Sentry, Bugsnag)
Next Steps
Run Android
Build and run your Android app
iOS Logs
View iOS device logs
Debugging
Complete debugging guide
Troubleshooting
Common issues and solutions