构建预扫描检查
复制一个包含安装步骤和本插件的完整 Markdown 指南的配置提示。
在 Capgo 之前,Cloud Build 将上传您的项目,CLI 将运行一个 预扫描 预扫描
预扫描
npx @capgo/cli@latest build prescan <appId> --platform ios复制到剪贴板 80 今天有
检查。建议忽略单个检查 ID 而不是关闭整个扫描。
忽略特定检查# Skip one check entirely (example: intentional Capacitor server.url / Next.js shell)npx @capgo/cli@latest build request <appId> --platform ios \ --prescan-skip ios/capacitor-server-url-shipped
# Run the check but never block on it (error becomes warning)npx @capgo/cli@latest build request <appId> --platform ios \ --prescan-warn ios/capacitor-server-url-shipped
# Repeatable or comma-separatednpx @capgo/cli@latest build request <appId> --platform ios \ --prescan-skip ios/capacitor-server-url-shipped \ --prescan-warn ios/capacitor-allow-navigation-wildcard,ios/plist-ats-arbitrary-loads独立别名开启 build prescan:
npx @capgo/cli@latest build prescan <appId> --platform ios \ --skip ios/capacitor-server-url-shipped \ --warn ios/capacitor-server-cleartext未知检查ID快速失败并显示明确的错误。
全局转义(谨慎使用)
标题:全局转义(谨慎使用)| Flag | Effect |
|---|---|
--no-prescan | Skip the entire scan |
--prescan-ignore-fatal (or --ignore-fatal on build prescan) | Run scan, print report, never block |
--fail-on-warnings | Treat warnings as fatal (CI) |
--no-prescan and --prescan-ignore-fatal hide or bypass all remaining checks. Use per-check overrides instead when you only disagree with one rule.
Check catalog
《检查目录》使用完全相同的id --prescan-skip / --prescan-warn.
逐步强制 表示找到的是信息性结果,直到 2026-08-14,然后它可以阻止构建。
共享
《共享》| Id | 平台 | 它检查什么 | 逐步强制 |
|---|---|---|---|
shared/apikey-permission | ios, android | API key 可以请求原生构建 | — |
shared/app-exists | ios, android | API key 有 App id 并且可见 | — |
shared/credentials-saved | ios, android | 保存本地的 iOS/Android 凭证是必需的 | — |
shared/cap-sync-stale | ios, android | Web 资产构建并且 Capacitor 插件同步 | — |
shared/node-linker-layout | ios, android | node_modules 布局与 Capacitor 原生路径兼容 | — |
shared/bundle-id-consistency | ios, android | Capacitor appId 与原生 bundle id / applicationId 匹配 | — |
iOS
iOS| Id | 平台 | 检查内容 | 逐步强制 |
|---|---|---|---|
ios/p12-opens | iOS | 使用提供的密码打开iOS .p12文件 | — |
ios/p12-expiry | iOS签名证书未过期 | iOS的分发配置文件未过期 | — |
ios/profile-expiry | __CAPGO_KEEP_0__ | __CAPGO_KEEP_1__ | — |
ios/profile-bundle-match | __CAPGO_KEEP_2__ | Provisioning profile bundle id matches the app | — |
ios/profile-type-vs-mode | ios | Profile type matches app_store / ad_hoc mode | — |
ios/cert-profile-pairing | ios | Certificate is embedded in the provisioning profile | — |
ios/targets-covered | ios | All iOS targets have a provisioning profile | — |
ios/infoplist-sanity | ios | Info.plist has required version / identity keys | — |
ios/asc-key-valid | ios | App Store Connect API key fields look valid | — |
ios/asc-key-access | ios | API | — |
ios/plist-bundle-id-format | 可以通过 (远程) 访问应用 | iOS | CFBundleIdentifier 格式正确 |
ios/plist-version-short-format | 是 | iOS | CFBundleShortVersionString 格式正确 |
ios/plist-version-build-format | 是 | iOS | CFBundleVersion 格式正确 |
ios/plist-encryption-compliance | 是 | iOS、ITSAppUsesNonExemptEncryption 已声明 | 是 |
ios/plist-ats-arbitrary-loads | ios | NSAllowsArbitraryLoads 在生产环境中未启用 | 是 |
ios/plist-launch-storyboard | ios | 启动屏幕已声明 | 是 |
ios/plist-orientations-multitasking | ios | 方向/多任务设置一致 | 是 |
ios/plist-orientations-present | ios | UISupportedInterfaceOrientations 已声明 | 是 |
ios/plist-display-name | ios | 显示名称已设置 | 是 |
ios/plist-background-modes-sanity | ios | UIBackgroundModes 值看起来是有效的 | 是 |
ios/xcode-deployment-target-capacitor | ios | iOS 部署目标满足 Capacitor 要求 | 是 |
ios/xcode-signing-team | ios | 签名团队已设置 | 是 |
ios/xcode-bundle-id-mismatch-across-configs | ios | Xcode配置中的Bundle id保持一致 | 是 |
ios/xcode-enable-bitcode-leftover | ios | ENABLE_BITCODE残余项已删除 | 是 |
ios/xcode-swift-version-sanity | ios | Swift版本设置看起来正常 | 是 |
ios/xcode-no-app-target | ios | Xcode项目中有一个应用程序目标 | 是 |
ios/xcode-multiple-app-targets | ios | 有意为之处理多个app目标 | 是 |
ios/entitlements-vs-profile-capability | ios | 特权与配置文件能力匹配 | 是 |
ios/entitlements-aps-environment-vs-mode | ios | aps-environment与发布模式匹配 | 是 |
ios/entitlements-associated-domains-format | ios | 关联域名格式有效 | 是 |
ios/entitlements-app-groups-format | ios | App Groups 格式是有效的 | 是 |
ios/capacitor-server-url-shipped | ios | server.url 不应留作 live-reload / remote shell 端点以便于商店构建 | 是 |
ios/capacitor-server-cleartext | ios | server.cleartext 在生产环境中不应启用 | 是 |
ios/capacitor-allow-navigation-wildcard | ios | server.allowNavigation 不应作为通配符 | 是 |
ios/pods-not-installed | ios | 使用 Pods 时 CocoaPods Pods / workspace 会出现 | 是 |
ios/pods-lock-missing | ios | Podfile.lock 会锁定 pod 的版本 | 是 |
ios/pods-capacitor-missing | ios | Podfile 会连接 Capacitor | 是 |
ios/spm-package-resolved-missing | ios | SPM Package.resolved 会出现 | Yes |
ios/spm-capacitor-dependency-missing | iOS | Package.swift声明了Capacitor | Yes |
ios/appicon-empty-or-placeholder | iOS | AppIcon.appiconset存在且不为空 | Yes |
ios/appicon-referenced-file-missing | iOS | Contents.json图标文件存在于磁盘上 | Yes |
ios/appicon-marketing-missing | iOS | 1024×1024的营销图标存在 | 是 |
ios/spm-deployment-target-consistency | ios | SPM 部署目标一致 | 是 |
Android
Android 部分| Id | 平台 | 它检查什么 | 逐渐强制 |
|---|---|---|---|
android/keystore-opens | android | 使用提供的密码打开 Android 密钥库 | — |
android/keystore-expiry | 安卓 | 安卓签名证书未过期 | — |
android/cordova-vars-present | 安卓 | cordova.variables.gradle存在于cap同步后 | — |
android/gradle-props-heuristics | 安卓 | gradle.properties对常见构建错误的猜测 | — |
android/play-sa-json | 安卓 | 配置了Play服务账户JSON时存在 | — |
android/flavor-exists | 安卓 | 请求的产品风味存在 | — |
android/agp8-package-attr | 安卓 | AGP 8+后Manifest包名属性被移除 | — |
android/manifest-well-formed | 安卓 | AndroidManifest.xml解析 | — |
android/manifest-tag-typo | 安卓 | 常见的Android清单标签错误 | — |
android/manifest-namespace-uri | 安卓 | xmlns:android命名空间URI正确 | — |
android/manifest-missing-prefix | 安卓 | Android属性使用android:前缀 | — |
android/manifest-exported-missing | 安卓 | android:exported在需要的地方设置 | — |
android/manifest-multiple-uses-sdk | 安卓 | 只有一个uses-sdk元素 | — |
android/manifest-duplicate-component | __CAPGO_KEEP_0__ | 不允许重复组件 | — |
android/manifest-unique-permission | __CAPGO_KEEP_0__ | 自定义权限是独特的 | — |
android/manifest-hardcoded-debuggable | __CAPGO_KEEP_0__ | debuggable=true 不会被发布 | — |
android/manifest-mock-location | __CAPGO_KEEP_0__ | ACCESS_MOCK_LOCATION 不会被发布 | — |
android/manifest-exported-unprotected | __CAPGO_KEEP_0__ | 导出的组件是受保护的 | — |
android/manifest-query-all-packages | __CAPGO_KEEP_0__ | QUERY_ALL_PACKAGES 的合理化 | — |
android/manifest-deeplink-valid | android | Deeplink intent-filters look valid | — |
android/applicationid-present | android | applicationId is declared in app/build.gradle | — |
android/capacitor-build-gradle-applied | android | capacitor.build.gradle exists when applied | — |
android/gradle-wrapper-present | android | Gradle wrapper files are present | — |
android/flavor-dimensions | android | Flavor dimensions are declared when flavors exist | — |
android/google-services-file | android | google-services.json present when plugin applied | — |
android/local-properties-committed | android | 本地 properties 文件未包含机密信息 | — |
android/sdk-floors | android | min/compile/target SDK 层面看起来有效 | — |
android/target-sdk-play | android | targetSdk 满足 Play 要求 | — |
android/min-sdk-capacitor | android | minSdk 满足 Capacitor 要求 | — |
android/version-fields | android | versionCode / versionName 有值 | — |
android/play-sa-access | android | Play 服务帐户可以访问应用 (远程) | — |
目标语言:简体中文
示例:远程 Next.js / server.url shell标题:示例:远程 Next.js / server.url shell server.url is a supported Capacitor pattern. Prescan flags ios/capacitor-server-url-shipped 是一个受支持的 __CAPGO_KEEP_0__ 模式。
预扫描标志
npx @capgo/cli@latest build request <appId> --platform ios \ --prescan-skip ios/capacitor-server-url-shipped终端窗口
npx @capgo/cli@latest build request <appId> --platform ios \ --prescan-warn ios/capacitor-server-url-shipped