Tests stop working under xcode 8 TEST_HOST error

前端 未结 12 810
暖寄归人
暖寄归人 2020-12-15 15:13

I want to start tests under Xcode 8 and it fail in the beginning. My error is:

Could not determine bundle identifier for MyProjectTest\'s TEST_HOST:

12条回答
  •  时光说笑
    2020-12-15 15:48

    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
    

提交回复
热议问题