- How could I know the whole path of the build (with the hash value) by a script?
- Change to the same folder where your project or workspace is
- Run
xcodebuild -showBuildSettings
- May need to add the proper scheme or target. See
man xcodebuild
See sample below to find by script
- When I ... build for test target only, where can I find the test target build?
It will be in the same folder with a name similar to <Test_Target_Name>-Runner.app. This is useful as you can use for Cloud device testing services.
# This example works with Xcode project with a single scheme
# Echo to stdout
xcodebuild -showBuildSettings
xcodebuild -showBuildSettings | grep CONFIGURATION_BUILD_DIR
# save to a variable for use in your script
# A little brutal, so I'm open to other ways to do this.
CONFIGURATION_BUILD_DIR=$(xcodebuild -showBuildSettings 2> /dev/null | grep CONFIGURATION_BUILD_DIR | sed 's/[ ]*CONFIGURATION_BUILD_DIR = //')
echo $CONFIGURATION_BUILD_DIR
If you are using Xcode Server Bots
cd ${XCS_PRIMARY_REPO_DIR}
xcodebuild -showBuildSettings
Sample output:
/Users/roblabs/Library/Developer/Xcode/DerivedData/openmaptiles-ios-demo-eectbiabcmhajpdbcoqnaipiaqpd/Build/Products/Release-iphoneos
As noted in https://stackoverflow.com/a/57512068,
The default value is $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
For further documentation on the build setting properties, see Build Setting Reference at developer.apple.com. The link that @puio listed is also useful.