Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
366 views
in Technique[技术] by (71.8m points)

ios - Tests stop working under xcode 8 TEST_HOST error

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: "/Users/jakubmazur/Library/Developer/Xcode/DerivedData/MyProject-ejeepybggxvekxajlyngopeahiex/Build/Intermediates/CodeCoverage/Products/Testing-iphonesimulator/MyProject.app"

Any idea what's wrong here? I try to clean project - nothing. In the Build Settings in my target in Packaging i change Product Bundle Identifier depends on configuration in my schema. It can have something to do with that, but not sure.

-- EDIT

Ok figure how to narrow the problem. When i change settings in scheme to use Build Configuration Debug instead of Testing seems to work, but I need separate configuration for testing.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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";

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...