/capacitor-quality:capacitor-ios-security-hardeningfrom capacitor-quality
Audits and progressively hardens Xcode security build settings for Capacitor iOS apps, including Enhanced Security, pointer authentication, static analysis, and compiler warnings.
Ships in capacitor-quality. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Audit the security-relevant Xcode build settings of a Capacitor app and its native plugins, then enable them in stages the user approves. This skill changes build settings and entitlements only. It never touches web code, ATS, signing, or secrets.
TRIGGER when:
ENABLE_ENHANCED_SECURITY, hardened-process entitlements, pointer authentication, arm64e, or memory taggingarm64excodebuild analyze in CIDo not use:
capacitor-securitycapacitor-apple-review-preflightcapacitor-uiscene-migrationcapacitor-securityios/App/Pods/Pods.xcodeproj), to SPM packages (plugins, CapApp-SPM), or to the Cordova plugin package that npx cap sync generates. Hardening plugin code is done in the plugin repo (podspec / Package.swift), not in the app.AppDelegate.swift, SceneDelegate.swift). Clang warnings and analyzer checkers only matter if the app target has .m, .mm, .c or .cpp files. Detect languages before proposing them.GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR, GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE, GCC_WARN_64_TO_32_BIT_CONVERSION = YES). Report them as already hardened. Do not re-add them.arm64e slice to device builds. Every binary linked into the app must also have arm64e, or the link fails. This is the main breakage risk in Capacitor apps. See references/enhanced-security.md.ios/App/Pods/**, Pods-App.*.xcconfig, ios/App/CapApp-SPM/Package.swift, ios/capacitor-cordova-ios-plugins/** and ios/debug.xcconfig (SPM template, Debug only, CLI-managed) are rewritten by CocoaPods or npx cap sync. Put settings in the App project (Xcode Build Settings, which writes project.pbxproj) or in an xcconfig the team already owns.Only load a reference when its topic is in play.
| File | Load when |
|---|---|
| references/settings-catalog.md | Building the audit table: every tracked setting, its hardened value, language scope, risk |
| references/reading-build-settings.md | Running xcodebuild -showBuildSettings, using the audit script, telling "explicitly disabled" from "default off" |
| references/enhanced-security.md | Enabling the Enhanced Security capability, entitlements, pointer authentication with CocoaPods/SPM/binary SDKs, memory tagging |
| references/plugin-authors.md | Hardening plugin code: podspec pod_target_xcconfig, Package.swift warning settings, analyzing a plugin repo, shipping arm64e xcframeworks |
| references/decision-log.md | Creating or updating the team's decision document |
Script: scripts/audit-build-settings.mjs filters xcodebuild -showBuildSettings -json output to the tracked settings and marks each as hardened, default, or explicitly set (when given the pbxproj).
Tell the user in two or three sentences: you will audit first, write a plan, and change nothing until they approve. If the project has no git, recommend committing first. Stop if they decline.
ios/App/App.xcodeproj exists. Note SPM (ios/App/CapApp-SPM/) vs CocoaPods (ios/App/Podfile, App.xcworkspace).package.json (@capacitor/ios). Capacitor 8 deploys to iOS 15, Capacitor 9 to iOS 16 and needs Xcode 27.find ios/App/App -name '*.m' -o -name '*.mm' -o -name '*.c' -o -name '*.cpp'. Also run grep -E 'sourcecode\.cpp\.' ios/App/App.xcodeproj/project.pbxproj to catch files whose type was overridden to C++/ObjC++.node_modules/**/ios/**, binaryTarget in plugin Package.swift files, vendored_frameworks in podspecs.ios/xcode-security-settings.md or similar) and read prior decisions.xcodebuild -showBuildSettings -json -project ios/App/App.xcodeproj -target App -configuration Release > /tmp/app-release.json
node <skill>/scripts/audit-build-settings.mjs /tmp/app-release.json --pbxproj ios/App/App.xcodeproj/project.pbxproj
CODE_SIGN_ENTITLEMENTS path. The stock template has none; that is normal.Write the plan into the chat (or a file the user names). Group it by stage. Show only items that apply:
| Stage | Items | Default |
|---|---|---|
| A. Compiler warnings | The five security warnings, only if C/ObjC/C++ is present in the target | on |
| B. Static analyzer | The security checkers plus the clang-tidy check; analyzer runs only on Analyze, so no build risk | on |
| C. Enhanced Security | Capability at project level, entitlements on the App target, pointer authentication with the dependency plan | on, after the dependency check |
| D. Memory tagging | checked-allocations + soft-mode | off, offer |
| E. Extra diagnostics | The noisier warnings | off, offer |
| F. Disabled settings | Ask about each explicit = NO that has no documented reason | on |
Ask the user to approve, edit or cancel. Real judgement calls to put to the user:
arm64e slice: turn pointer authentication off on the App target (keeps the rest of Enhanced Security) or wait for the vendor.post_install hook that enables pointer authentication on pod targets, or turn it off on the App target.App.xcodeproj so every target inherits them, unless the setting is per target (entitlements, pointer-authentication opt-out).grep on project.pbxproj. If you edit project.pbxproj yourself, edit only the buildSettings dictionaries of the project's own Debug and Release XCBuildConfiguration entries (the ones listed by the PBXProject buildConfigurationList), keep the KEY = VALUE; syntax, and re-run -showBuildSettings to confirm.App.entitlements and wires CODE_SIGN_ENTITLEMENTS. Details: references/enhanced-security.md.# Sync, then build for a device (arm64e only exists for device SDKs)
npx cap sync ios
xcodebuild -project ios/App/App.xcodeproj -scheme App -configuration Release \
-destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO build
# CocoaPods projects: use -workspace ios/App/App.xcworkspace instead of -project
# Static analyzer
xcodebuild -project ios/App/App.xcodeproj -scheme App -configuration Debug \
-destination 'generic/platform=iOS Simulator' analyze
# Confirm the slices of the built app binary
lipo -archs ~/Library/Developer/Xcode/DerivedData/App-*/Build/Products/Release-iphoneos/App.app/App
arm64e, and the build system drops it. Do not add a simulator-only opt-out.pause / resume events. With memory tagging in soft mode, collect the simulated crash reports from Xcode Organizer or the device logs (ios-android-logs).Report: what was enabled, what was already hardened, what was skipped and why, which dependencies block arm64e, and the action item to test on hardware before release. Then update the decision document (references/decision-log.md).
| Symptom | Cause | Fix |
|---|---|---|
Link fails with messages that mention arm64e after enabling Enhanced Security | A pod, SPM package or xcframework was built without arm64e | Find it with lipo -archs. Source pods: post_install hook. SPM source packages: workspace setting iOSPackagesShouldBuildARM64e. Binary with no slice: ENABLE_POINTER_AUTHENTICATION = NO on the App target and ask the vendor. See references/enhanced-security.md |
Sandbox: rsync(...) deny(1) file-write-create in [CP] Embed Pods Frameworks | ENABLE_USER_SCRIPT_SANDBOXING = YES with CocoaPods script phases | Keep it NO on the App target while on CocoaPods, record the reason, revisit after the SPM migration (cocoapods-to-spm) |
| New warnings flood after Stage A | Warnings were off before | Fix real bugs first. If a warning is in generated or vendored code, keep it on and defer that code; never flip -Werror for the whole project |
Settings changed but -showBuildSettings shows the old value | Set on the wrong level, or a target-level value overrides the project | Check the target column in Xcode; remove the target override if it has no reason |
| App crashes at launch only on newer devices after memory tagging | Soft mode was turned off too early, or a native library has a memory bug | Re-enable soft mode, collect reports, fix or update the library (often bundled C code such as zip or SQLite) |
Edits vanished after npx cap sync or pod install | A generated file was edited | Move the setting to the App project or to the plugin's own podspec / Package.swift |
capacitor-security: ATS, signing, secrets, WebView and storage securitycocoapods-to-spm: SPM removes most pod-related hardening frictioncapacitor-plugin-spm-support: Package.swift layout for pluginsios-android-logs: capture crash and memory-tagging reports from devicesmetadata.json (opens in a new tab)references/decision-log.md (opens in a new tab)references/enhanced-security.md (opens in a new tab)references/plugin-authors.md (opens in a new tab)references/reading-build-settings.md (opens in a new tab)references/settings-catalog.md (opens in a new tab)scripts/audit-build-settings.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ios-security, xcode-hardening, capacitor-ios, build-settings, arm64e
7 skills in this plugin
/capacitor-accessibilityMakes Capacitor apps work with VoiceOver, TalkBack, Dynamic Type / Android font scale, Switch Control, hardware keyboards, Reduce Motion and Increase Contrast. Covers Capacitor-specific gaps - WKWebView not following iOS Dynamic Type, Android WebView text zoom breaking layouts, zoomEnabled/user-scalable, SPA route changes not announced, native views under the WebView (maps, camera preview) being unreachable, @capacitor/screen-reader (isEnabled, speak, stateChange) and @capacitor/text-zoom (getPreferred, set) - plus testing with Accessibility Inspector, simctl content_size, adb font_scale, TalkBack and axe-core, mapped to WCAG 2.2. Do not use for Ionic component styling (use ionic-design), notch/home-indicator layout (use safe-area-handling), keyboard overlap bugs (use capacitor-keyboard), automated test framework setup (use capacitor-testing), or App Store metadata (use capacitor-app-store)./capacitor-performanceDiagnoses and fixes performance problems specific to Capacitor apps - slow cold start or long splash, white screen after camera/backgrounding (WKWebView "WebView process terminated" reload, Android onRenderProcessGone), large base64 payloads over the native bridge (Camera, Filesystem.readFile, CapacitorHttp), jank in the WebView, memory growth from unremoved plugin listeners, oversized Preferences storage, slow Android WebView versions, and debug logging left on in release. Covers profiling with Safari Web Inspector, chrome://inspect, Xcode Instruments, Android Studio Profiler, and adb timing commands. Do not use for crash/stack-trace debugging (use debugging-capacitor or capacitor-native-observability), device log capture (use ios-android-logs), offline data architecture (use capacitor-offline-first / sqlite-to-fast-sql), splash configuration details (use capacitor-splash-screen), or generic web performance unrelated to Capacitor./capacitor-securityApp-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`, `webContentsDebuggingEnabled`, `NSAllowsArbitraryLoads`, `android:usesCleartextTraffic`, `android:allowBackup`, `net::ERR_CLEARTEXT_NOT_PERMITTED`, or ATS "requires the use of a secure connection" errors. Do not use for Xcode build-setting hardening (use capacitor-ios-security-hardening), deep link setup (capacitor-deep-linking), App Store review (capacitor-apple-review-preflight), CI design (capacitor-ci-cd), or live update setup (capgo-live-updates)./capacitor-testingTesting guide for Capacitor apps and plugins. Covers web-layer unit and component tests with Vitest and mocked Capacitor plugins (`vi.mock('@capacitor/core')`, `registerPlugin`), Playwright for the web build, Appium E2E with NATIVE_APP / WEBVIEW context switching, native plugin unit tests with Swift Testing vs XCTest (what can migrate, `CAPPluginCall` patterns, `xcodebuild test` on a simulator) and Android JUnit, plus an agent-driven verification loop on simulators and devices (build, install, launch, screenshot, UI hierarchy, tap, logs) with `xcrun simctl`, `xcrun devicectl`, `adb`, Xcode MCP device tools, and live reload via `npx cap run --url` (Capacitor 9) or `-l --host --port` (Capacitor 8). Use when adding tests, mocking plugins, "does it work on device", verifying a UI change on a simulator, migrating XCTest to Swift Testing, or setting up test CI. Do not use for crash log capture (ios-android-logs), WebView debugging sessions (debugging-capacitor), or build pipelines (capacitor-ci-cd)./debugging-capacitorDiagnoses 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::ERR_CLEARTEXT_NOT_PERMITTED`, App Transport Security blocks, CORS on capacitor://localhost, permission denials, live reload not connecting, and Capacitor 8.5+ UIScene regressions (appUrlOpen, universal links, pause/resume silent because AppDelegate callbacks stopped). Covers Safari Web Inspector, chrome://inspect, Xcode/LLDB, Android Studio, `npx cap run --url` (Capacitor 9) vs `-l --host` (8), `xcrun simctl openurl|privacy|push`, `xcrun devicectl device process launch|openURL`, `xctrace`. Do not use for only reading device logs (ios-android-logs), the UIScene migration itself (capacitor-uiscene-migration), deep-link setup (capacitor-deep-linking), speed (capacitor-performance), crash SDKs (capacitor-native-observability), tests (capacitor-testing), or upgrades/build errors (capacitor-app-upgrades, cocoapods-to-spm)./ios-android-logsGets, filters, streams, and saves logs and crash reports from Capacitor apps on iOS Simulator, iPhone, Android emulator and devices. Explains where Capacitor output goes (iOS bridge and mirrored JS console lines are stdout-only, so missing from Console.app and `log stream`; Android tags `Capacitor` and `Capacitor/Console`). Covers `xcrun simctl spawn booted log stream --predicate`, `simctl launch --console-pty`, `xcrun devicectl device process launch --console`, `log collect --device-udid`, Console.app, devicectl `systemCrashLogs`, `adb logcat --pid`, `-b crash`, Android Studio `package:mine`, tombstones, ANRs, `adb bugreport`. Use for "how do I see logs", "console.log not showing on device", "no logs in Console.app", "get the crash log", "logcat too noisy". Do not use for diagnosing the bug once logs are in hand (debugging-capacitor), production crash SDKs (capacitor-native-observability), MCP log tooling (capacitor-mcp), or profiling (capacitor-performance).npx claudepluginhub cap-go/capgo-skills --plugin capacitor-qualityOther plugins' skills for the same job