Created detailed guide for viewing console logs: Console Debugging Guide: - Method 1: Safari Web Inspector (JavaScript console) - recommended - Method 2: Xcode Console (Native Swift logs) - Method 3: Terminal commands (quick log viewing) Guide Includes: - Step-by-step instructions for each method - What logs you'll see in each method - Troubleshooting common issues - Example debugging session - Quick reference table Access Methods: - Safari Web Inspector: Best for JavaScript/plugin debugging - Xcode Console: Best for native Swift debugging - Terminal: Best for quick checks and filtering Result: Developers can now easily debug permission issues and plugin calls
5.3 KiB
5.3 KiB
Console Debugging Guide for iOS Test App
Author: Matthew Raymer
Date: November 11, 2025
Version: 1.0.0
Overview
This guide explains how to view console logs from the iOS test app, including both JavaScript (WebView) and native Swift logs.
Method 1: Safari Web Inspector (JavaScript Console) ⭐ Recommended
This is the best way to see JavaScript console.log() messages and debug plugin calls.
Step 1: Enable Web Inspector on Simulator
- Open Settings app on the iOS Simulator
- Navigate to Safari → Advanced
- Toggle "Web Inspector" to ON
Step 2: Enable Develop Menu in Safari (Mac)
- Open Safari on your Mac
- Go to Safari → Settings (or Preferences)
- Click "Advanced" tab
- Check "Show Develop menu in menu bar"
Step 3: Connect to Your App
- Make sure your app is running in the simulator
- In Safari menu bar: Develop → [Your Simulator Name] → [Your App Name]
- Example: Develop → iPhone 17 Pro - iOS 26.0 → DailyNotification Test App
- This opens the Web Inspector window
Step 4: View Console
- Click the "Console" tab in Web Inspector
- You'll see all JavaScript
console.log(),console.error(), etc. messages - Filter by typing in the search box (e.g., "permission", "DNP", "error")
What You'll See
🔐 checkPermissions called🔐 Plugin available: true/false🔐 checkPermissionStatus method: function/undefined✅ Permission status result:(if successful)❌ Error:(if failed)
Method 2: Xcode Console (Native Swift Logs)
This shows native Swift print(), NSLog(), and os_log() messages.
Steps
- Open Xcode
- Go to Window → Devices and Simulators (or press
Cmd+Shift+2) - Select your simulator from the left sidebar
- Click "Open Console" button at the bottom
- Filter by typing in the search box:
DNP-PLUGIN- All plugin logsApp- All app logspermission- Permission-related logs
What You'll See
DNP-PLUGIN: Checking permission statusDNP-PLUGIN: Permission status: notifications=true, exactAlarm=true...DNP-PLUGIN: Requesting notification permissions
Method 3: Terminal (Command Line)
For quick log viewing without opening Xcode or Safari.
View All App Logs
xcrun simctl spawn booted log stream --predicate 'process == "App"' --level info
View Plugin Logs Only
xcrun simctl spawn booted log stream --predicate 'subsystem == "com.timesafari.dailynotification"' --level info
View Permission-Related Logs
xcrun simctl spawn booted log stream --predicate 'process == "App" OR subsystem == "com.timesafari.dailynotification"' --level info | grep -iE "DNP|permission|error|check"
View Recent Logs (Last 10 Minutes)
xcrun simctl spawn booted log show --predicate 'process == "App" OR subsystem == "com.timesafari.dailynotification"' --last 10m --style compact | grep -iE "DNP|permission"
Quick Reference
JavaScript Console (Safari Web Inspector)
- Best for: Debugging JavaScript/TypeScript code, plugin method calls
- Shows:
console.log(),console.error(), promise results - Access: Safari → Develop → [Simulator] → [App] → Console tab
Native Console (Xcode)
- Best for: Debugging Swift code, native plugin implementation
- Shows:
print(),NSLog(),os_log()messages - Access: Xcode → Window → Devices and Simulators → Open Console
Terminal Logs
- Best for: Quick checks, filtering, automation
- Shows: System logs, app logs, plugin logs
- Access: Terminal commands (see above)
Troubleshooting
"Develop menu not showing in Safari"
- Make sure you enabled "Show Develop menu in menu bar" in Safari settings
- Restart Safari if needed
"No devices in Develop menu"
- Make sure the simulator is running
- Make sure the app is running in the simulator
- Try restarting Safari
"Web Inspector shows blank console"
- Make sure Web Inspector is enabled in simulator Settings → Safari → Advanced
- Try refreshing the Web Inspector (close and reopen)
- Check that JavaScript is enabled in the app
"No logs in Xcode Console"
- Make sure you selected the correct simulator
- Check that the app is actually running
- Try filtering by process name or subsystem
Example Debugging Session
- Open Safari Web Inspector (Method 1)
- Click "Check Permissions" button in the app
- Watch the Console tab for:
🔐 checkPermissions called 🔐 Plugin available: true 🔐 checkPermissionStatus method: function 🔐 Calling checkPermissionStatus... 🔐 Promise returned: Promise {<pending>} ✅ Permission status result: {notificationsEnabled: false, ...} - If you see errors, check:
- Is the plugin registered? (should see "Plugin available: true")
- Is the method a function? (should see "function")
- Does it return a promise? (should see "Promise")
- What's the error message?
Next Steps
After checking the console:
- If you see "Plugin available: false" → Plugin registration issue
- If you see "checkPermissionStatus method: undefined" → Method not registered
- If you see "Permission check timed out" → Promise never resolved (check native logs)
- If you see error messages → Check the error details in console