In Xcode, pressing ⌘B
(build target) can build the project, it will generate the build in the path ~/Library/Developer/Xcode/DerivedData/{AppName}-{hash}
.
- How could I know the whole path of the build (with the hash value) by a script? Can I find that path in my
.xcodeproj
? - When I use
⇧⌘U
(build test target only), where can I find the test target build?
2
Answers
The build paths can be controlled using
BUILT_PRODUCTS_DIR
,PROJECT_TEMP_DIR
,CONFIGURATION_BUILD_DIR
andCONFIGURATION_TEMP_DIR
etc . https://help.apple.com/xcode/mac/11.4/#/itcaec37c2a6There’s no need to extract them from some non-public file format specification.
If you must do it, init a temporary git repo with a xcodeproj file in it. Commit it. Make a change in one of the variables and then run
git diff
.xcodebuild -showBuildSettings
man xcodebuild
See sample below to find by script
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.
If you are using Xcode Server Bots
Sample output:
As noted in https://stackoverflow.com/a/57512068,
For further documentation on the build setting properties, see Build Setting Reference at developer.apple.com. The link that @puio listed is also useful.