Overview
iOS logging can be viewed through multiple tools including Console.app, Xcode, command-line utilities, and third-party applications.Quick Start
View Logs from Simulator
View Logs from Device
Using Console.app
Console.app is macOS’s built-in log viewer.1
Open Console.app
- Press Cmd+Space and type “Console”
- Or find it in
/Applications/Utilities/Console.app
2
Select device
- Connected devices appear in the sidebar
- Select your iPhone/iPad or Simulator
3
Filter logs
In the search bar, enter:
- Process:
YourApp - Category:
ReactNativeJS - Or custom filter expressions
Useful Filters
- Your app only:
process:"YourApp" - React Native:
category:"ReactNativeJS" - Errors only:
level:error - Combined:
process:"YourApp" AND level:error
Using Xcode
Xcode provides integrated log viewing.1
Open project
2
Run app
- Press Cmd+R or click Run button
- App builds and launches
3
View logs
- Open Debug area (Cmd+Shift+Y)
- Logs appear in the console pane
- Click filter icon for options
Xcode Console Features
- Filter by level: Error, Warning, Info, Debug
- Search: Use search bar to find specific messages
- Clear: Click trash icon to clear console
- Export: Right-click to save logs
Command Line Tools
Simulator Logs
Basic Stream
Filter by Process
Filter by Category
Filter by Level
default, info, debug, error, fault
Multiple Filters
Device Logs
Using idevicesyslog
Installlibimobiledevice:
Using log Command (macOS Catalina+)
Save Logs to File
JavaScript Console Logs
console.log()
console.warn()
console.error()
console.debug()
Formatted Logging
Native Logs
Objective-C
Swift
NSLog
os_log (Modern)
React Native Debugger
Install
Use
- Start React Native Debugger
- Open developer menu in app (Cmd+D)
- Select “Debug”
- Logs appear in debugger console
- Console logs
- Network inspector
- React DevTools
- Redux DevTools
Flipper
Facebook’s debugging platform for React Native.Install
Setup
Follow Flipper setup guide.Features
- Logs: Real-time log viewer
- Layout Inspector: View hierarchy
- Network: HTTP/HTTPS requests
- Databases: Browse app databases
- Crash Reporter: Native crash reports
- React DevTools: Component inspector
Safari Web Inspector
For debugging JSCore (non-Hermes):1
Enable Web Inspector
On device: Settings > Safari > Advanced > Web Inspector
2
Open Safari
On Mac, open Safari
3
Connect
Develop menu > [Your Device] > JSContext
4
Debug
Use Safari DevTools console
This only works with JavaScriptCore, not Hermes.
Crash Logs
View Recent Crashes
From Xcode
- Window > Devices and Simulators
- Select device
- Click View Device Logs
- Find crash reports
From Finder
Simulator crashes:Symbolicate Crash Reports
Performance Monitoring
Instruments
Xcode’s performance analysis tool:- In Xcode: Product > Profile (Cmd+I)
- Choose template:
- Time Profiler: CPU usage
- Allocations: Memory usage
- Leaks: Memory leaks
- Network: Network activity
- Record and analyze
React DevTools Profiler
- Open React Native Debugger or Flipper
- Go to Profiler tab
- Click Record
- Interact with app
- Stop and analyze
Advanced Filtering
Predicate Syntax
Used withlog stream:
Grep Patterns
Multiple Devices
List Simulators
Target Specific Simulator
List Devices
Target Specific Device
Log Levels
iOS uses these log levels (os_log):- Default: Standard log messages
- Info: Informational messages
- Debug: Debug messages (not persisted by default)
- Error: Error messages
- Fault: Critical errors
Configure Log Level
In code:Troubleshooting
No Logs Appearing
Solution:- Verify device/simulator is selected
- Check filter settings
- Try restarting app
- Clear and restart
Too Verbose
Solution: Use specific filters:Can’t Find Crash Logs
Solution:- Xcode > Window > Devices and Simulators
- Select device
- View Device Logs
- Filter by date/process
idevicesyslog Not Working
Solution:Best Practices
Use Appropriate Log Levels
Use Appropriate Log Levels
Tag Native Logs
Tag Native Logs
Remove Debug Logs Before Release
Remove Debug Logs Before Release
Use preprocessor directives:
Use Structured Logging
Use Structured Logging
Production Logging
For production apps, use error tracking services:- Sentry:
@sentry/react-native - Bugsnag:
@bugsnag/react-native - Firebase Crashlytics:
@react-native-firebase/crashlytics
Next Steps
Run iOS
Build and run your iOS app
Android Logs
View Android device logs
Debugging
Complete debugging guide
Troubleshooting
Common issues and solutions