加载XCTest时出错,找不到合适的图像。

时间:2021-02-23 18:55:21

I have recently updated my Xcode and started having this error.

我最近更新了我的Xcode并开始出现此错误。

2014-11-03 15:03:54.222 App[13141:60b] Error loading /private/var/mobile/Applications/677127BD-5230-4D5F-B70E-AF728439D34B/tmp/AppTests.xctest/AppTests:  dlopen(/private/var/mobile/Applications/677127BD-5230-4D5F-B70E-AF728439D34B/tmp/AppTests.xctest/AppTests, 262): no suitable image found.  Did find:
    /private/var/mobile/Applications/677127BD-5230-4D5F-B70E-AF728439D34B/tmp/AppTests.xctest/AppTests: code signature invalid for '/private/var/mobile/Applications/677127BD-5230-4D5F-B70E-AF728439D34B/tmp/AppTests.xctest/AppTests'
DevToolsBundleInjection: Error loading bundle '/private/var/mobile/Applications/677127BD-5230-4D5F-B70E-AF728439D34B/tmp/AppTests.xctest'

I have done my Google search as usual. But I haven't found any solutions yet. Source I have looked and tried to resolve my issue with is,

我像往常一样完成了Google搜索。但我还没有找到任何解决方案。来源我看过并尝试解决我的问题是,

  1. http://marcschwieterman.com/blog/testing-in-the-sandbox/
  2. http://marcschwieterman.com/blog/testing-in-the-sandbox/

When it happens?

什么时候发生?

It only shows this error if I run uni test on device. On simulator it works as expected. Running application from normal target does not show this error.

如果我在设备上运行uni测试,它只显示此错误。在模拟器上它按预期工作。从正常目标运行应用程序不会显示此错误。

When error shows up while running Uni Test app does not crash. It just fails to load xctests.

运行Uni时出现错误测试应用程序不会崩溃。它只是无法加载xctests。

Anyone having similar issues? and manage to resolve it?

有类似问题的人吗?并设法解决它?

3 个解决方案

#1


34  

I've encountered exactly the same problem. I was able to fix the problem by setting the provisioning profile to something other than Automatic on both targets (the test and the test host).

我遇到了完全相同的问题。我能够通过在两个目标(测试和测试主机)上将配置文件设置为自动以外的其他内容来解决问题。

I verified this was the problem by reverting it back to automatic, and the problem reoccured.

我通过将其恢复为自动来验证这是问题,并且问题再次出现。

#2


1  

@tagy22's comment worked for me

@ tagy22的评论对我有用

Had this error, I had to set both targets provisioning profile to a wildcard profile.

如果出现此错误,我必须将两个目标配置文件设置为通配符配置文件。

#3


0  

I found that if I deleted all iOS developer certificates from OS X keychain and the iPhone developer portal, and then let Xcode re-request the development certificates, the problem is resolved.

我发现如果我从OS X keychain和iPhone开发人员门户删除了所有iOS开发人员证书,然后让Xcode重新请求开发证书,问题就解决了。

#1


34  

I've encountered exactly the same problem. I was able to fix the problem by setting the provisioning profile to something other than Automatic on both targets (the test and the test host).

我遇到了完全相同的问题。我能够通过在两个目标(测试和测试主机)上将配置文件设置为自动以外的其他内容来解决问题。

I verified this was the problem by reverting it back to automatic, and the problem reoccured.

我通过将其恢复为自动来验证这是问题,并且问题再次出现。

#2


1  

@tagy22's comment worked for me

@ tagy22的评论对我有用

Had this error, I had to set both targets provisioning profile to a wildcard profile.

如果出现此错误,我必须将两个目标配置文件设置为通配符配置文件。

#3


0  

I found that if I deleted all iOS developer certificates from OS X keychain and the iPhone developer portal, and then let Xcode re-request the development certificates, the problem is resolved.

我发现如果我从OS X keychain和iPhone开发人员门户删除了所有iOS开发人员证书,然后让Xcode重新请求开发证书,问题就解决了。