AppStoreConnect应用商店连接技能Skill AppStoreConnect

App Store Connect 技能是专为苹果应用商店(App Store)设计的一套自动化与管理系统。它集成了 App Store Connect API,提供从应用构建上传、元数据管理、TestFlight 内测分发、应用内购买配置到最终提交审核和发布管理的全流程解决方案。核心功能包括自动化脚本执行(如 xcrun、Fastlane)、多语言元数据管理、截图与预览视频处理、合规性检查以及发布策略配置。该技能旨在帮助 iOS 开发者、移动应用团队和 DevOps 工程师高效、规范地完成应用上架与迭代,提升应用商店优化(ASO)效果和发布效率。 关键词:App Store Connect, iOS 应用上架, 苹果应用商店, TestFlight 分发, 应用元数据管理, Fastlane 自动化, App Store API, 应用审核提交, 移动应用发布, ASO 优化

移动开发 0 次安装 0 次浏览 更新于 2/25/2026

名称: App Store Connect 描述: Apple App Store 提交与管理专业知识 版本: 1.0.0 类别: iOS 分发 标识符: app-store-connect 状态: 活跃

App Store Connect 技能

概述

此技能提供 Apple App Store 提交与管理的全面能力。它支持与 App Store Connect API 交互、元数据管理、TestFlight 分发以及应用生命周期管理。

允许的工具

  • bash - 执行 xcrun、altool 和 Transporter 命令
  • read - 分析应用元数据和配置文件
  • write - 生成元数据文件和 API 配置
  • edit - 更新应用商店元数据
  • glob - 搜索元数据和截图文件
  • grep - 在配置中搜索模式

能力

App Store Connect API

  1. API 认证

    • 配置 API 密钥和 JWT 令牌
    • 实现令牌刷新逻辑
    • 处理速率限制
    • 配置团队和发行者 ID
  2. 应用管理

    • 创建和管理应用记录
    • 配置应用功能
    • 管理 Bundle ID
    • 处理应用转移

构建管理

  1. 构建上传

    • 通过 Transporter 上传构建
    • 配置 altool 上传
    • 处理构建处理状态
    • 管理构建元数据
    • 配置 App Store Connect 上传
  2. 构建信息

    • 跟踪构建处理
    • 配置构建使用合规性
    • 管理出口合规性
    • 处理构建过期

TestFlight

  1. Beta 分发

    • 配置内部测试组
    • 管理外部 Beta 测试人员
    • 设置 Beta 构建分发
    • 处理 Beta 应用审核
    • 配置测试信息
  2. Beta 反馈

    • 收集崩溃报告
    • 管理反馈提交
    • 跟踪测试人员参与度
    • 分析 Beta 指标

元数据管理

  1. 应用信息

    • 配置应用名称和副标题
    • 设置主要和次要类别
    • 管理年龄分级
    • 配置隐私政策 URL
    • 设置支持与营销 URL
  2. 版本元数据

    • 编写描述和关键词
    • 管理“新功能”文本
    • 配置宣传文本
    • 处理版权信息
  3. 媒体资源

    • 上传应用截图
    • 配置应用预览视频
    • 管理应用图标
    • 处理不同设备尺寸

应用内购买

  1. IAP 配置
    • 创建消耗型产品
    • 配置订阅
    • 设置订阅组
    • 处理促销优惠
    • 配置介绍性定价

提交

  1. 审核提交

    • 提交至 App 审核
    • 处理审核备注
    • 配置演示账户
    • 管理审核附件
    • 跟踪审核状态
  2. 发布管理

    • 配置发布选项
    • 设置分阶段发布
    • 处理手动发布
    • 管理版本发布

目标流程

此技能与以下流程集成:

  • ios-appstore-submission.js - App Store 提交
  • beta-testing-setup.js - TestFlight 配置
  • app-store-optimization.js - ASO 元数据
  • automated-release-management.js - 发布自动化

依赖项

必需

  • Apple 开发者账户
  • App Store Connect 访问权限
  • Xcode(用于 Transporter)
  • 有效的签名证书

可选

  • Fastlane
  • App Store Connect API 密钥
  • Transporter 应用

配置

API 密钥设置

# 在 App Store Connect 中生成 API 密钥
# 用户和访问 > 密钥 > App Store Connect API

# 密钥文件结构
AuthKey_XXXXXXXXXX.p8

环境变量

# App Store Connect API
export APP_STORE_CONNECT_API_KEY_ID="XXXXXXXXXX"
export APP_STORE_CONNECT_API_ISSUER_ID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
export APP_STORE_CONNECT_API_KEY_PATH="./AuthKey_XXXXXXXXXX.p8"

# 替代方案:Base64 编码的密钥
export APP_STORE_CONNECT_API_KEY="$(cat AuthKey.p8 | base64)"

使用示例

使用 xcrun 上传构建

# 验证 IPA
xcrun altool --validate-app \
  --file ./build/MyApp.ipa \
  --type ios \
  --apiKey XXXXXXXXXX \
  --apiIssuer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

# 上传 IPA
xcrun altool --upload-app \
  --file ./build/MyApp.ipa \
  --type ios \
  --apiKey XXXXXXXXXX \
  --apiIssuer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Fastlane Deliver 配置

