Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 - -bundle_loader can only be used with -bundle XCTest

I am working on unit tests with XCTest and Xcode 5. Everything was working just fine, but then a colleague made a push, and it seems to have broken it.

I have done the following:

BUNDLE_LOADER = $(BUILT_PRODUCTS_DIR)/app name.app/app

TEST_HOST = $(BUNDLE_LOADER)

and I have played around with the build paths endlessly.

Here is the error I am getting, which is tied to a Linker-O error.

-bundle_loader can only be used with -bundle

Anyone know how to fix this?

like image 314
Siriss Avatar asked Oct 11 '13 15:10

Siriss


People also ask

What is XCTest in Xcode?

Overview. Use the XCTest framework to write unit tests for your Xcode projects that integrate seamlessly with Xcode's testing workflow. Tests assert that certain conditions are satisfied during code execution, and record test failures (with optional messages) if those conditions aren't satisfied.

What is the difference between XCTest and XCUITest?

XCTest / XCUITest is pure iOS and cannot help the team that needs to test both iOS and Android devices. XCUITest was built for the iOS and Xcode Developer in mind and focuses less on the QA Automation Engineer.

Where will you use setUp () and tearDown () methods?

Prepare and Tear Down State for a Test Class XCTest runs setUp() once before the test class begins. If you need to clean up temporary files or capture any data that you want to analyze after the test class is complete, use the tearDown class method on XCTestCase .


1 Answers

The Mach-O Linker flag in the test target was set to "executable" instead of "bundle".

like image 188
Siriss Avatar answered Oct 11 '22 13:10

Siriss