Claude Skills Guide

Claude Code Capacitor Hybrid App Debugging Workflow

Debugging hybrid applications built with Capacitor presents unique challenges—your code runs across web, iOS, and Android platforms, each with its own set of potential issues. Claude Code transforms this complex debugging workflow into a structured, efficient process. This guide covers practical strategies for identifying and resolving issues in your Capacitor projects using Claude Code skills and features.

Understanding the Capacitor Debugging Landscape

Capacitor applications blend web technologies with native platform APIs, creating a layered architecture that can be difficult to troubleshoot. When something goes wrong, you might be dealing with JavaScript runtime errors, native plugin issues, or platform-specific behavior differences. Claude Code excels at navigating these layers because it can analyze your entire project context—including the native iOS and Android configurations—while helping you trace issues across the stack.

Before diving into debugging, ensure your Capacitor project is properly set up for development. Run npx cap sync to ensure your native projects are synchronized with your web code, and confirm your development server is running. Claude Code can verify these setup steps alongside you:

Check my Capacitor project setup - verify that ios and android directories exist, the cap.config.json is properly configured, and my development server configuration is correct for hot reload

Common Capacitor Debugging Scenarios

JavaScript Runtime Errors

The most frequent issues in Capacitor apps involve JavaScript errors that may only manifest on specific platforms. These often stem from browser API differences or Capacitor plugin initialization problems. When encountering runtime errors, start by providing Claude Code with the complete error message, stack trace, and the relevant code section:

My Capacitor app crashes on iOS when accessing the camera. The error is "Camera.getPhoto undefined is not a function". I'm using @capacitor/camera version 5.x. Here is my camera service code: [paste code]

Claude Code can analyze whether the plugin is properly installed, check your import statements, and verify the Capacitor plugin runtime is correctly initialized in your app.

Native Plugin Configuration Issues

Capacitor plugins frequently fail due to incomplete native configuration. iOS requires Info.plist entries for certain permissions, while Android needs corresponding manifest declarations. The bash tool becomes essential here—Claude Code can directly examine and modify your native configuration files:

# Check iOS Info.plist for camera permissions
grep -A 5 "NSCameraUsageDescription" ios/App/App/Info.plist

For Android, verify the equivalent permissions in android/app/src/main/AndroidManifest.xml. If permissions are missing, Claude Code can add them:

Add camera and photo library permissions to my iOS Info.plist and Android manifest. Use standard usage descriptions for a photo editing app

Platform-Specific Behavior Differences

One of Capacitor’s strengths is cross-platform compatibility, but each platform has subtle differences in how web APIs behave. Audio playback, file system access, and keyboard behavior can vary between iOS and Android. When debugging platform-specific issues, provide Claude Code with detailed context about which platform exhibits the problem:

The file picker works perfectly on Android but on iOS the app freezes when selecting files larger than 10MB. This happens in the document-service.ts file. Check if this could be a memory issue on iOS and suggest alternatives

Claude Code Skills for Capacitor Development

The webapp-testing Skill

The webapp-testing skill is invaluable for Capacitor debugging because it lets you interact with your running application through Playwright. This is particularly useful for testing Capacitor’s WebView behavior:

/webapp-testing start my Capacitor dev server and test the user login flow - check for console errors and take screenshots on failure

This skill automates browser interaction testing, helping you reproduce bugs that occur during specific user journeys.

The bash Skill for Build Verification

Build errors in Capacitor often originate from the native build process. Use Claude Code’s bash skill to run build commands and parse their output:

Run `npx cap sync ios` and analyze any errors related to CocoaPods or Xcode configuration. Fix the issues preventing a successful build

For Android builds:

Build the Android debug APK with `./gradlew assembleDebug` and check for any ProGuard or signing errors in the output

The xlsx Skill for Test Logging

When debugging complex issues that require tracking multiple test cases across platforms, the xlsx skill helps maintain organized records:

/xlsx create a test log spreadsheet with columns: test case, platform (iOS/Android/Web), expected result, actual result, status, and notes. Log the current navigation bug we're debugging

Practical Debugging Workflow Example

Let us walk through a complete debugging workflow for a typical Capacitor issue: push notifications not working on iOS.

Step 1: Gather Context

Before engaging Claude Code, collect relevant information:

Step 2: Initial Analysis Request

Present the issue to Claude Code with full context:

I'm debugging push notification failures on iOS. Push notifications work on Android but fail on iOS with error "Remote notification permission not granted". 

Environment:
- @capacitor/push-notifications: 5.0.0
- iOS 17.0, Xcode 15.0
- Using Ionic React

Steps to reproduce:
1. Fresh app install
2. Request push notification permissions
3. Permission appears to be granted but registration fails

Check my AppDelegate.swift for push notification setup, verify the Info.plist has UIBackgroundModes with remote-notification, and examine my notification service registration code

Step 3: Iterative Investigation

Claude Code will examine your files and provide findings. The investigation might reveal:

Step 4: Solution Implementation

Once the root cause is identified, implement the fix:

The issue is that I need to call PushNotifications.register() after the app deviceready event fires. My current code initializes in useEffect which runs before Capacitor is ready. Move the registration to the platform ready handler

Step 5: Verification

Verify the fix works across platforms:

Test push notification registration on both iOS and Android simulators. Check for success callbacks and verify no console errors appear

Advanced Debugging Techniques

Debugging Capacitor Plugins

When debugging issues with third-party Capacitor plugins, examine their source and understand their native implementations. Claude Code can help you trace plugin behavior:

Examine the node_modules/@capacitor-community/file-opener directory - find the native iOS implementation and explain how the open method works

Using Native Debugging Tools

For issues that cannot be reproduced in the browser, native debugging tools become necessary. On iOS, Safari’s Web Inspector can debug the Capacitor WebView. Claude Code can guide you through enabling Web Inspector and connecting it to your app.

On Android, Chrome’s remote debugging works similarly:

Explain how to enable USB debugging on Android and connect Chrome DevTools to debug my Capacitor WebView - list the specific Chrome URL to access for device inspection

Log Analysis Across Platforms

Capacitor apps generate logs in multiple locations: browser console, native device logs, and Xcode/Android Studio console logs. Collect and analyze these together:

Parse these iOS device logs and find any Capacitor or JavaScript errors: [paste log output]. Cross-reference with the browser console errors I pasted earlier and identify the root cause

Setting Up Before You Debug

This guide assumes your Capacitor project is already initialized and building. If you are starting from scratch or need to understand project configuration, plugin integration, state management, or deployment, see the Claude Code Capacitor Hybrid App Development Guide first.

Conclusion

Claude Code transforms Capacitor debugging from a frustrating multi-platform challenge into a structured, systematic process. By leveraging its ability to work across your entire project—including native iOS and Android configurations—you can trace issues through every layer of your hybrid application. The key is providing comprehensive context: error messages, platform information, code snippets, and reproduction steps. Combine this with skills like webapp-testing for automated browser testing and bash for build verification, and you have a powerful debugging toolkit for any Capacitor project.

Built by theluckystrike — More at zovo.one