Joe Komputer
Joe Komputer

Reputation: 1345

PBXCP: No such file or directory, in most recent xcode

I have been modifying this open source code with Xcode 3.0 but as soon as I updated my Xcode to 4.0+ and tryed running it it no longer worked. The first error I ran into was this

/Users/newperson/Library/Developer/Xcode/DerivedData/Hellcraft-etesgjzdmfzimlgvakidckjecgij/Build    
/Intermediates/Hellcraft.build/Debug-iphonesimulator/Doom.build/Script-
435F41A90F532CA300887552.sh: line 3: /Applications/Xcode.app/Contents/Developer/Libra/PrivateFrameworks    
/DevToolsCore.framework/Resources/pbxcp: No such file or directory

I figured it had something to do with the Run Script under build phases, which is set as this:

/bin/sh -x

PBXCP=${DEVELOPER_DIR}/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp
${PBXCP} -exclude .svn "${PROJECT_DIR}/../../base" 
"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"

But after looking online and modifying the shell script countless amount of times I have not been able to find a solution. I found somewhere that pbxcp has been removed in the more recent versions of Xcode, but I am unable to find a suitable replacement, and am unable to incorporate that DevToolsCore into the new version of Xcode.

After finding a forum that said I should run an alternative script in order to makeup for the missing pbxcp file I tryed running this:

/usr/bin/tar -c -C "${PROJECT_DIR}/myframeworks" --exclude .DS_Store --exclude CVS --exclude 
.svn --exclude .git -H `cd "${PROJECT_DIR}/myframeworks" && find DevToolsCore.framework` | 
/usr/bin/tar -x -C ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}

I created a file called myframeworks in the project directory and added DevToolsCore.framework to it, although this fixed the missing pbxcp problem it generated another error:

tar: could not chdir to '/Users/newperson/Library/Developer/Xcode/DerivedData/Hellcraft-
etesgjzdmfzimlgvakidckjecgij/Build/Products/Debug-iphonesimulator/Doom.app/Frameworks'

tar: Write error
Command /bin/sh failed with exit code 1

If anyone has any advice it would be great, I'm pulling my hair out.

Upvotes: 7

Views: 14513

Answers (2)

Abhishek
Abhishek

Reputation: 368

You probably would have deleted some item from your Xcode.I also had this PBXc error, all i did was i added the same file again and got rid of that error.

Upvotes: 1

Adrian Frühwirth
Adrian Frühwirth

Reputation: 45666

See the duplicate and here. The thread states that pbxcp got removed in Xcode 4.4 and as it was an Xcode-internal tool there is no official replacement, but the thread does offer a replacement if you scroll down using tar and find.

Upvotes: 0

Related Questions