cap-go/capgo-skills

debugging-capacitor

Diagnoses and fixes runtime bugs in Capacitor iOS/Android apps - white/blank screen on launch, startup crashes, "X" plugin is not implemented on ios/android, net::ERRCLEARTEXTNOTPERMITTED, App Transport Security blocks, CORS on capacitor://localhost, permis…

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/cap-go/capgo-skills --skill debugging-capacitor

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Debugging Capacitor Apps

Find which layer is broken (web, bridge, native, OS config), prove it with the right inspector, then fix the smallest thing.

When to Use

TRIGGER when:

  • App shows a white/blank screen, crashes on launch, or freezes after a native call.
  • Error "<Name>" plugin is not implemented on ios|android or "<Name>.<method>()" is not implemented on ....
  • Network calls fail on device only: net::ERR_CLEARTEXT_NOT_PERMITTED, ATS "requires the use of a secure connection", CORS errors.
  • Permission prompts never appear or always deny.
  • Live reload (cap run --url, server.url) shows a blank page or "Webpage not available".
  • After updating to Capacitor 8.5+ / Xcode 27: appUrlOpen silent, universal links open the app but do nothing, JS pause/resume or custom AppDelegate code no longer runs.
  • User asks "how do I debug / inspect my Capacitor app".

Do not use:

  • Only need to stream, filter, or save logs or crash reports -> ios-android-logs.
  • Performing the AppDelegate -> SceneDelegate migration itself -> capacitor-uiscene-migration.
  • Setting up deep links, AASA, assetlinks from scratch -> capacitor-deep-linking.
  • Jank, slow startup, bundle size, memory tuning -> capacitor-performance.
  • Sentry / Crashlytics / Datadog in production -> capacitor-native-observability.
  • Writing unit/E2E tests -> capacitor-testing. AI/MCP device automation -> capacitor-mcp.
  • Gradle/Xcode build failures from version bumps -> capacitor-app-upgrades; Pods/SPM resolution -> cocoapods-to-spm.
  • Push token/delivery issues -> capacitor-push-notifications; keyboard overlap -> capacitor-keyboard; notch/insets -> safe-area-handling.

