【问题标题】:creating IPA for enterprise app and not an ad hoc为企业应用程序而不是临时创建 IPA
【发布时间】:2016-11-17 02:43:53
【问题描述】:

我正在尝试为我的应用程序的 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>".

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

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

对于 Ad-Hoc 分发:

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

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

【问题讨论】:

    标签: xcode shell enterprise ipa adhoc


    【解决方案1】:

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

    【讨论】:

    • 这行得通吗?我看到一个错误:“Error Domain=IDEDistributionErrorDomain Code=14“未找到适用的设备。”UserInfo={NSLocalizedDescription=未找到适用的设备。}”在 plist 内容上具有相同的命令。你项目中的歌唱设置是什么?自动?
    • 它对我有用。我认为(在我的地区有点晚了)也许您的配置文件不应该用于特定设备,它应该是通配符。
    • 不是。我正在使用可与任何设备一起使用的企业配置文件。我不是唯一一个有这个问题的人(基于谷歌搜索)。似乎或可能是,出于某种原因,即使定义了企业,它也会尝试使用 ad-hoc 方法。
    • 就我而言,它不起作用的原因是使用了 google-cast-sdk 和这个错误:code.google.com/p/google-cast-sdk/issues/detail?id=第954章
    • 检查正确的配置文件是否也在您的目标中
    猜你喜欢
    • 2014-03-17
    • 2018-04-22
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    • 1970-01-01
    • 2014-04-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多