100grams
100grams

Reputation: 3510

Xcode5.1 xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

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?

Upvotes: 1

Views: 11954

Answers (4)

user7539530
user7539530

Reputation: 1

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

Upvotes: 0

Bart van Kuik
Bart van Kuik

Reputation: 4862

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

Upvotes: 17

100grams
100grams

Reputation: 3510

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  

Upvotes: 2

Irfan
Irfan

Reputation: 4331

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.

Upvotes: 0

Related Questions