What's the replacement for Xcode's PackageApplication?
Asked Answered
I

3

13

With Xcode 8.3 PackageApplication is gone. I did use it to convert an *.app package/directory to a *.ipa file (after re-signing):

xcrun -sdk iphoneos PackageApplication -v "MyApp.app" -o "MyApp.ipa"

Is there any replacement for this, so I can continue to convert .app to .ipa?

Inoue answered 29/3, 2017 at 13:4 Comment(0)
I
25

Apparently there is no need to use any other tool, and it's also not necessary to change the process that leads to the *.app package (in other words: no need to use xcodebuild -exportArchive).

All we have to do, is to zip that *.app package:

pushd "/build"
mkdir ./Payload
cp -R "$PATH_TO_SIGNED_APP_PACKAGE.app" ./Payload
zip -qyr MyApp.ipa ./Payload
rm -r ./Payload
popd

Note:

  1. Jump into the target directory, here /build. This ensures we don't have the full path in the zip archive later.
  2. Create a folder named Payload (important, this cannot vary)
  3. Copy the *.app bundle to the Payload folder
  4. Zip the folder and instead of *.zip use *.ipa as extension
  5. Jump back to where you came from
Inoue answered 30/3, 2017 at 11:21 Comment(6)
You said there is no need for PackageApplication anymore? Does it mean we don't have to include SwiftSupport folder in the IPA anymore? Do you have any reference for that?Cardholder
Can you explain (1) above a little more? Is build just an arbitrary directory name?Warrior
@Warrior Yes, completely arbitrary.Inoue
@Inoue xcrun also did file compressing which this one don't doPolytheism
@Polytheism Do you know if this eventually matters on Apple's side? I assume they re-pack the archive anyway.Inoue
@Inoue developer.apple.com/library/content/qa/qa1795/_index.html read under measuring your appPolytheism
N
9

Another workaround would be to put a copy of the PackageApplication tool from a previous Xcode into the Xcode 8.3 directory

Get the PackageApplication script from Xcode 8.2.1 here: https://gist.github.com/anonymous/48f3e4c5ae25313dc0fe10d9ec50c3fc

Remember to make it executable

chmod +x PackageApplication

Then drop it into your 8.3 Xcode.app as

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication
Nazario answered 21/4, 2017 at 19:49 Comment(0)
W
1

This is the error: xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH It looks like PackageApplication is removed from Xcode 8.3. In Xcode 8.2 there was a warning: PackageApplication is deprecated, use xcodebuild -exportArchive instead.

Woodley answered 30/3, 2017 at 4:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.