# fastlane/Deliverfile
app_identifier("com.example.myapp")
username("developer@example.com")

# 元数据
name({
  "en-US" => "My Awesome App",
  "es-ES" => "Mi Aplicacion Increible"
})

subtitle({
  "en-US" => "The best app ever",
  "es-ES" => "La mejor app del mundo"
})

# 关键词(逗号分隔)
keywords({
  "en-US" => "productivity,tasks,notes,todo",
  "es-ES" => "productividad,tareas,notas"
})

# URL
support_url("https://example.com/support")
marketing_url("https://example.com")
privacy_url("https://example.com/privacy")

# 应用审核信息
app_review_information(
  first_name: "John",
  last_name: "Doe",
  phone_number: "+1 555 555 5555",
  email_address: "review@example.com",
  demo_user: "demo@example.com",
  demo_password: "demo123",
  notes: "Demo account is pre-configured with sample data"
)

# 提交
submit_for_review(false)
automatic_release(false)
phased_release(true)

# 预检
precheck_include_in_app_purchases(false)

元数据目录结构

fastlane/metadata/
├── en-US/
│   ├── name.txt
│   ├── subtitle.txt
│   ├── description.txt
│   ├── keywords.txt
│   ├── release_notes.txt
│   ├── promotional_text.txt
│   ├── support_url.txt
│   ├── marketing_url.txt
│   └── privacy_url.txt
├── es-ES/
│   └── ... (相同结构)
├── review_information/
│   ├── first_name.txt
│   ├── last_name.txt
│   ├── phone_number.txt
│   ├── email_address.txt
│   ├── demo_user.txt
│   ├── demo_password.txt
│   └── notes.txt
├── copyright.txt
├── primary_category.txt
├── secondary_category.txt
└── trade_representative_contact_information/

截图目录

fastlane/screenshots/
├── en-US/
│   ├── iPhone 15 Pro Max-1_home.png
│   ├── iPhone 15 Pro Max-2_feature.png
│   ├── iPhone 15 Pro Max-3_settings.png
│   ├── iPhone 15 Pro-1_home.png
│   ├── iPad Pro (12.9-inch)-1_home.png
│   └── ...
└── es-ES/
    └── ...

App Store Connect API 使用

// 示例:使用 App Store Connect API 获取应用
import Foundation

struct AppStoreConnectClient {
    let keyId: String
    let issuerId: String
    let privateKey: String

    func generateToken() -> String {
        // 生成 JWT 令牌
        let header = ["alg": "ES256", "kid": keyId, "typ": "JWT"]
        let payload = [
            "iss": issuerId,
            "exp": Int(Date().addingTimeInterval(20 * 60).timeIntervalSince1970),
            "aud": "appstoreconnect-v1"
        ]
        // 使用 ES256 签名
        return jwt
    }

    func fetchApps() async throws -> [App] {
        let url = URL(string: "https://api.appstoreconnect.apple.com/v1/apps")!
        var request = URLRequest(url: url)
        request.setValue("Bearer \(generateToken())", forHTTPHeaderField: "Authorization")

        let (data, _) = try await URLSession.shared.data(for: request)
        let response = try JSONDecoder().decode(AppsResponse.self, from: data)
        return response.data
    }
}

TestFlight 配置

# fastlane/Fastfile
lane :beta do
  # 构建
  gym(scheme: "MyApp")

  # 上传至 TestFlight
  pilot(
    skip_waiting_for_build_processing: false,
    distribute_external: true,
    notify_external_testers: true,

    # Beta 组
    groups: ["Internal Testers", "External Beta"],

    # 更新日志
    changelog: "Bug fixes and performance improvements",

    # Beta 应用审核
    beta_app_review_info: {
      contact_email: "review@example.com",
      contact_first_name: "John",
      contact_last_name: "Doe",
      contact_phone: "+1 555 555 5555",
      demo_account_name: "demo@example.com",
      demo_account_password: "demo123",
      notes: "Testing instructions here"
    },

    # 本地化信息
    localized_build_info: {
      "en-US" => {
        whats_new: "Bug fixes and improvements"
      },
      "es-ES" => {
        whats_new: "Correcciones y mejoras"
      }
    }
  )
end

应用内购买配置

{
  "iaps": [
    {
      "product_id": "com.example.premium_monthly",
      "type": "auto_renewable_subscription",
      "reference_name": "Premium Monthly",
      "subscription_group": "Premium",
      "pricing": [
        {
          "country": "USA",
          "price_tier": 4
        }
      ],
      "localizations": [
        {
          "locale": "en-US",
          "name": "Premium Monthly",
          "description": "Unlock all premium features"
        }
      ]
    }
  ]
}

质量门控

提交准备就绪

  • 所有必需元数据完整
  • 所有所需尺寸的截图
  • 隐私政策 URL 有效
  • 年龄分级已配置
  • 应用审核信息完整

构建要求

  • 有效的代码签名
  • 无缺失的授权
  • 出口合规性已配置
  • 构建处理成功

合规性

  • 应用隐私问卷完成
  • IDFA 使用已声明
  • 第三方代码已披露

相关技能

  • fastlane-cicd - 构建自动化
  • swift-swiftui - iOS 开发
  • mobile-security - 应用安全

版本历史

  • 1.0.0 - 初始版本,支持 App Store Connect API