簡體   English   中英

在物理iOS設備上運行的Xcode 6運行測試不起作用

[英]Xcode 6 running tests on physical iOS device does not work

我在物理設備上運行單元測試目標時遇到問題(我的iPhone 6為iOS 8.1)。 為此,我創建了一個全新的iOS Xcode項目,將其打開並使用Cmd + U(產品->測試)運行測試。 該應用程序編譯成功,並要求我提供代碼簽名憑據。 該應用程序甚至在設備上打開。 到此為止一切都很好。

但是測試永遠不會運行,並且Xcode在“測試”中停留了幾分鍾,然后最終退出:

*** Canceling tests due to timeout in Waiting for test process to check in...

控制台拋出一些代碼簽名錯誤或諸如此類:

2014-10-30 08:54:12.585 Test[4721:1298810] Error loading /private/var/mobile/Containers/Data/Application/B727E18E-48BC-4A7E-BDBA-19157ED5A4AC/tmp/TestTests.xctest/TestTests: 

dlopen(/private/var/mobile/Containers/Data/Application/B727E18E-48BC-4A7E-BDBA-19157ED5A4AC/tmp/TestTests.xctest/TestTests, 262): no suitable image found.
Did find: /private/var/mobile/Containers/Data/Application/B727E18E-48BC-4A7E-BDBA-19157ED5A4AC/tmp/TestTests.xctest/TestTests: 

code signature invalid for '/private/var/mobile/Containers/Data/Application/B727E18E-48BC-4A7E-BDBA-19157ED5A4AC/tmp/TestTests.xctest/TestTests'
DevToolsBundleInjection: Error loading bundle '/private/var/mobile/Containers/Data/Application/B727E18E-48BC-4A7E-BDBA-19157ED5A4AC/tmp/TestTests.xctest'

我真的不明白,該應用程序已正確簽名,但是我猜想注入的測試庫不是。

有人知道如何解決此問題嗎? 還是這意味着我們僅限於在Simulator中進行測試?

我一直在測試的項目可以在我的GitHub上找到: https : //github.com/Legoless/StackOverflow/tree/master/Objective-C/TestTargetFailure

謝謝。

這是一個代碼簽名問題。

解決方案:轉到測試目標的構建設置,並確保設置了正確的(即與您的測試目標的捆綁ID匹配)Provisioning Profile和Code Signing Identity。 您可以為此生成通配符配置文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM