Debugging Capacitor logo

Debugging Capacitor

Organization
Cap-go
debugging-capacitor

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.

Overview

PublisherCap-go
Repositorycapgo-skills
Skill namedebugging-capacitor
Stars
71
Forks
4
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Cap-go on GitHub. Read the source before you install it.

Installation

Install the Debugging Capacitor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Cap-go/capgo-skills.git /tmp/capgo-skills
mkdir -p .claude/skills
cp -r /tmp/capgo-skills/plugins/capacitor-quality/skills/debugging-capacitor .claude/skills/debugging-capacitor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Debugging Capacitor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Debugging Capacitor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Debugging Capacitor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Debugging Capacitor Applications

Complete guide to debugging Capacitor apps on iOS and Android.

When to Use This Skill

  • User reports app crashes
  • User needs to debug WebView/JavaScript
  • User needs to debug native code
  • User has network/API issues
  • User sees unexpected behavior
  • User asks how to debug

Quick Reference: Debugging Tools

PlatformWebView DebugNative DebugLogs
iOSSafari Web InspectorXcode DebuggerConsole.app
AndroidChrome DevToolsAndroid Studioadb logcat

WebView Debugging

iOS: Safari Web Inspector

  1. Enable on device:

    • Settings > Safari > Advanced > Web Inspector: ON
    • Settings > Safari > Advanced > JavaScript: ON
  2. Enable in Xcode (capacitor.config.ts):

typescript
const config: CapacitorConfig = {
  ios: {
    webContentsDebuggingEnabled: true, // Required for iOS 16.4+
  },
};
  1. Connect Safari:

    • Open Safari on Mac
    • Develop menu > [Device Name] > [App Name]
    • If no Develop menu: Safari > Settings > Advanced > Show Develop menu
  2. Debug:

    • Console: View JavaScript logs
    • Network: Inspect API calls
    • Elements: Inspect DOM
    • Sources: Set breakpoints

Android: Chrome DevTools

  1. Enable in config (capacitor.config.ts):
typescript
const config: CapacitorConfig = {
  android: {
    webContentsDebuggingEnabled: true,
  },
};
  1. Connect Chrome:

    • Open Chrome on computer
    • Navigate to chrome://inspect
    • Your device/emulator should appear
    • Click "inspect" under your app
  2. Debug features:

    • Console: JavaScript logs
    • Network: API requests
    • Performance: Profiling
    • Application: Storage, cookies

Remote Debugging with VS Code

Install "Debugger for Chrome" extension:

json
// .vscode/launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "attach",
      "name": "Attach to Android WebView",
      "port": 9222,
      "webRoot": "${workspaceFolder}/dist"
    }
  ]
}

Native Debugging

iOS: Xcode Debugger

  1. Open in Xcode:
bash
npx cap open ios
  1. Set breakpoints:

    • Click line number in Swift/Obj-C files
    • Or use breakpoint set --name methodName in LLDB
  2. Run with debugger:

    • Product > Run (Cmd + R)
    • Or click Play button
  3. LLDB Console commands:

lldb
# Print variable
po myVariable

# Print object description
p myObject

# Continue execution
continue

# Step over
next

# Step into
step

# Print backtrace
bt
  1. View crash logs:
    • Window > Devices and Simulators
    • Select device > View Device Logs

Android: Android Studio Debugger

  1. Open in Android Studio:
bash
npx cap open android
  1. Attach debugger:

    • Run > Attach Debugger to Android Process
    • Select your app
  2. Set breakpoints:

    • Click line number in Java/Kotlin files
  3. Debug console:

# Evaluate expression
myVariable

# Run method
myObject.toString()
  1. Logcat shortcuts:
    • View > Tool Windows > Logcat
    • Filter by package: package:com.yourapp

Console Logging

JavaScript Side

typescript
// Basic logging
console.log('Debug info:', data);
console.warn('Warning:', issue);
console.error('Error:', error);

// Grouped logs
console.group('API Call');
console.log('URL:', url);
console.log('Response:', response);
console.groupEnd();

// Table format
console.table(arrayOfObjects);

// Timing
console.time('operation');
// ... operation
console.timeEnd('operation');

Native Side (iOS)

swift
import os.log

let logger = Logger(subsystem: "com.yourapp", category: "MyPlugin")

// Log levels
logger.debug("Debug message")
logger.info("Info message")
logger.warning("Warning message")
logger.error("Error message")

// With data
logger.info("User ID: \(userId)")

// Legacy NSLog (shows in Console.app)
NSLog("Legacy log: %@", message)

Native Side (Android)

kotlin
import android.util.Log

// Log levels
Log.v("MyPlugin", "Verbose message")
Log.d("MyPlugin", "Debug message")
Log.i("MyPlugin", "Info message")
Log.w("MyPlugin", "Warning message")
Log.e("MyPlugin", "Error message")

// With exception
Log.e("MyPlugin", "Error occurred", exception)

Common Issues and Solutions

Issue: App Crashes on Startup

