Question

I'm new to iOS development and I'm running into a bit of a problem. I've inherited an app that's about 70% complete, but there's no tests. I want to add a unit testing target to my Xcode project (v4.6.2) and integrate it so it runs when I press cmd+u.

I have successfully added a new unit testing target. The next instruction says to modify the "bundle loader" setting under "build settings" -> "linker". The problem is that the "bundle loader" setting is blank and clicking in the row does not show the +/- buttons to add the setting.

How do I modify my bundle loader setting to set up my newly created test target to run with cmd+u?

Was it helpful?

Solution

The unit test target that is created for new projects is an Application Unit Test. It injects your test code into the app by setting BUNDLE_LOADER and TEST_HOST in the build settings. You can create a new unit test target and by default this will be a Logic Unit Test (BUNDLE_LOADER and TEST_HOST are not set).

If you want an Application Unite Test you should set the BUNDLE_LOADER and TEST_HOST to:

BUNDLE_LOADER = $(BUILT_PRODUCTS_DIR)/DC Wire Sizer.app/DC Wire Sizer
TEST_HOST = $(BUNDLE_LOADER)

You will need to change "DC Wire Sizer" to your app name

To make the new test target run with cmd-u you need to edit the test scheme and add your new test target.

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top