yonivav yonivav - 1 year ago 72
Bash Question

creating IPA for enterprise app and not an ad hoc

i'm trying to create a script for an ipa file for my app, but i want it to be for enterprise distribution and not an Ad Hoc.

my script is:

# creating xcArchive file

xcodebuild -workspace <ProjectName>.xcworkspace -scheme <SchemeName> archive \
-archivePath <DirectoryPath><ScemeName>.xcarchive

# compressing the xcArchive file into IPA file
xcodebuild \
-exportArchive \
-exportFormat ipa \
-archivePath <DirectoryPath>/<ScemeName>.xcarchive \
-exportPath <DirectoryPath>/<ScemeName>.ipa" \
-exportProvisioningProfile "<My Distribution Provisioning Profile>".

Now, in apple wizard, when i'm creating an IPA file, in its embedded.mobileprovision i can see those attributes:
for eneterprise distribution:


for Ad-Hoc distribution:


In my case, i don't know why, i don't have any of them, and therefore cannot install them on any device.
anyone can tell me why is it ? please ?

Answer Source

I solved it. I should use a modern approach, and write it in export.plist:

# creating .xcarchive file from .app file
function create_archive_file() {
    xcodebuild \
    -workspace ${PROJECT_NAME}.xcworkspace \
    -scheme "${scheme_name}" \
    archive \
    -archivePath ${SRCROOT}/${proj_external_name}/${1}.xcarchive
# compressing xcArchive file into IPA file
function create_ipa_from_archive() {
    xcrun xcodebuild \
    -exportArchive \
    -archivePath ${SRCROOT}/${proj_external_name}/${scheme_name}.xcarchive \
    -exportPath ${SRCROOT}/${proj_external_name}/folder \
    -exportOptionsPlist export.plist

and in export.plist:

<?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">
    <string>... (my TeamID, get it from one archiving action only once, and check it's details in build editor)</string>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download