react-native-mobile-devops by allen-hsu/arsenal
npx skills add https://github.com/allen-hsu/arsenal --skill react-native-mobile-devops使用 EAS (Expo Application Services) 和 Fastlane 自动化移动应用构建、提交和无线更新的专家指南。
| 服务 | 用途 |
|---|---|
| EAS Build | iOS 和 Android 的云端构建 |
| EAS Submit | 自动提交到 App Store / Play Store |
| EAS Update | 无线 (OTA) JavaScript 更新 |
| EAS Workflows | 使用 YAML 配置的 CI/CD 流水线 |
| Fastlane | 额外的自动化功能(截图、元数据、证书) |
# 安装 EAS CLI
npm install -g eas-cli
# 登录 Expo 账户
eas login
# 在您的项目中初始化 EAS
eas init
# 配置构建配置文件
eas build:configure
完整配置请参阅 references/eas-json.md。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
{
"cli": {
"version": ">= 16.3.0",
"appVersionSource": "remote"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal",
"channel": "preview"
},
"production": {
"channel": "production",
"autoIncrement": true
}
},
"submit": {
"production": {}
}
}
创建 .eas/workflows/build.yml:
name: 构建应用
on:
push:
branches: [main]
jobs:
build_android:
name: 构建 Android
type: build
params:
platform: android
profile: production
build_ios:
name: 构建 iOS
type: build
params:
platform: ios
profile: production
手动运行:
eas workflow:run .eas/workflows/build.yml
完整语法请参阅 references/eas-workflows.md。
name: 工作流名称
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
environment:
type: choice
options: [staging, production]
jobs:
job_id:
name: 显示名称
type: build | submit | update | fingerprint | get-build
needs: [other_job]
if: ${{ condition }}
environment: production
params:
platform: android | ios
profile: production
| 类型 | 描述 | 关键参数 |
|---|---|---|
build | 构建应用二进制文件 | platform, profile |
submit | 提交到应用商店 | build_id, profile |
update | 发布 OTA 更新 | branch, channel, platform |
fingerprint | 生成本地指纹 | environment |
get-build | 查找现有构建 | fingerprint_hash, profile |
maestro | 运行 E2E 测试 | build_id, flow_path |
slack | 发送 Slack 通知 | webhook_url, message |
name: 部署到生产环境
on:
push:
branches: [main]
jobs:
# 检查本地代码是否更改
fingerprint:
name: 生成指纹
type: fingerprint
environment: production
# 查找现有的兼容构建
get_android_build:
name: 检查 Android 构建
needs: [fingerprint]
type: get-build
params:
fingerprint_hash: ${{ needs.fingerprint.outputs.android_fingerprint_hash }}
profile: production
get_ios_build:
name: 检查 iOS 构建
needs: [fingerprint]
type: get-build
params:
fingerprint_hash: ${{ needs.fingerprint.outputs.ios_fingerprint_hash }}
profile: production
# 仅在没有兼容构建时进行构建
build_android:
name: 构建 Android
needs: [get_android_build]
if: ${{ !needs.get_android_build.outputs.build_id }}
type: build
params:
platform: android
profile: production
build_ios:
name: 构建 iOS
needs: [get_ios_build]
if: ${{ !needs.get_ios_build.outputs.build_id }}
type: build
params:
platform: ios
profile: production
# 将新构建提交到商店
submit_android:
name: 提交到 Play Store
needs: [build_android]
type: submit
params:
build_id: ${{ needs.build_android.outputs.build_id }}
submit_ios:
name: 提交到 App Store
needs: [build_ios]
type: submit
params:
build_id: ${{ needs.build_ios.outputs.build_id }}
# 如果构建存在,则发布 OTA 更新
update_android:
name: Android OTA 更新
needs: [get_android_build]
if: ${{ needs.get_android_build.outputs.build_id }}
type: update
params:
branch: production
platform: android
update_ios:
name: iOS OTA 更新
needs: [get_ios_build]
if: ${{ needs.get_ios_build.outputs.build_id }}
type: update
params:
branch: production
platform: ios
# 为特定平台构建
eas build --platform ios --profile production
eas build --platform android --profile preview
eas build --platform all --profile development
# 构建并自动提交
eas build --platform ios --auto-submit
# 本地构建(实验性)
eas build --platform android --local
# 列出构建
eas build:list
# 查看构建详情
eas build:view [BUILD_ID]
# 取消构建
eas build:cancel [BUILD_ID]
# 提交最新构建
eas submit --platform ios --latest
eas submit --platform android --latest
# 提交特定构建
eas submit --platform ios --id [BUILD_ID]
# 提交本地文件
eas submit --platform android --path ./app.aab
# 发布更新
eas update --branch production --message "Bug fixes"
# 发布到特定渠道
eas update --channel preview --message "New feature"
# 列出更新
eas update:list --branch production
# 回滚(重新发布先前的更新)
eas update:republish --group [UPDATE_GROUP_ID]
# 运行工作流
eas workflow:run .eas/workflows/deploy.yml
# 验证工作流
eas workflow:validate .eas/workflows/deploy.yml
# 列出工作流运行记录
eas workflow:runs
# 查看工作流日志
eas workflow:logs [WORKFLOW_ID]
# 取消工作流
eas workflow:cancel [WORKFLOW_ID]
渠道 分支 环境
─────────────────────────────────────────────
development → development → 开发构建
preview → preview → 内部测试
staging → staging → QA / Beta
production → production → App Store / Play Store
{
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"channel": "development"
},
"preview": {
"distribution": "internal",
"channel": "preview"
},
"staging": {
"distribution": "internal",
"channel": "staging"
},
"production": {
"channel": "production",
"autoIncrement": true
}
}
}
# 交互式凭证设置
eas credentials --platform ios
# 凭证包括:
# - 分发证书
# - 配置文件
# - 推送通知密钥
# - App Store Connect API 密钥(用于提交)
# 交互式凭证设置
eas credentials --platform android
# 凭证包括:
# - Keystore(上传密钥或旧版应用签名密钥)
# - Google 服务账户(用于提交)
# 设置密钥
eas secret:create --name API_KEY --value "your-secret-key" --scope project
# 列出密钥
eas secret:list
# 删除密钥
eas secret:delete API_KEY
{
"build": {
"production": {
"env": {
"API_URL": "https://api.production.com",
"SENTRY_DSN": "@SENTRY_DSN"
}
}
}
}
Fastlane 模式请参阅 references/fastlane.md。
defaults:
tools:
fastlane: 2.224.0
jobs:
screenshots:
runs_on: macos-large
steps:
- uses: eas/checkout
- name: 捕获截图
run: fastlane screenshots
working_directory: ./ios
每周安装次数
1
代码仓库
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Expert guidance for automating mobile app builds, submissions, and over-the-air updates using EAS (Expo Application Services) and Fastlane.
| Service | Purpose |
|---|---|
| EAS Build | Cloud builds for iOS and Android |
| EAS Submit | Automated submission to App Store / Play Store |
| EAS Update | Over-the-air (OTA) JavaScript updates |
| EAS Workflows | CI/CD pipelines with YAML configuration |
| Fastlane | Additional automation (screenshots, metadata, certificates) |
# Install EAS CLI
npm install -g eas-cli
# Login to Expo account
eas login
# Initialize EAS in your project
eas init
# Configure build profiles
eas build:configure
See references/eas-json.md for complete configuration.
{
"cli": {
"version": ">= 16.3.0",
"appVersionSource": "remote"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal",
"channel": "preview"
},
"production": {
"channel": "production",
"autoIncrement": true
}
},
"submit": {
"production": {}
}
}
Create .eas/workflows/build.yml:
name: Build Apps
on:
push:
branches: [main]
jobs:
build_android:
name: Build Android
type: build
params:
platform: android
profile: production
build_ios:
name: Build iOS
type: build
params:
platform: ios
profile: production
Run manually:
eas workflow:run .eas/workflows/build.yml
See references/eas-workflows.md for complete syntax.
name: Workflow Name
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
environment:
type: choice
options: [staging, production]
jobs:
job_id:
name: Display Name
type: build | submit | update | fingerprint | get-build
needs: [other_job]
if: ${{ condition }}
environment: production
params:
platform: android | ios
profile: production
| Type | Description | Key Params |
|---|---|---|
build | Build app binary | platform, profile |
submit | Submit to app stores | build_id, profile |
update | Publish OTA update | branch, , |
name: Deploy to Production
on:
push:
branches: [main]
jobs:
# Check if native code changed
fingerprint:
name: Fingerprint
type: fingerprint
environment: production
# Look for existing compatible build
get_android_build:
name: Check Android Build
needs: [fingerprint]
type: get-build
params:
fingerprint_hash: ${{ needs.fingerprint.outputs.android_fingerprint_hash }}
profile: production
get_ios_build:
name: Check iOS Build
needs: [fingerprint]
type: get-build
params:
fingerprint_hash: ${{ needs.fingerprint.outputs.ios_fingerprint_hash }}
profile: production
# Build only if no compatible build exists
build_android:
name: Build Android
needs: [get_android_build]
if: ${{ !needs.get_android_build.outputs.build_id }}
type: build
params:
platform: android
profile: production
build_ios:
name: Build iOS
needs: [get_ios_build]
if: ${{ !needs.get_ios_build.outputs.build_id }}
type: build
params:
platform: ios
profile: production
# Submit new builds to stores
submit_android:
name: Submit to Play Store
needs: [build_android]
type: submit
params:
build_id: ${{ needs.build_android.outputs.build_id }}
submit_ios:
name: Submit to App Store
needs: [build_ios]
type: submit
params:
build_id: ${{ needs.build_ios.outputs.build_id }}
# Publish OTA update if build exists
update_android:
name: OTA Update Android
needs: [get_android_build]
if: ${{ needs.get_android_build.outputs.build_id }}
type: update
params:
branch: production
platform: android
update_ios:
name: OTA Update iOS
needs: [get_ios_build]
if: ${{ needs.get_ios_build.outputs.build_id }}
type: update
params:
branch: production
platform: ios
# Build for specific platform
eas build --platform ios --profile production
eas build --platform android --profile preview
eas build --platform all --profile development
# Build with auto-submit
eas build --platform ios --auto-submit
# Local build (experimental)
eas build --platform android --local
# List builds
eas build:list
# View build details
eas build:view [BUILD_ID]
# Cancel build
eas build:cancel [BUILD_ID]
# Submit latest build
eas submit --platform ios --latest
eas submit --platform android --latest
# Submit specific build
eas submit --platform ios --id [BUILD_ID]
# Submit local file
eas submit --platform android --path ./app.aab
# Publish update
eas update --branch production --message "Bug fixes"
# Publish to specific channel
eas update --channel preview --message "New feature"
# List updates
eas update:list --branch production
# Rollback (republish previous update)
eas update:republish --group [UPDATE_GROUP_ID]
# Run workflow
eas workflow:run .eas/workflows/deploy.yml
# Validate workflow
eas workflow:validate .eas/workflows/deploy.yml
# List workflow runs
eas workflow:runs
# View workflow logs
eas workflow:logs [WORKFLOW_ID]
# Cancel workflow
eas workflow:cancel [WORKFLOW_ID]
Channel Branch Environment
─────────────────────────────────────────────
development → development → Dev builds
preview → preview → Internal testing
staging → staging → QA / Beta
production → production → App Store / Play Store
{
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"channel": "development"
},
"preview": {
"distribution": "internal",
"channel": "preview"
},
"staging": {
"distribution": "internal",
"channel": "staging"
},
"production": {
"channel": "production",
"autoIncrement": true
}
}
}
# Interactive credentials setup
eas credentials --platform ios
# Credentials include:
# - Distribution Certificate
# - Provisioning Profile
# - Push Notification Key
# - App Store Connect API Key (for submit)
# Interactive credentials setup
eas credentials --platform android
# Credentials include:
# - Keystore (upload key or legacy app signing key)
# - Google Service Account (for submit)
# Set secret
eas secret:create --name API_KEY --value "your-secret-key" --scope project
# List secrets
eas secret:list
# Delete secret
eas secret:delete API_KEY
{
"build": {
"production": {
"env": {
"API_URL": "https://api.production.com",
"SENTRY_DSN": "@SENTRY_DSN"
}
}
}
}
See references/fastlane.md for Fastlane patterns.
defaults:
tools:
fastlane: 2.224.0
jobs:
screenshots:
runs_on: macos-large
steps:
- uses: eas/checkout
- name: Capture Screenshots
run: fastlane screenshots
working_directory: ./ios
Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
114,200 周安装
channelplatformfingerprint | Generate native fingerprint | environment |
get-build | Find existing build | fingerprint_hash, profile |
maestro | Run E2E tests | build_id, flow_path |
slack | Send Slack notification | webhook_url, message |