Test host not found Xcode 13.3.1 BUILT_PRODUCTS_DIR variable changed

Viewed 169

TL;DR

$(BUILT_PRODUCTS_DIR):

  • Was .../Products/Debug-iphoneos/... and .../Products/Debug-iphonesimulator/... in Xcode 13.3.0
  • Now it's .../Products/Debug/... in Xcode 13.3.1

Questions:

  • How to get the path right in Xcode 13.3.1?
  • Or is this (another) Xcode bug?

More info:

I've just updated my Xcode from 13.3.0 to 13.3.1 and I've noticed several changes that are not even mentioned in the release notes

First, to target the iPhone family: TARGETED_DEVICE_FAMILY = 1 It has become: SDKROOT = iphoneos

My problem is that my test target, which relies on the app target, is not being found anymore.

My research so far:

  • Test Target > General > Host Application This is set to the App target, all good.

  • Test Target > Build Settings > TEST_HOST is $(BUILT_PRODUCTS_DIR)/MyApp.app/MyApp

  • My surprise when I run the test suite is that I get the following message:

Could not find test host for MyAppTests: TEST_HOST evaluates to ".../Library/Developer/Xcode/DerivedData/MyApp/Build/Products/Debug/MyApp.app/MyApp"

And that does not exist!

So I go to my Finder and this should be the correct path:

.../Library/Developer/Xcode/DerivedData/MyApp/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp

or

.../Library/Developer/Xcode/DerivedData/MyApp/Build/Products/Debug-iphoneos/MyApp.app/MyApp

Thank you!

0 Answers
Related