无法调试/安装 Watch App Extension

Posted

技术标签:

【中文标题】无法调试/安装 Watch App Extension【英文标题】:Unable to Debug/Install Watch App Extension 【发布时间】:2016-11-25 04:18:17 【问题描述】:

我遇到这个问题已经有一段时间了,一直无法解决。大约 90% 的情况下,我的手表应用程序无法在设备上安装。该应用程序将显示安装完成大约 80%,然后失败并退出,在

中提供此错误

iPhone 调试日志控制台

<Error>: 0x4029b000 __106-[ACXCompanionSyncConnectioninstallWatchAppWithBundleID:withProvisioningProfileInfo:completionWithError:]_block_invoke_3: Failed to install app com.mea.AppName.watchkitapp : Error Domain=ACXErrorDomain Code=17 "Got error 17 in install done from remote side (MI error ApplicationVerificationFailed ; Extended 0xe8008017 ; Desc Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex : 0xe8008017 (A signed resource has been added, modified, or deleted.))" UserInfo=FunctionName=-[ACXServerInstallOperation receivedDictionaryOrData:], SourceFileLine=524, NSLocalizedDescription=Got error 17 in install done from remote side (MI error ApplicationVerificationFailed ; Extended 0xe8008017 ; Desc Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex : 0xe8008017 (A signed resource has been added, modified, or deleted.))

Watch Debug Log Console,抛出这些错误。

Verification stage failed
Jul 21 09:46:59 Andrews-AppleWatch appconduitd[104] <Error>: 0x1f084000 __MobileInstallationInstallForLaunchServices_block_invoke222: Returned error Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex : 0xe8008017 (A signed resource has been added, modified, or deleted.)" UserInfo=LibMISErrorNumber=-402620393, LegacyErrorString=ApplicationVerificationFailed, FunctionName=+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:], NSLocalizedDescription=Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex : 0xe8008017 (A signed resource has been added, modified, or deleted.), SourceFileLine=142

因为我在手表扩展中使用了这些 pod 框架(显然已经过修改)。

SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul 21 09:46:58 Andrews-AppleWatch installd[35] <Notice>: MIS: resource modified: /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex/Frameworks/Alamofire.framework/Alamofire
Jul 21 09:46:58 Andrews-AppleWatch installd[35] <Notice>: MIS: resource modified: /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex/Frameworks/Realm.framework/Realm
Jul 21 09:46:58 Andrews-AppleWatch installd[35] <Notice>: MIS: resource modified: /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex/Frameworks/RealmSwift.framework/RealmSwift
Jul 21 09:46:58 Andrews-AppleWatch installd[35] <Notice>: MIS: resource modified: /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.eC3skb/extracted/Payload/Watch.app/PlugIns/Watch Extension.appex/Frameworks/SwiftyJSON.framework/SwiftyJSON

现在,我知道这与代码签名有关(对吗?),但我该如何更新或验证正确的代码签名?

我看到其他人的产品名称中包含非字母/非数字符号也遇到了类似的问题,但是,我的产品名称是 AppNameWatch 和 AppNameWatch Extension。 Apple 使用 AppNameWatch 和 Extension 之间的空格字符生成扩展文件,所以我认为这很好,而不是问题的原因。

我也尝试过清理/重新构建/清理构建文件夹并删除派生数据。

任何帮助将不胜感激,谢谢。

编辑/更新:

看起来这是一个与 cocoapods 相关的问题。将我的所有框架移至 Carthage 管理后,该应用程序正在安装和运行,没有与修改资源相关的错误。

【问题讨论】:

【参考方案1】:

通过CocoaPods 更新我的项目以使用动态框架后,我遇到了同样的问题。我不得不去 WatchKit 扩展并将 Embedded Content Contains Swift Code 更改为 Yes。现在应用程序构建和安装正常。

【讨论】:

以上是关于无法调试/安装 Watch App Extension的主要内容,如果未能解决你的问题,请参考以下文章

Apple Watch 上安装的操作系统版本没有可用的调试符号

Apple Watch怎么使用安装APP应用程序

APP了 Watch的简单代码

如果显示 WKAlert,Watch App 在停用时终止

Vs2017 无法调试APP

将安装使用错误捆绑标识符“(null)”调用的 Watch App