xcodebuild for application with watch os 2 target and CONFIGURATION_BUILD_DIR is not working in xcode 7 beta 5

When i try to build my application from my terminal or jenkins, xcodebuild fails at the last step of building the application itself. I've watch os 2 application and extension with my application. It builds the extension and watch app. But at the end of the build process it can't find the watch application's .app file.


PBXCp build/MyApp/Build/Products/Release-watchos/MyWatchApp.app build/MyApp.app/Watch/MyWatchApp.app


this command fails and it says "No such file or directory"


My build command is;


xcodebuild build -project MyApp.xcodeproj -scheme MyApp -configuration Release CONFIGURATION_BUILD_DIR=./build


Environment:

MacOS 10.10.4

Xcode 7 beta 5


I hope Apple can take a look at this and fix the problem. It'll cause a lot of trouble for the developers who are using CI tools like Jenkins.


Thanks.

Same here. Have you been able to solve this?


Thanks!

Any luck on this one?

Same problem here with the GM 😟


Any ideas to solve this ?


It seems that PBXCp search in Derived data path instead of CONFIGURATION_BUILD_DIR directory.


error: /Users/xxx/Library/Developer/Xcode/DerivedData/myProject-esexhzxfybwrztfgvubddxqwnnnp/Build/Products/Release-watchos/MyProject WatchKit App.app: No such file or directory

It seems you cannot use CONFIGURATION_BUILD_DIR with WatchOS2 targets....

It's officially documented by Apple or is it a bug ?

I guess its a bug, file a radar. Generally all the command line tools aren't working very well with the new changes to include WatchOS

This is a known issue. Can you set SYMROOT instead of CONFIGURATION_BUILD_DIR to work around this? CONFIGURATION_BUILD_DIR is derived from SYMROOT, and overriding SYMROOT will not cause this problem.

Thanks a lot, the workaround works like a charm : I can compile my app using my Jenkins server.

What do you mean by "set SYMROOT instead of CONFIGURATION_BUILD_DIR"?

Can you provide more information on how to achieve that in Jenkins?

Thanks!

Hi,


Can you detail a bit more what you did?

I am using jenkins to build an app with an extension.

The build used to failed because it was looking for the watchKit App in the derivedData folder instead of the product folder


PBXCp /Users/administrator/Library/Developer/Xcode/DerivedData/PROJECTNAME-ejjyqqqmbbfvredyttnhftrwggkb/Build/Products/Production-watchos/WATCHAPP.app build/PROJECTNAME.app/Watch/WATCHAPP.app


Which is totally wrong. by changing SYMROOT in my xcodebuild command to $workspace/build it a bit better but still is searches the watch app in a Production-watchos folder that does not existe


PBXCp build/Production-watchos/WATCHAPP.app


Thanks for your help.


Nicolas

I got the same problems as well. SYMROOT did no difference.

The problem is still occuring. SYMROOT didn't fix anything. I'm getting 300+ errors on the command line when I give CONFIGURATION_BUILD_DIR or SYMROOT parameters. When I don't give those parameters, It works fine but uploads the build into DerivedData. Therefore, I can't get any build into a directory I want.

Doesn't work either.

Could you please explainthe steps you followed to get a succesful build?

I am still facing the same issue 😟

Could you please share the steps you followed to make the app compile on Jenkins?

I am trying to build the app using xcodebuild Terminal command and it always fails at -


PBXCp /var/root/Library/Developer/Xcode/DerivedData/XXX-bfajgqsoqcgiyecsqufmmkacftff/Build/Products/Release-watchos/XXX.app build/XXX.app/Watch/XXX.app

cd <project-folder-path>/XXX

export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin"

builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /var/root/Library/Developer/Xcode/DerivedData/XXX-bfajgqsoqcgiyecsqufmmkacftff/Build/Products/Release-watchos/XXX.app <project-folder-path>/XXX/build/XXX.app/Watch

error: /var/root/Library/Developer/Xcode/DerivedData/XXX-bfajgqsoqcgiyecsqufmmkacftff/Build/Products/Release-watchos/XXX.app: No such file or directory

** BUILD FAILED **

The following build commands failed:

PBXCp /var/root/Library/Developer/Xcode/DerivedData/XXX-bfajgqsoqcgiyecsqufmmkacftff/Build/Products/Release-watchos/XXX.app build/XXX.app/Watch/XXX.app

(1 failure)

In my case, dropping the CONFIGURATION_BUILD_DIR value and putting it in SYMROOT instead resolved the issue.


To be precise, I went to the Advnaced XCode build options section in the XCode Jenkins plugin and moved the value that was under the Build output directory to the SYMROOT field. So the end result was an empty Build output directory and a SYMROOT value of $WORKSPACE/build.

Is it possible to do this in local Xcode instead of jenkins xcode plugin?

I think I've found a solution. When I tried to execute this line of command, I got a successful build. Please let me know If you can get a successful build with this as well;



xcodebuild build -project [PROJECT_NAME].xcodeproj -configuration [CONFIGURATION] -scheme [SCHEME] SYMROOT=[FULL_PATH_TO_PROJECT_FOLDER]/build/[PRODUCT_NAME]/Build/Products

Sorry, this forum doesn't send nofifications so I didn't catch that.


Sure, you can access the same settings in XCode, they're in the Build Settings tab of your taget settings:

CONFIGURATION_BUILD_DIR is called Per-configuration Build Products Path

SYMROOT is called Build Products Path

If you're using xcodebuild (which I recommend BTW, the Jenkins plugins is outdated and doesn't support xcpretty) you can just pass the above directly, e.g.:

xcodebuild build -workspace ... -scheme ... SYMROOT=...

xcodebuild for application with watch os 2 target and CONFIGURATION_BUILD_DIR is not working in xcode 7 beta 5
 
 
Q