expo-deployment

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Deployment

部署

This skill covers deploying Expo applications across all platforms using EAS (Expo Application Services).
本技能涵盖使用EAS(Expo Application Services)在全平台部署Expo应用。

References

参考资料

Consult these resources as needed:
  • ./references/workflows.md -- CI/CD workflows for automated deployments and PR previews
  • ./references/testflight.md -- Submitting iOS builds to TestFlight for beta testing
  • ./references/app-store-metadata.md -- Managing App Store metadata and ASO optimization
  • ./references/play-store.md -- Submitting Android builds to Google Play Store
  • ./references/ios-app-store.md -- iOS App Store submission and review process
按需查阅以下资源:
  • ./references/workflows.md -- 用于自动化部署和PR预览的CI/CD工作流
  • ./references/testflight.md -- 将iOS构建包提交至TestFlight进行Beta测试
  • ./references/app-store-metadata.md -- 管理App Store元数据及ASO优化
  • ./references/play-store.md -- 将Android构建包提交至Google Play Store
  • ./references/ios-app-store.md -- iOS App Store提交与审核流程

Quick Start

快速开始

Install EAS CLI

安装EAS CLI

bash
npm install -g eas-cli
eas login
bash
npm install -g eas-cli
eas login

Initialize EAS

初始化EAS

bash
npx eas-cli@latest init
This creates
eas.json
with build profiles.
bash
npx eas-cli@latest init
此命令会创建包含构建配置文件的
eas.json

Build Commands

构建命令

Production Builds

生产环境构建

bash
undefined
bash
undefined

iOS App Store build

iOS App Store构建包

npx eas-cli@latest build -p ios --profile production
npx eas-cli@latest build -p ios --profile production

Android Play Store build

Android Play Store构建包

npx eas-cli@latest build -p android --profile production
npx eas-cli@latest build -p android --profile production

Both platforms

同时构建两个平台

npx eas-cli@latest build --profile production
undefined
npx eas-cli@latest build --profile production
undefined

Submit to Stores

提交至应用商店

bash
undefined
bash
undefined

iOS: Build and submit to App Store Connect

iOS:构建并提交至App Store Connect

npx eas-cli@latest build -p ios --profile production --submit
npx eas-cli@latest build -p ios --profile production --submit

Android: Build and submit to Play Store

Android:构建并提交至Play Store

npx eas-cli@latest build -p android --profile production --submit
npx eas-cli@latest build -p android --profile production --submit

Shortcut for iOS TestFlight

iOS TestFlight快捷命令

npx testflight
undefined
npx testflight
undefined

Web Deployment

网页部署

Deploy web apps using EAS Hosting:
bash
undefined
使用EAS Hosting部署网页应用:
bash
undefined

Deploy to production

部署至生产环境

npx expo export -p web npx eas-cli@latest deploy --prod
npx expo export -p web npx eas-cli@latest deploy --prod

Deploy PR preview

部署PR预览版

npx eas-cli@latest deploy
undefined
npx eas-cli@latest deploy
undefined

EAS Configuration

EAS配置

Standard
eas.json
for production deployments:
json
{
  "cli": {
    "version": ">= 16.0.1",
    "appVersionSource": "remote"
  },
  "build": {
    "production": {
      "autoIncrement": true,
      "ios": {
        "resourceClass": "m-medium"
      }
    },
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    }
  },
  "submit": {
    "production": {
      "ios": {
        "appleId": "your@email.com",
        "ascAppId": "1234567890"
      },
      "android": {
        "serviceAccountKeyPath": "./google-service-account.json",
        "track": "internal"
      }
    }
  }
}
用于生产环境部署的标准
eas.json
json
{
  "cli": {
    "version": ">= 16.0.1",
    "appVersionSource": "remote"
  },
  "build": {
    "production": {
      "autoIncrement": true,
      "ios": {
        "resourceClass": "m-medium"
      }
    },
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    }
  },
  "submit": {
    "production": {
      "ios": {
        "appleId": "your@email.com",
        "ascAppId": "1234567890"
      },
      "android": {
        "serviceAccountKeyPath": "./google-service-account.json",
        "track": "internal"
      }
    }
  }
}

Platform-Specific Guides

平台专属指南

iOS

iOS

  • Use
    npx testflight
    for quick TestFlight submissions
  • Configure Apple credentials via
    eas credentials
  • See ./reference/testflight.md for credential setup
  • See ./reference/ios-app-store.md for App Store submission
  • 使用
    npx testflight
    快速提交至TestFlight
  • 通过
    eas credentials
    配置Apple凭据
  • 查看./reference/testflight.md了解凭据设置方法
  • 查看./reference/ios-app-store.md了解App Store提交流程

Android

Android

  • Set up Google Play Console service account
  • Configure tracks: internal → closed → open → production
  • See ./reference/play-store.md for detailed setup
  • 搭建Google Play Console服务账号
  • 配置发布渠道:internal → closed → open → production
  • 查看./reference/play-store.md了解详细设置步骤

Web

网页

  • EAS Hosting provides preview URLs for PRs
  • Production deploys to your custom domain
  • See ./reference/workflows.md for CI/CD automation
  • EAS Hosting为PR提供预览URL
  • 生产环境部署至自定义域名
  • 查看./reference/workflows.md了解CI/CD自动化配置

Automated Deployments

自动化部署

Use EAS Workflows for CI/CD:
yaml
undefined
使用EAS Workflows实现CI/CD:
yaml
undefined

.eas/workflows/release.yml

.eas/workflows/release.yml

name: Release
on: push: branches: [main]
jobs: build-ios: type: build params: platform: ios profile: production
submit-ios: type: submit needs: [build-ios] params: platform: ios profile: production

See ./reference/workflows.md for more workflow examples.
name: Release
on: push: branches: [main]
jobs: build-ios: type: build params: platform: ios profile: production
submit-ios: type: submit needs: [build-ios] params: platform: ios profile: production

查看./reference/workflows.md获取更多工作流示例。

Version Management

版本管理

EAS manages version numbers automatically with
appVersionSource: "remote"
:
bash
undefined
EAS通过
appVersionSource: "remote"
自动管理版本号:
bash
undefined

Check current versions

查看当前版本

eas build:version:get
eas build:version:get

Manually set version

手动设置版本

eas build:version:set -p ios --build-number 42
undefined
eas build:version:set -p ios --build-number 42
undefined

Monitoring

监控

bash
undefined
bash
undefined

List recent builds

列出近期构建记录

eas build:list
eas build:list

Check build status

查看构建状态

eas build:view
eas build:view

View submission status

查看提交状态

eas submit:list
undefined
eas submit:list
undefined