无法验证代码签名 WatchKit

Failed to verify code signature WatchKit

我正在尝试 运行 Apple Watch 上的 WatchKit 应用程序,但每次此消息都告诉我它无法验证代码签名:

companionappd[153] <Warning>: failed to install WatchKit application, error: (Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" 
UserInfo=0x15ddfba0 {Error=ApplicationVerificationFailed, 
ErrorDetail=-402620391, 
ErrorDescription=Failed to verify code signature of <MIExecutableBundle : 
path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.kD3tCX/extracted/com.**.**.watchkitapp.app 
identifier = com.**.**.watchkitapp type = 4> : 0xe8008019 
(Application signature not valid)})

但我已尝试撤销我当前的开发人员证书,为应用程序、WatchKit 扩展和 WatchKit 应用程序创建了一个新的配置文件。我还将 Apple Watch 设备 ID 放在这个配置文件中。

我删除了 mac 上的所有配置文件,重新加载了它。

我清理了项目,删除了派生数据。

我重新启动了 mac。

我已经这样做了:

还有这个:

我什么都做了!

是否有人遇到同样的问题并找到了解决方案? 我的下一步是对 mac、iPhone 和 Apple Watch 进行全新安装。但我想找到另一种解决方案! :)

谢谢!

我已经删除了所有 watchkit 目标(扩展和应用程序),并创建了一个新目标,现在可以使用了...

编辑

我发现是我的 运行 脚本之一(我不知道是哪一个)导致了这个问题。 这些脚本位于 Apple Watch 扩展目标上。现在我的脚本留在主应用程序的目标上!