Tests stop working under xcode 8 TEST_HOST error

前端 未结 12 808
暖寄归人
暖寄归人 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:54

    I ran into this error a lot and eventually discovered that it was caused by varying PRODUCT_NAME between Debug and Release build configurations.

    We were doing this so that the Debug builds had a different app name when installed on the phone (as well as a different bundle id so we could install them side-by-side with the App Store builds).

    We reverted that change and added a new APP_DISPLAY_NAME setting to the build configuration, varied that between build types, and changed the Info.plist to use $(APP_DISPLAY_NAME) instead of $(PRODUCT_NAME).

    After doing that, it's important to go into the test target in the project and make sure the 'Host application' setting in General is actually set to your application.

提交回复
热议问题