关于 Fastlane Expert
面向自动化 iOS 构建、测试和发布的团队的 Fastlane 技能,提供 TestFlight、App Store 发布、签名及 CI/CD 的 lane 示例。
主要功能
- 01TestFlight beta 发布 lane 示例
- 02App Store 发布自动化
- 03iOS 测试 lane 配置
- 04使用 match 进行代码签名
- 05与 GitHub Actions 集成
适用场景
- 01自动上传 beta 版到 TestFlight
- 02准备 App Store 发布
- 03通过 lane 运行 iOS 测试
- 04同步签名证书
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ willsigmon/ sigstack --skill fastlane-expert安装后在 Claude Code 中输入/fastlane-expert确认已加载。
详细介绍
Fastlane 自动化专家
使用 fastlane 自动化 iOS 构建、测试和部署。
设置
# Install
brew install fastlane
# Init in project
cd ios-project
fastlane init
Fastfile 模式
发布 Beta 版本到 TestFlight
# Fastfile
default_platform(:ios)
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
increment_build_number(xcodeproj: "App.xcodeproj")
build_app(scheme: "App")
upload_to_testflight(
skip_waiting_for_build_processing: true
)
end
end
发布到 App Store
lane :release do
capture_screenshots
build_app(scheme: "App")
upload_to_app_store(
submit_for_review: true,
automatic_release: true,
force: true,
skip_metadata: false,
skip_screenshots: false
)
end
测试 Lane
lane :test do
run_tests(
scheme: "AppTests",
devices: ["iPhone 15 Pro"],
code_coverage: true
)
end
App Store Connect API
# Appfile
app_identifier "com.example.app"
apple_id "[email protected]"
team_id "ABC123"
# API key auth (recommended)
# Store key file securely
lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] = app_store_connect_api_key(
key_id: "ABC123",
issuer_id: "def-456",
key_filepath: "./AuthKey.p8"
)
代码签名
Match(推荐)
lane :sync_certs do
match(
type: "appstore",
app_identifier: "com.example.app",
git_url: "[email protected]:org/certs.git"
)
end
lane :beta do
match(type: "appstore")
build_app(scheme: "App")
upload_to_testflight
end
CI/CD 集成
GitHub Actions
- name: Build and Upload
env:
APP_STORE_CONNECT_API_KEY: ${{ secrets.ASC_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: bundle exec fastlane beta
常见操作
build_app:构建 iOS 应用upload_to_testflight:分发 Beta 版本upload_to_app_store:发布正式版本match:同步代码签名snapshot:自动截取屏幕截图deliver:上传元数据/屏幕截图
适用场景:iOS 构建、TestFlight 上传、App Store 发布、CI/CD 自动化
评论
支持 Markdown