This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
通过 TestFlight 分发 iOS 应用
了解如何通过 TestFlight 将 iOS 版本推送到测试人员的设备,以及何时使用内部测试和外部 TestFlight 测试。
TestFlight 是苹果的内部和测试版应用分发服务。在你创建 iOS 正式版本后,你的应用可以通过 TestFlight 到达测试者的设备,在应用正式在 App Store 上发布之前。
测试有两种类型,它们的区别决定了你的应用多快能到达用户手中。内部测试只针对你自己的 App Store Connect 团队,一旦构建处理完成就可以使用。外部测试则面向其他人。但你需要在 App Store Connect 里把构建加入一个测试组,而且该组的第一个构建必须通过苹果的 Beta 应用审查流程。
🌐 There are two kinds of testing and the difference decides how quickly your build reaches your app users. Internal testing goes to your own App Store Connect team and is available as soon as the build finishes processing. External testing reaches anyone else. However, you have to add the build to a group in App Store Connect, and the group's first build must clear Apple's Beta App Review process.
4 要求
4 要求
1.
提交应用到 Apple App Store 需要付费的 Apple 开发者账号。请在 Apple 开发者门户 注册。
2.
eas submit 会在你提交第一个构建时自动在 App Store Connect 上创建一个应用记录。你也可以在 App Store Connect 中点击 创建应用 来创建应用。或者,使用 App Store Connect API 以编程方式创建应用记录,或者在 eas.json 的 submit 配置文件中设置 ascAppId 来跳过创建应用记录。
3.
4.
测试人员需要在他们的 iOS 设备上安装 TestFlight 应用 才能安装和测试你的应用。
快速开始
🌐 Quick start
如果你有一个 Apple 开发者账号,但还没设置其他任何东西,你可以在 App Store Connect 上创建一个应用记录,构建一个生产用 .ipa,然后用一个命令提交到 TestFlight:
🌐 If you have an Apple Developer account and nothing else set up yet, you can create an app record on App Store Connect, build a production .ipa, and submit it to TestFlight with a single command:
上述命令会创建你的凭证,在 EAS Build 上运行生产构建,并通过 TestFlight 提交内部测试。这是使用 EAS CLI 一步完成构建和提交的简写方式。
🌐 The above command creates your credentials, runs a production build on EAS Build, and submits it for internal testing via TestFlight. It is a shorthand for building and submitting in one step with EAS CLI.
[--auto-submit](/build/automate-submissions/) 标志会自动将完成的构建交给 EAS Submit。你也可以把构建和提交分开执行。如果你已经有了生产构建,就不需要重新构建。可以直接提交现有的构建:
🌐 The --auto-submit flag hands the finished build off to EAS Submit automatically. You can also build and submit as separate steps. If you already have a production build, a rebuild isn't necessary. Submit the existing build directly:
指南的其余部分会更详细地讲内部和外部测试。
🌐 The rest of the guide covers internal and external testing in more detail.
内部测试与外部测试
🌐 Internal versus external testing
在你可以在苹果 App Store 上公开发布你的应用之前,你可以通过 TestFlight 以两种方式将它分发给测试人员:内部测试 和 外部测试。它们的区别在于你的构建版本到达测试人员的速度不同:
🌐 Before you can publicly release your app on the Apple App Store, you can distribute it to testers through TestFlight in two ways: Internal testing and External testing. The difference is how quickly your build reaches your testers:
警告 内部分发不是内部测试。这两个术语听起来完全一样。EAS 内部分发 会生成一个 临时或企业签名的版本,可以通过 URL 安装,并且仅限注册的唯一设备标识符 (UDID)。TestFlight 内部测试需要
"distribution": "store",并通过 Apple 进行。
建立内部测试
🌐 Set up internal testing
内部测试会发送给你自己的 App Store Connect 团队,并在构建处理完成后立即可用。
🌐 Internal testing goes to your own App Store Connect team and is available as soon as the build finishes processing.
1
2
等待处理
🌐 Wait for processing
苹果会在应用可以分发之前处理构建。这通常需要 5 到 10 分钟,不过没有保证的时间。处理完成后,苹果会通过邮件通知你。
🌐 Apple processes the build before it can be distributed. This usually takes 5 to 10 minutes, though there is no guaranteed time. After processing, Apple notifies you by email.
在你的应用被处理后,登录 App Store Connect,选择你的应用,然后进入 TestFlight。你应该能在 iOS 构建 下看到这个版本。
🌐 After your app is processed, log in to App Store Connect, select your app, and go to TestFlight. You should see the build listed under iOS Builds.
3
创建一个内部测试小组
🌐 Create an internal testing group
信息 如果你已经有内部测试组,可以跳过这一步。你也可以将测试人员添加到现有的组里。
在 App Store Connect 中,进入 TestFlight > 点击 内部测试 旁的加号(+)图标 > 输入 内部组 的名称 > 点击 创建。
🌐 In App Store Connect, go to TestFlight > click the plus (+) icon next to Internal Testing > enter the name of the Internal Group > click Create.
然后,点击 Testers 旁边的加号(+)图标,将测试人员添加到组中。你可以通过选择他们的邮箱并点击 Add,从你的 App Store Connect 团队中添加测试人员。测试人员会收到一封测试你应用的邀请邮件。
🌐 Then, click the plus (+) icon next to Testers to add testers to the group. You can add testers from your App Store Connect team by selecting their emails and clicking Add. Testers will receive an email invitation to test your app.
4
信息 提示:如果你已经有现成的内部测试组,也可以直接从 EAS CLI 针对内部组进行操作。例如,命令
eas submit --platform ios --groups "QA Team" --what-to-test "New onboarding flow"会针对名为“QA 团队”的内部测试组,并为构建设置“测试内容”的描述。
设置外部测试
🌐 Set up external testing
外部测试可以让 App Store Connect 团队以外的人参与。
🌐 External testing reaches people outside your App Store Connect team.
警告 你必须先创建一个 内部 群组,App Store Connect 才会允许你创建 外部 群组。
1
2
3
填写测试信息
🌐 Fill in test information
外部测试需要在 Apple 批准构建进行审核之前提供测试版应用描述和反馈邮箱。如果你的应用有登录功能,请启用 登录信息 并提供一个 Apple 可以使用的测试账户。点击 下一步。
🌐 External testing requires a beta app description and a feedback email before Apple accepts the build for review. If your app has a login, enable Sign-in Information and provide a test account for Apple to use. Click Next.
4
5
常见问题
🌐 FAQs
我需要用 Mac 才能通过 TestFlight 分发应用吗?
不,两者 eas build 和 eas submit 都可以在 macOS、Linux 和 Windows 上运行。构建是在 EAS Build 基础设施上进行的,而 EAS Submit 会帮你把 .ipa 上传到 App Store Connect。
🌐 No. Both eas build and eas submit run on macOS, Linux, and Windows. The build runs on EAS Build infrastructure and EAS Submit uploads the .ipa to App Store Connect for you.
我需要新的版本才能从内部测试转到外部测试吗?
不。把已经在 App Store Connect 里的版本加到一个外部测试组,然后提交进行 Beta App 审核。只有当应用本身有改动时才需要新的版本。
🌐 No. Add the build that is already in App Store Connect to an external group and submit it for Beta App Review. You only need a new build when the app itself changes.
为什么队友不能把一个构建添加到外部组?
他们的 App Store Connect 角色不允许这样做。开发者 或 市场营销 角色可以管理内部测试,但外部测试需要 账户持有人、管理员 或 应用管理员。
🌐 Their App Store Connect role does not allow it. A Developer or Marketing role can manage internal testing but not external testing, which requires Account Holder, Admin, or App Manager.
相同的限制也适用于凭证。只有账户持有人或管理员可以创建 EAS Submit 使用的 App Store Connect API 密钥。完整的权限矩阵请参见 Apple 开发者计划角色和权限。
🌐 The same restriction applies to credentials. Only an Account Holder or Admin can create the App Store Connect API key that EAS Submit uses. See Apple Developer Program roles and permissions for the complete matrix.
TestFlight 版本会在 App Store 上发布吗?
不行。发布到 App Store 是一个单独的提交,需要你在 App Store Connect 上手动开始。TestFlight 里的版本会一直在 TestFlight 上。
🌐 No. Releasing to the App Store is a separate submission that you start manually in App Store Connect. A build in TestFlight stays in TestFlight.
发布后测试也不会停止。如果你在应用上线 App Store 前没有让一个版本过期,那么已经收到邀请的测试者可以继续测试它。要停止他们的测试,进入 TestFlight > 选择该版本 > 过期版本。
🌐 Testing also does not stop when you release. If you do not expire a build before it goes live on the App Store, testers who already have an invitation can keep testing it. To stop them, go to TestFlight > select the build > Expire Build.
为什么我的构建卡在“缺少合规性”了?
App Store Connect 正在等待你对出口合规问题的回答,在你回答之前无法将构建版本分发给测试人员。与你其每次上传都回答,不如在你的应用配置中回答一次:
🌐 App Store Connect is waiting for an answer to the export compliance question and cannot distribute the build to testers until you answer it. Instead of answering it on every upload, answer it once in your app config:
只有在你的应用不使用 Apple 允许以外的加密(例如通过操作系统的 HTTPS)时,才将 usesNonExemptEncryption 设置为 false。这个声明同样适用于你的应用所链接的第三方库,并且它不仅适用于 App Store 发布,也适用于 TestFlight 构建。
🌐 Set usesNonExemptEncryption to false only when your app uses no encryption beyond what Apple exempts, such as HTTPS through the operating system. The declaration also covers third-party libraries your app links against, and it applies to TestFlight builds, not only App Store releases.
我可以通过命令行把一个版本添加到 TestFlight 群组吗?
是的,适用于内部组。使用现有内部组的名称传入 --groups,并使用 --what-to-test 来设置测试备注:
🌐 Yes, for internal groups. Pass --groups with the name of an existing internal group and use --what-to-test to set the test notes:
--groups 只接受 内部 群组名称。要将构建添加到外部群组,请使用 EAS 工作流。
我可以把构建自动分发给外部团队吗?
是的,通过 EAS 工作流程中的预打包 testflight 作业。它会向内部和外部组添加一个构建,设置“测试内容”注意,并提交 Beta 应用审核:
🌐 Yes, with the pre-packaged testflight job in EAS Workflows. It adds a build to internal and external groups, sets the "What to Test" notes, and submits for Beta App Review:
submit_beta_review 在提供 external_groups 时默认为 true。在你用外部群体运行任务之前,先在 App Store Connect 中完成 TestFlight 测试信息。