xcrun命令导出iphone文件xcode8 for iphoneos10.0

时间:2016-09-24 08:29:35

标签: ipa xcodebuild xcrun

xcrun xcodebuild -log -sdk iphoneos PackageApplication "$OUTPUTDIR/$APPNAME.app" -o "$OUTPUTDIR/$APPNAME.ipa" -sign "$DEVELOPER_NAME" -embed "$PROVISIONING_PROFILE"

这是我在xcode7.3.1中使用的命令。我将xcode更新为8.0版本。在终端中运行此命令时,我收到错误“警告:不推荐使用PackageApplication,而是使用xcodebuild -exportArchive。”

有没有替代命令???

2 个答案:

答案 0 :(得分:12)

在Xcode8中,xcrun PackageApplication已被弃用,因此我成功使用了这种方式。

#archive
xcodebuild -sdk iphoneos10.0 -project Unity-iPhone.xcodeproj \
-scheme Unity-iPhone \
-configuration Release build \
-archivePath $ARCHIVE_DIRECTORY'/'$APP_NAME'.xcarchive' \
archive

#export ipa
xcodebuild -exportArchive \
-archivePath $ARCHIVE_DIRECTORY'/'$APP_NAME'.xcarchive' \
-exportPath $OUT_PATH'/' \
-exportOptionsPlist exportOptions.plist

exportOptions.plist的内容是(对于adhoc),

<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>method</key>
    <string>ad-hoc</string>
    <key>teamID</key>
    <string>YOUR_TEAM_ID</string>
    <key>uploadBitcode</key>
    <true/>
    <key>uploadSymbols</key>
    <true/>
  </dict>
</plist>

答案 1 :(得分:0)

我从我在Github中写的内容中复制了这个(github链接:https://github.com/3Dmobileapp/ios-app/blob/Brian%232/Export%20ipa

(Ad-hoc方法)这是关于如何使用终端命令-xcodebuild导出ipa而没有Apple Developer帐户的完成过程。原始教程来自:xcrun command to export ipa file xcode8 for iphoneos10.0。完全归功于robita和Alexandr T,他写了部分完成的答案,激励我完成它。 让我们开始吧! 制作一个Xcode项目并将其命名为Test。创建一个名为exportOptions.plist的新plist文件。在root下,有一行显示新项目。在右侧,粘贴此代码。

<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>method</key>
    <string>ad-hoc</string>
    <key>teamID</key>
    <string>YOUR_TEAM_ID</string>
    <key>uploadBitcode</key>
    <true/>
    <key>uploadSymbols</key>
    <true/>
  </dict>
</plist>

不要担心编码错误。有用。 存档您的应用,然后点击&#34;在Finder中显示&#34;打开应用程序管理器时。 将xcarchive重命名为更简单的东西,没有任何空格。将存档移动到任何您想要的空文件夹(桌面,文档。) 同时也将exportOptions.plist移动​​到该文件夹​​中。现在,启动终端。复制并粘贴以下代码。

xcodebuild -exportArchive
-archivePath ~/YOUR NEW FOLDER'S DIRECTORY/YOUR NEW FOLDER/YOUR ARCHIVE NAME (IF YOUR ARCHIVE NAME HAS SPACES INSIDE OF IT THEN YOU WILL HAVE TO DO SOMEHTING ELSE)
-exportPath ~/YOUR NEW FOLDER'S DIRECTORY/YOUR NEW FOLDER/MAKE UP A NAME FOR ANOTHER FOLDER WHERE THE IPA WILL BE STORED
-exportOptionsPlist ~/YOUR NEW FOLDER'S DIRECTORY/YOUR NEW FOLDER/THE EXPORTOPTIONS.PLIST FILE

将大写字母编辑为您自己的&#34;偏好。&#34;