Triage Workflow

  1. Collect facts before touching code: platform(s), simulator vs device, debug vs release, Capacitor version (npx cap doctor), what changed last (upgrade, plugin added, config edit), exact error text.
  2. Classify the layer:
  • JS exception, failed fetch, bad route -> web layer: open the WebView inspector (Safari / chrome://inspect). See references/webview-inspection.md.
  • plugin is not implemented -> bridge/registration: the native code is not in the binary or JS cannot be injected. See Error Handling below.
  • Process dies / EXC_BAD_ACCESS / FATAL EXCEPTION -> native layer: run from Xcode / Android Studio with the debugger attached. See references/native-debugging.md.
  • Works on Android but not iOS after 8.5/Xcode 27, link/lifecycle related -> UIScene. See references/uiscene-regressions.md.
  1. Reproduce with a fresh sync: npm run build && npx cap sync then rebuild native. Stale public/ assets and un-synced plugins cause most "works in browser, broken on device" reports.
  2. Read the native console for Capacitor's own messages. iOS prints ⚡️ Loading app at ..., ⚡️ [log] - ..., ⚡️ ERROR: Unable to load ... to stdout (visible in Xcode's console, simctl launch --console-pty, devicectl ... launch --console; not in Console.app). Android logs under tag Capacitor and JS console under Capacitor/Console. Log commands live in ios-android-logs.
  3. Report the root cause and proposed fix to the user before invasive changes (deleting ios//android/, editing project.pbxproj, disabling ATS globally).
  4. Apply the fix, then run the Verification steps.

Tool Matrix

NeediOSAndroid
Inspect DOM/JS/networkSafari > Develop > device > appchrome://inspect/#devices
Native breakpointsXcode (npx cap open ios), LLDBAndroid Studio debugger (npx cap open android)
Run on target from CLInpx cap run ios --target <id>npx cap run android --target <id>
List targetsnpx cap run ios --listnpx cap run android --list
Open URL / deep linkxcrun simctl openurl booted <url>; device: xcrun devicectl device process openURL --device <id> <url>adb shell am start -W -a android.intent.action.VIEW -d "<url>" <appId>
Reset/grant permissions (sim)xcrun simctl privacy booted reset all <appId>adb shell pm revoke <appId> android.permission.CAMERA / adb shell pm clear <appId>
Fake push (sim)xcrun simctl push booted <appId> payload.jsonsend a real FCM message
Launch with stdoutxcrun simctl launch --console-pty booted <appId>; device: xcrun devicectl device process launch --console --device <id> <appId>adb logcat
ProfileInstruments / xcrun xctrace record --template 'Time Profiler'Android Studio Profiler

Details and caveats: references/device-cli.md.

Live Reload Quick Path

  • Capacitor 9 (@next): npx cap run ios --url http://192.168.1.68:5173. The old -l/--live-reload, --host, --port, --https flags are removed.
  • Capacitor 8.5 (stable): npx cap run ios -l --host 192.168.1.68 --port 5173 (add --https for an https dev server).
  • Android emulator/USB: --forwardPorts 5173:5173 runs adb reverse so http://localhost:5173 works.
  • Dev server must bind to 0.0.0.0; phone and Mac on the same Wi-Fi; iOS may ask for Local Network access; if denied the page never loads (re-enable in Settings > Privacy & Security > Local Network).
  • Never ship server.url / server.cleartext in capacitor.config.*; grep before release.

Error Handling

Error / symptomLikely causeFix
"Foo" plugin is not implemented on iosPlugin not in native project, or JS injection blockednpm i <plugin> -> npx cap sync ios. SPM: check ios/App/CapApp-SPM/Package.swift lists it; CocoaPods: check ios/App/Podfile. Remove WKAppBoundDomains from Info.plist or set ios.limitsNavigationsToAppBoundDomains: true.
"Foo" plugin is not implemented on androidGradle not synced, or a service worker intercepts the pagenpx cap sync android, then File > Sync Project with Gradle Files. Disable/unregister service workers in the native build.
"Foo.bar()" is not implemented on webCalling a native-only method in the browserGuard with Capacitor.isNativePlatform() / Capacitor.isPluginAvailable('Foo').
⚡️ ERROR: Unable to load .../index.html / white screenwebDir wrong or never copiedBuild web, verify webDir matches output folder, npx cap copy.
White screen, no native errorJS crash before first render, or bad <base href> / absolute asset pathsInspect WebView console; use relative/root paths that resolve under capacitor://localhost / https://localhost.
net::ERR_CLEARTEXT_NOT_PERMITTEDAndroid blocks HTTP (API 28+)Use HTTPS. For dev only: server.cleartext: true or a network_security_config.xml scoped to the dev host.
"The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."iOS ATSUse HTTPS. For dev only: NSExceptionDomains for the dev host, not global NSAllowsArbitraryLoads.
CORS error from API on device onlyOrigin is capacitor://localhost (iOS) / https://localhost (Android)Allow those origins server-side, or enable CapacitorHttp (plugins.CapacitorHttp.enabled: true) to route fetch/XHR natively.
Crash on permission request (iOS, This app has crashed because it attempted to access privacy-sensitive data without a usage description)Missing NS*UsageDescriptionAdd the key to ios/App/App/Info.plist.
Permission always denied on AndroidMissing <uses-permission> or user chose "Don't allow" twiceAdd to AndroidManifest.xml; guide user to settings.
No such module 'Capacitor' (Xcode)Opened .xcodeproj with CocoaPods, or SPM packages not resolvedPods: open App.xcworkspace, npx cap sync ios. SPM: File > Packages > Reset Package Caches. Deeper -> cocoapods-to-spm.
Unable to boot device in current state: BootedSimulator already runningNot an error; use booted as the device id.
appUrlOpen / universal links silent on iOS only after 8.5AppDelegate open url / continue userActivity no longer calledSee references/uiscene-regressions.md.
JS pause/resume stop firingCustom SceneDelegate missing proxy forwarding, or logic left in applicationDidEnterBackgroundSee references/uiscene-regressions.md.

More symptom-specific fixes: references/common-failures.md.

Verification

After any fix, prove it:

  1. npx cap doctor shows matching @capacitor/core, cli, ios, android versions.
  2. npm run build && npx cap sync completes with no warnings about missing plugins.
  3. Native console shows ⚡️ Loading app at capacitor://localhost... (iOS) / no Capacitor/Console errors (Android).
  4. WebView inspector console is clean on launch.
  5. Re-run the exact repro on both a simulator/emulator and a physical device, in a release build if the bug was release-only (cap run builds Debug by default; iOS accepts --configuration Release, Android release builds go through Android Studio or Gradle).
  6. For link/lifecycle fixes: test cold (app killed) and warm (app backgrounded) launch with simctl openurl / adb shell am start, and background/foreground once to see pause and resume.
  7. Before shipping: grep -n "server" capacitor.config.* shows no url/cleartext left over.

References

Only load a reference when its topic is in play.

FileLoad when
references/webview-inspection.mdAttaching Safari/Chrome inspectors, inspector shows no app, debugging release builds, early-startup JS errors
references/native-debugging.mdNative crash, breakpoints in plugins, LLDB, Android Studio debugger, Instruments/xctrace, memory leaks
references/device-cli.mdDriving simulators/devices from the terminal: install, launch, open URLs, permissions, push, app containers
references/uiscene-regressions.mdiOS deep links, universal links, cold-start URL, pause/resume, or AppDelegate code broken after Capacitor 8.5 / Xcode 27
references/common-failures.mdDetailed fixes for white screen, plugin not implemented, networking, permissions, live reload

Resources

  • https://capacitorjs.com/docs/ios/troubleshooting
  • https://capacitorjs.com/docs/android/troubleshooting
  • https://capacitorjs.com/docs/guides/live-reload
  • https://capacitorjs.com/docs/updating/8-5
  • https://capacitorjs.com/docs/cli/commands/run

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
cap-go
커뮤니티

capacitor-best-practices

Review and set up Capacitor apps against current best practices (Capacitor 8.5 stable, 9 alpha via @next). Use for a Capacitor codebase review, capacitor.config.ts audit, new project setup, aligning @capacitor/core/cli/ios/android and plugin majors, plugin patterns (availability checks, checkPermissions/requestPermissions, error code handling, web fallbacks), or release prep; or on " " plugin is not implemented on ios, Could not find the web assets directory, platform has not been added yet, a d

1시간 설치 수
2
GitHub Stars
79
업데이트
11월 12일
cap-go
커뮤니티

capacitor-security

App-level security audit and hardening for Capacitor apps. Use when the user wants a security review, OWASP MASVS check, or pentest fixes; runs the Capgo scanner (npx @capgo/capgo-sec scan, capsec, rule IDs like SEC001, NET003, CAP004); finds API keys or .env values in the web bundle; stores tokens in @capacitor/preferences or localStorage; needs Keychain/Keystore storage, certificate pinning, CSP, or root/jailbreak detection; or sees server.cleartext, allowNavigation, webContentsDebuggingEnable

1시간 설치 수
1
GitHub Stars
78
업데이트
11월 12일
cap-go
커뮤니티

capacitor-deep-linking

Implements and debugs deep links in Capacitor apps - custom URL schemes, iOS Universal Links (apple-app-site-association, Associated Domains entitlement), Android App Links (assetlinks.json, autoVerify), and routing via @capacitor/app appUrlOpen + App.getLaunchUrl(). Covers the Capacitor 8.5+ UIScene change where AppDelegate application(:open:options:) and continue userActivity stop being called and custom handling must move to SceneDelegate, plus cold vs warm launch testing. Use when links open

1시간 설치 수
2
GitHub Stars
77
업데이트
10월 17일
cap-go
커뮤니티

capacitor-plugins

Pick, install, and wire up Capacitor plugins for native features (camera, filesystem, geolocation, biometrics, in-app purchases, social login, SQLite, calendar, contacts, health, BLE, NFC, etc.). Covers official @capacitor/ packages (Capacitor 8.5 stable, 9 alpha on next) plus the 145-package @capgo/ index, native permission keys (Info.plist, AndroidManifest, variables.gradle minSdk), npx cap sync / cap ls verification, and errors like '"Camera" plugin is not implemented on ios', 'unable to find

1시간 설치 수
2
GitHub Stars
74
업데이트
10월 17일