【问题标题】:Unable to install Xamarin watchOS app on device using automatic provisioning无法使用自动预配在设备上安装 Xamarin watchOS 应用
【发布时间】:2021-12-06 00:37:41
【问题描述】:

我正在尝试将 Xamarin watchOS 应用安装到使用 Visual Studio for Mac 自动预配的设备,但在 iPhone 上出现“此时无法安装此应用”错误。

我使用的是 macOS Big Sur (11.6)、Visual Studio for Mac (8.10.11)、SE (A2354) 上的 watchOS 8.0.1 和 iPhone 11 (iOS 15.0.2)。我已验证 iPhone 和手表已列在 Apple 开发人员中心的设备中,但我确实必须手动添加手表,因为 Xamarin 自动配置似乎没有选择它。

我可以通过单击运行按钮从 Visual Studio 安装和运行 iPhone 应用程序,但不会自动安装 watchOS 应用程序。手表应用程序在可用应用程序中可见,但单击“安装”按钮会导致“无法安装此应用程序...”错误。如果我在 VS for Mac 中选择 watchOS 项目并使用模拟器运行,模拟器上的一切都运行良好。如果尝试在我的 watchOS 设备上运行,安装失败并出现此错误:

     ApplicationVerificationFailed: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.3e2xzs/extracted/WatchOSApp.app : 0xe8008029 (The code signature version is no longer supported.)
error MT1006: Could not install the application '/Users/scottmetoyer/src/WatchApp/bin/iPhone/Debug/device-builds/iphone12.1-15.0.2/WatchApp.app' on the device 'iPhone': AMDeviceSecureInstallApplicationBundle returned: 0xe8008029.

是否有其他故障排除步骤或日志可供我查看以了解发生了什么?

【问题讨论】:

  • 您尝试过手动配置吗?这是link列出了所有可能的情况和相应的解决方案,它可能会有所帮助。

标签: xamarin watchos


【解决方案1】:

iOS 15/WatchOS 8 之后,必须使用最新的签名格式对应用进行签名。

见:https://developer.apple.com/documentation/xcode/using-the-latest-code-signature-format

您的所有 .app 文件都必须由 XCode 13 正确签名。但是,它似乎没有对捆绑在 iOS 应用程序内的 WatchOS .app 文件进行签名。

要验证它,您可以使用以下命令:

codesign -dvvvvv YourApp.app

您必须在捆绑包中的每个 .app 文件(iOS 应用、WatchOS 应用和 WatchOSExtension 应用)中执行该命令

  • 如果CodeDirectory v=20500 一切正常。
  • 如果CodeDirectory小于20400,必须辞职
  • 如果CodeDirectory 为20400 或更大,您必须检查页面大小下的哈希列表。

如果您处于最后一种情况,如果 -5 条目包含一个值并且 -7 不存在或为零,则您必须退出您的应用程序。

要退出您的应用程序,您必须解压缩最新的 ipa 并执行以下命令:

codesign -s "Your Codesign Identity" -f --preserve-metadata --generate-entitlement-der /path/to/MyApp.app

您必须退出捆绑包中的每个 .app(iOS、WatchOS 和 WatchOSExtension)。 对所有 .app 进行签名后,您必须将 /Payload 文件夹重新压缩为 ipa 文件。

总结一下:

unzip myApp.ipa -d ./signed
codesign -s "Your Codesign Identity" -f --preserve-metadata --generate-entitlement-der ./signed/Payload/MyApp.app/Watch/PlugIns/MyWatchAppWatchOSExtension.appex
codesign -s "Your Codesign Identity" -f --preserve-metadata --generate-entitlement-der ./signed/Payload/MyApp/Watch/MyWatchApp.app
./signed/Payload/MyApp.app/Watch/PlugIns/MyWatchAppWatchOSExtension.appex
codesign -s "Your Codesign Identity" -f --preserve-metadata --generate-entitlement-der ./signed/Payload/MyApp.app
cd signed
zip -q -r -y myApp-resigned.ipa ./Payload

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-06
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    相关资源
    最近更新 更多