What is BUNDLE_EXECUTABLE_FOLDER_PATH?

What is BUNDLE_EXECUTABLE_FOLDER_PATH?

I came across this in a freshly-created iOS project (Xcode 14.2). In the unit tests target it created, it set TEST_HOST to

$(BUILT_PRODUCTS_DIR)/MyApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/MyApp

As far as I can tell, nothing sets BUNDLE_EXECUTABLE_FOLDER_PATH, and I can’t find it in any of the existing Xcode build settings. It's not set for Run Scripts, either, although these are close (and yes, this is an iOS project, not sure why one is MacOS):

export BUNDLE_EXECUTABLE_FOLDER_NAME_deep\=MacOS
export BUNDLE_EXTENSIONS_FOLDER_PATH\=Extensions

A project I created several years ago does not have the TEST_HOST predefined that way.

A project I created several years ago does not have the TEST_HOST predefined that way.

Yeah, same with us. It wasn't until I ran into trouble (see below), and tried swapping various settings to troubleshoot, that Xcode "updated" this use this new value:

// Old
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/InternalName.app/InternalName";
TEST_HOST = "$(BUNDLE_LOADER)";

// New 
BUNDLE_LOADER = "$(TEST_HOST)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/InternalName.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/InternalName";

In our environment, with an iOS app, this value appears to be "". I can tell because we currently have a misconfiguration this is causing an error when trying to run our Tests:

Could not find test host for Tests: TEST_HOST evaluates to "/Users/johnsmith/Library/Developer/Xcode/DerivedData/Internal-eaczvnalejwszegnxwnommslvcby/Build/Products/Production Configuration-iphonesimulator/InternalName.app/InternalName"
What is BUNDLE_EXECUTABLE_FOLDER_PATH?
 
 
Q