1
votes

After installing Xcode5.1 with iPhone7.1 sdk I am getting the following error when trying to package my application in the command line:

xcodebuild: error: SDK "iPhoneOS7.1.sdk" cannot be located. xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

I have already installed Xcode command line tools in previous version of Xcode and the upgrade to Xcode5.1 did not remove them. The option to install "command line tools" is not available in Xcode preferences/downloads.

Any ideas how to fix this error?

4

4 Answers

16
votes

I got this error when using Carthage. It happened because I first installed the commandline tools, and only afterwards, the full Xcode application. To fix this, I had to run the following command:

$ sudo xcode-select --reset
2
votes

Right, so after a short trial and error loop I figured it out: I was calling xcrun with an sdk name it does not recognize:

xcrun -sdk iPhoneOS7.1.sdk PackageApplication -v appName.app -o appName.ipa  

The correct syntax which worked for me is:

xcrun -sdk iphoneos PackageApplication -v appName.app -o appName.ipa  
0
votes

I found how to automate the build and archive process from the command line, I just find a blog article explaining how you can achieve that.

The command you have to use is xcrun:

/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${RELEASE_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}"

You will find all the details in the article. If you have any questions dont hesitate to ask there.

Hope this will help you out.

0
votes

After Xcode 8.x,Apple remove PackageApplication ,so ,you should download PackageApplication to the specified dir. The dir is :/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

Then you should query and download PackageApplication. github: https://github.com/JackSteven/PackageApplication