xcrun command to export ipa file xcode8 for iphoneos10.0
Asked Answered
C

1

10
xcrun xcodebuild -log -sdk iphoneos PackageApplication "$OUTPUTDIR/$APPNAME.app" -o "$OUTPUTDIR/$APPNAME.ipa" -sign "$DEVELOPER_NAME" -embed "$PROVISIONING_PROFILE"

This is the command now i am using in xcode7.3.1. i updated xcode to 8.0 version. while running this command in terminal I am getting error as "warning: PackageApplication is deprecated, use xcodebuild -exportArchive instead."

is there any alternative command???

Claytonclaytonia answered 24/9, 2016 at 8:29 Comment(0)
D
14

In Xcode8, xcrun PackageApplication is deprecated, so I was successful with the use of this way.

#archive
xcodebuild -sdk iphoneos10.0 -project Unity-iPhone.xcodeproj \
-scheme Unity-iPhone \
-configuration Release build \
-archivePath $ARCHIVE_DIRECTORY'/'$APP_NAME'.xcarchive' \
archive

#export ipa
xcodebuild -exportArchive \
-archivePath $ARCHIVE_DIRECTORY'/'$APP_NAME'.xcarchive' \
-exportPath $OUT_PATH'/' \
-exportOptionsPlist exportOptions.plist

And the contents of exportOptions.plist is (for adhoc),

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>method</key>
    <string>ad-hoc</string>
    <key>teamID</key>
    <string>YOUR_TEAM_ID</string>
    <key>uploadBitcode</key>
    <true/>
    <key>uploadSymbols</key>
    <true/>
  </dict>
</plist>
Dynamoelectric answered 20/10, 2016 at 6:28 Comment(4)
How did you find out what could be the contents of exportOptions.plist ? I have seen dozens of samples on the web and instruction for Xcode GUI from Apple, but as usual not a single place where to refer to if I want to build my own export plist suitable for my goals ;) Thanks.Fantasia
Okay, finally I was able to read the instructions in xcodebuild -help, but now I don't get how it decides which Provisioning Profile to use for AdHoc export. I will file a new question on SO to see if someone is aware of this.Fantasia
NOTE: <xml version="1.0" encoding="UTF-8"> should be <?xml version="1.0" encoding="UTF-8"?>Flanagan
Great answer, still working for me in XCode 11. NOTE: I have found the easiest way to get a working exportOptions.plist file is to export an archive manually from XCode using the desired options, then copy the generated ExportOptions.plist file from the export output directory.Hemipode

© 2022 - 2024 — McMap. All rights reserved.