3

i have searched a lot but can not find a helpful link to find project location in derived data folder using swift in xcode 8.

Please help me regarding this issue.

0

3 Answers 3

12

You can run this in the command line using grep, and you'll have the DerivedData build folder of your project.

xcodebuild -project projectName.xcodeproj -showBuildSettings | grep -m 1 "BUILD_DIR" | grep -oEi "\/.*"

Sign up to request clarification or add additional context in comments.

Comments

2

You can't get this path with Swift from your app: the "Derived Data" folder is only useful for Xcode, not for your app, which doesn't "see" it at all.

Xcode is the IDE and uses the folder when building your app - but your app is not aware of Xcode or its folders, your app is independent from the IDE.

2 Comments

this .xcode project inside derived data consists a info.plist file where workspace information is given. so in that case, this info can not be accessible or is there any way to know the .xcode project location? thanks
This info is only available to Xcode, not to your app. Let's say you distribute your app. When the final user uses it, there may not even be an Xcode installed on this machine... and anyway there won't be your Derived Data folder with your building data - this is only on your machine, only for your Xcode - unrelated to your app.
1

With xCode, a simple way to the find the Derived Data path is to Build your target.

This does NOT run the target. But you can see the Derived Data folder on your machine.enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.