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

creating IPA for enterprise app and not an ad hoc

我正在尝试为我的应用程序的 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 wizard 中,当我创建 IPA 文件时,在其 embedded.mobileprovision 中我可以看到这些属性: 对于企业分布:

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

对于临时分发:

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

就我而言,我不知道为什么,我没有它们,因此无法在任何设备上安装它们。 谁能告诉我这是为什么?请问?

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