by @cap-go
Comprehensive debugging guide for Capacitor applications. Covers WebView debugging, native debugging, crash analysis, network inspection, and common issues. Use this skill when users report bugs, crashes, or need help diagnosing issues.
Complete guide to debugging Capacitor apps on iOS and Android.
| Platform | WebView Debug | Native Debug | Logs |
|---|---|---|---|
| iOS | Safari Web Inspector | Xcode Debugger | Console.app |
| Android | Chrome DevTools | Android Studio | adb logcat |
Enable on device:
Enable in Xcode (capacitor.config.ts):
const config: CapacitorConfig = {
ios: {
webContentsDebuggingEnabled: true, // Required for iOS 16.4+
},
};
Connect Safari:
Debug:
const config: CapacitorConfig = {
android: {
webContentsDebuggingEnabled: true,
},
};
Connect Chrome:
chrome://inspectDebug features:
Install "Debugger for Chrome" extension:
// .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "attach",
"name": "Attach to Android WebVie...