Can a xcarchive file be created from a ipa file?

2.2k Views Asked by At

If you have an ipa file (e.g. generated through Jenkins), can you create an archive out of it? Is there a possibility to do that in Xamarin Studio/Xcode after the ipa file has been created?

Or is the only way generating a new ipa/xcarchive file in Xamarin Studio/Xcode? Perhaps the xcarchive can be build on the command line with the ipa file path as input parameter?

There is command, which can create a xcarchive file

xcodebuild -scheme myscheme archive -archivePath /path/to/AppName.xcarchive

but what is the project source for this?

2

There are 2 best solutions below

2
On BEST ANSWER

No. The xcarchive includes dSYM information that is not included in the ipa-file.

The archive command uses the archive action in the scheme specified on the command line. The project is either guessed by xcodebuild or specified as a command line parameter.

0
On

Yes, instructions for an iOS app:

  1. Create a folder named %(AppName).xcarchive.
  2. Create an Info.plist in the root of the following format. Replace all the %(...) values with the proper ones for your application.
<?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>ApplicationProperties</key>
    <dict>
        <key>ApplicationPath</key>
        <string>Applications/%(AppName).app</string>
        <key>Architectures</key>
        <array>
            <string>arm64</string>
        </array>
        <key>CFBundleIdentifier</key>
        <string>%(bundle_identifier)</string>
        <key>CFBundleShortVersionString</key>
        <string>%(marketing_version)</string>
        <key>CFBundleVersion</key>
        <string>0</string>
        <key>SigningIdentity</key>
        <string>%(name_or_identifier_of_signing_identity)</string>
        <key>Team</key>
        <string>%(team_identifier)</string>
    </dict>
    <key>ArchiveVersion</key>
    <integer>2</integer>
    <key>CreationDate</key>
    <date>2022-05-18T23:56:29Z</date>
    <key>Name</key>
    <string>%(AppName)</string>
    <key>SchemeName</key>
    <string>Empty</string>
</dict>
</plist>
  1. Unzip the built .ipa.
  2. Copy the SwiftSupport and MessagesApplicationExtensionSupport in the root of the decompressed IPA into the root of the .xcarchive.
  3. Copy the .app from the IPA into the .xcarchive/Products/Applications folder in the XCArchive.

This allows me to run commands like xcodebuild -exportArchive -archivePath /path/to/AppName.xcarchive -exportPath AppName -exportOptionsPlist ExportOptionsPlist.plist on the manually created IPA (that doesn't contain dSYMs).