为企业应用程序创建IPA而不是临时

时间:2016-07-14 09:00:07

标签: xcode shell enterprise ipa adhoc

我正在尝试为我的应用创建一个ipa文件的脚本,但我希望它是用于企业分发而不是Ad Hoc。

我的脚本是:

# 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>".

现在,在apple向导中,当我创建一个IPA文件时,在其embedded.mobileprovision中,我可以看到这些属性: 对于企业分配:

 <key>ProvisionsAllDevices</key>
 <true/>

用于Ad-Hoc分发:

<key>ProvisionedDevices</key>
    <array>
        <string>accacaca0-9800ac898a908908c90aca890c8a90</string>
        <string>123123123123123123bfd123bdf123fv123bdf12</string>
.
.
.
    </array>

在我的情况下,我不知道为什么,我没有任何一个,因此无法在任何设备上安装它们。 谁能告诉我为什么?拜托?

1 个答案:

答案 0 :(得分:0)

我解决了。我应该使用现代方法,并将其写入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
}

并在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">
<dict>
    <key>teamID</key>
    <string>... (my TeamID, get it from one archiving action only once, and check it's details in build editor)</string>
    <key>method</key>
    <string>enterprise</string>
    <key>uploadSymbols</key>
    <true/>
</dict>
</plist>