Xamarin:无法将存档上传到 AppStore

Xamarin: Unable to upload Archive to AppStore

Visual Studio 2019 (Windows) / Xamarin 4.7.0.968

我创建了一个 iOS 存档(没有错误)但是当我选择分发/AppStore 和 select 我已经在 Visual Studio 中设置的 ID/Profile ,我会按预期收到输入 ID/Password 的提示。但随后它因错误而失败:

AppStore bundle validation failed for archive MyApp.Mobile.iOS
"altool" exited with code 1.

有人知道哪里出了问题吗?

不幸的是,从 VS 上传没有给出上传失败的正确消息。为了调试它,您需要“手动”上传它。步骤是:

  1. Release 配置中构建您的项目
  2. 右键单击 iOS 项目和 select Show IPA file on Build Server
  3. A Finder window 将在 Mac 上打开,ipa 文件在 select 之前编辑
  4. 将文件复制到您可以轻松访问的某个位置(例如您的 Dekstop)
  5. 打开Terminal
  6. 写入以下命令:xcrun altool --upload-app --type ios --file "path/to/application.ipa" --username "YOUR_ITMC_USER" --password "YOUR_ITMC_PASSWORD"

如果您的应用程序在桌面上,路径将如下所示:~/Desktop/application.ipa,其中 application.ipa 是您的应用程序的名称。当然,您必须提供您的凭据而不是 YOUR_ITMC_USER & YOUR_ITMC_PASSWORD .

当您有 运行 这个命令时,请等待一两分钟。一段时间后,该工具会告诉您上传是否失败,如果是,原因是什么。

P.S。您也可以使用 GUI Transporter 应用程序,但我不知道它能为您提供多少更多信息。

these instructions 之后并使用 Visual Studio 2019 (16.7.1),上传到 App Store 对我不起作用。我总是

Errors
App Store bundle validation failed for archive XXX
"altool" exited with code 1
We are unable to create an authentication session.

Apple mentions三种上传方式:

  • Xcode
  • altool
  • 运输应用程序

最简单的方法是使用 Xcode。当您为 Release 构建并存档您的应用程序时(在 Windows 机器上的 VS 2019 中),您可以在 Xcode 中的 Mac 上执行此操作:Window > 组织者 > 档案 > 分发应用程序

我使用了 Transporter 应用程序,因为其他任何东西都不起作用。上传再次失败,但 Transporter 实际上显示了一个很大的错误消息...我的构建版本号必须在 Info.plist 中更新(哎呀!)。

更新版本号和 re-archiving 后,“分发”按钮按预期工作。

使用交通应用程序

  1. 从 App store 下载 Transport App(由 Apple 制作)并在 mac
  2. 上打开
  3. 在 Visual Studio
  4. 上以发布模式构建 iOS 项目
  5. Right-click Visual Studio 中的 iOS 项目和 在构建服务器上显示 IPA
    • 如果 在构建服务器上显示 IPA 是 greyed-out/disabled 直接导航到您 mac 上的文件...
      • 打开 Finder
      • 单击工具栏上的转到 > 转到文件夹...
      • 输入~/Library/Caches/Xamarin/mtbs/builds/
      • 继续导航到发布文件夹... {应用名称}/bin/{iPhone}/Release
      • 查找扩展名为 .ipa 的文件
  6. 将IPA文件拖入打开的Transporter应用
  7. 点击发送
  8. 如果失败,点击问题按钮查看原因

确保:

  1. 您使用应用专用密码。
  2. 确保 在 info.plist
  3. 中增加版本和内部版本号

使用 Windows 上的最新 VS 2019 和 Mac 上的 Xcode,在构建时显示 IPA 文件未突出显示,菜单栏中的图标也未突出显示。但是当我再次启动 VS 时,两者都被突出显示并且文件夹在执行时显示在 Mac 上。 VS 可能存在延迟问题,您需要重新启动它才能使该功能正常工作。

我在使用不正确的“应用专用密码”时收到这条(相当神秘的)错误消息。