2013-09-23 29 views
5

我所做的一切,當我嘗試運行測試,我收到此錯誤RunUnitTests錯誤的Xcode 5更新

if [ "${TEST_AFTER_BUILD}" = "YES" ]; then 
    Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild." 
    Note ${LINENO} "You can remove the Run Script build phase that invokes RunUnitTests from your unit test bundle target." 
    # Exit with EX_UNAVAILABLE to indicate that this subsystem is unavailable. 
    exit 69 
fi 

Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild."被紅色高亮顯示,以更新項目的Xcode 5.現在。我GOOGLE了這個問題,但無法找到任何答案。可能是什麼問題,我該如何解決它?

回答

7

您很可能將生成後的測試版本設置爲YES。 Xcode 5不支持「生成後測試」構建設置。將測試後的測試設置爲NO,錯誤應該消失。

+0

非常感謝你解決了我的問題! –

+0

此選項不再顯示在Xcode 5中的UI中。它現在是一個名爲「TEST_AFTER_BUILD」的用戶定義設置。 –

2

使用此命令。

xcodebuild test -scheme <YOUR SCHEME NAME HERE> -destination OS=6.1,name=iPhone

我也用Google搜索,發現這個網站。 http://petosoft.wordpress.com/2013/06/25/running-unit-tests-using-jenkins-and-xcodebuild-on-xcode-5-0/

+1

請將所有內嵌代碼塊放在'內,以便將它們格式化爲代碼。對於多行代碼,要麼將它們縮進4個空格(或),而要使用按鈕欄中的「{}」按鈕。其他的事情,而不是發佈一個鏈接,請將其基本內容也發佈到答案中。這將確保您的答案不會失去其價值,即使鏈接變爲不活動狀態。 – Harry

+0

我在哪裏添加此命令? –

1

TEST_AFTER_BUILD選項成爲用戶在Xcode 5中定義的設置。只需刪除它即可。