将你的 Napacitor iOS 应用部署到 App Store
由于 Napacitor 应用本质上就是普通的 .NET MAUI 应用,其部署到 App Store 的方式与任何其他 MAUI iOS 应用一样。构建 iOS 应用需要 macOS 并安装 Xcode。
构建与发布
同步最新的 Web 构建,然后以 Release 配置构建并产出 .ipa:
npx nap sync
npx nap build --target ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64
要直接从 CLI 产出可分发的 .ipa,使用 dotnet publish:
dotnet publish maui/App.csproj -f net10.0-ios -c Release -p:RuntimeIdentifier=ios-arm64
.ipa 会写入 maui/bin/Release/net10.0-ios/ios-arm64/publish/。全部选项见 MAUI iOS 发布文档,包括通过 Xcode Organizer 的基于 archive 的发布。
签名
App Store 提交需要分发证书和 provisioning profile。在 maui/App.csproj 中配置:
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<CodesignKey>Apple Distribution: …</CodesignKey>
<CodesignProvision>MyAppDistribution</CodesignProvision>
<EnableCodeSigning>true</EnableCodeSigning>
</PropertyGroup>
应用所需的能力必须在 maui/Platforms/iOS/Entitlements.plist 中声明(见配置)。
提交
首先,查阅 Apple 官方文档 Submitting Apps to the App Store。为应用生成启动画面和图标的详情见这里。
提交前,如果你的应用使用了任何 required-reason API,请确保包含隐私清单。
用 Transporter 或 xcrun altool 上传 .ipa,或者从 Xcode 的 Organizer 归档并分发,然后完成 App Store Connect 的商店条目。