Tests stop working under xcode 8 TEST_HOST error

For some reason the "Host Application" setting in the picture below was the problem for me. Selecting the proper target fixed this.

This ended up modifying the following values in my xcodeproj:

  • BUNDLE_LOADER = "$(TEST_HOST)";
  • TEST_HOST = "$(BUILT_PRODUCTS_DIR)/myappname.app/myappname";

There is one more case you might encounter. If you need different product names for main target(for example Debug, Staging, Production) - and try to use Xcode Host Application selector, it will write incorrect values to TEST_HOST build setting.

And while error message you see is about bundle identifier in Debug configuration, Xcode actually complains about TEST_HOST in Release configuration.

I fixed it by manually changing TEST_HOST build setting. For example, if you have ProductName on main target set to AppDebug in Debug and AppRelease in Release configuration, your TEST_HOST should be following:

What Xcode sets:

$(BUILT_PRODUCTS_DIR)/AppDebug.app/AppDebug

What you need to set:

Debug configuration: $(BUILT_PRODUCTS_DIR)/AppDebug.app/AppDebug
Release configuration: $(BUILT_PRODUCTS_DIR)/AppRelease.app/AppRelease

Tags:

Ios

Xcode

Xcode8