Diagnosis:

bash
# iOS - Check crash logs
xcrun simctl spawn booted log stream --level debug | grep -i crash

# Android - Check logcat
adb logcat *:E | grep -i "fatal\|crash"

Common causes:

  1. Missing plugin registration
  2. Invalid capacitor.config
  3. Missing native dependencies

Solution checklist:

  • Run npx cap sync
  • iOS: cd ios/App && pod install
  • Check Info.plist permissions
  • Check AndroidManifest.xml permissions

Issue: Plugin Method Not Found

Error: Error: "MyPlugin" plugin is not implemented on ios/android

Diagnosis:

typescript
import { Capacitor } from '@capacitor/core';

// Check if plugin exists
console.log('Plugins:', Capacitor.Plugins);
console.log('MyPlugin available:', !!Capacitor.Plugins.MyPlugin);

Solutions:

  1. Ensure plugin is installed: npm install @capgo/plugin-name
  2. Run sync: npx cap sync
  3. Check plugin is registered (native code)

Issue: Network Requests Failing

Diagnosis:

typescript
// Add request interceptor
const originalFetch = window.fetch;
window.fetch = async (...args) => {
  console.log('Fetch:', args[0]);
  try {
    const response = await originalFetch(...args);
    console.log('Response status:', response.status);
    return response;
  } catch (error) {
    console.error('Fetch error:', error);
    throw error;
  }
};

Common causes:

  1. iOS ATS blocking HTTP: Add to Info.plist:
xml
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
  1. Android cleartext blocked: Add to capacitor.config.ts:
typescript
server: {
  cleartext: true, // Only for development!
}
  1. CORS issues: Use native HTTP:
typescript
import { CapacitorHttp } from '@capacitor/core';

const response = await CapacitorHttp.request({
  method: 'GET',
  url: 'https://api.example.com/data',
});

Issue: Permission Denied

Diagnosis:

typescript
import { Permissions } from '@capacitor/core';

// Check permission status
const status = await Permissions.query({ name: 'camera' });
console.log('Camera permission:', status.state);

iOS: Check Info.plist has usage descriptions:

xml
<key>NSCameraUsageDescription</key>
<string>We need camera access to scan documents</string>

Android: Check AndroidManifest.xml:

xml
<uses-permission android:name="android.permission.CAMERA" />

Issue: White Screen on Launch

Diagnosis:

  1. Check WebView console for errors (Safari/Chrome)
  2. Check if dist/ folder exists
  3. Verify webDir in capacitor.config.ts

Solutions:

bash
# Rebuild web assets
npm run build

# Sync to native
npx cap sync

# Check config
cat capacitor.config.ts

Issue: Deep Links Not Working

Diagnosis:

typescript
import { App } from '@capacitor/app';

App.addListener('appUrlOpen', (event) => {
  console.log('Deep link:', event.url);
});

iOS: Check Associated Domains entitlement and apple-app-site-association file.

Android: Check intent filters in AndroidManifest.xml.

Performance Debugging

JavaScript Performance

typescript
// Mark performance
performance.mark('start');
// ... operation
performance.mark('end');
performance.measure('operation', 'start', 'end');

const measures = performance.getEntriesByName('operation');
console.log('Duration:', measures[0].duration);

iOS Performance (Instruments)

  1. Product > Profile (Cmd + I)
  2. Choose template:
    • Time Profiler: CPU usage
    • Allocations: Memory usage
    • Network: Network activity

Android Performance (Profiler)

  1. View > Tool Windows > Profiler
  2. Select:
    • CPU: Method tracing
    • Memory: Heap analysis
    • Network: Request timeline

Memory Debugging

JavaScript Memory Leaks

Use Chrome DevTools Memory tab:

  1. Take heap snapshot
  2. Perform action
  3. Take another snapshot
  4. Compare snapshots

iOS Memory (Instruments)

bash
# Run with Leaks instrument
xcrun instruments -t Leaks -D output.trace YourApp.app

Android Memory (LeakCanary)

Add to build.gradle:

groovy
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'

Debugging Checklist

When debugging issues:

  • Check WebView console (Safari/Chrome DevTools)
  • Check native logs (Xcode Console/Logcat)
  • Verify plugin is installed and synced
  • Check permissions (Info.plist/AndroidManifest)
  • Test on real device (not just simulator)
  • Try clean build (rm -rf node_modules && npm install)
  • Verify capacitor.config.ts settings
  • Check for version mismatches (capacitor packages)

Resources

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Debugging Capacitor AI skill do?

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.

Why use Debugging Capacitor on TypingMind?

Because you install it once and use it with any model. Debugging Capacitor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Debugging Capacitor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Cap-go/capgo-skills/tree/main/plugins/capacitor-quality/skills/debugging-capacitor. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Debugging Capacitor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Debugging Capacitor?

As many as you like. As long as a model supports skills, you can use Debugging Capacitor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Debugging Capacitor AI skill free?

It is published on GitHub by Cap-go. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