如何:使用Automator分发空气安装的Beta应用程序
-
14-10-2019 - |
题
如何自动化分发应用程序下载的应用程序的过程。要在空中下载,您必须在分发配置文件中 (不确定用户是否需要下载其中一个以上以下载多个应用程序)
步骤是:
- 构建和存档,并保存到磁盘
- 上传 到网站,更换旧版本
- 更新 带日期的iPhone网站
答案在下面,我的漫长答案。最初这是一个问题,但是过了一会儿,我自己解决了。您甚至可以设置它,以便在发送某个电子邮件时会构建它,以便您可以在旅途中编写代码(使用Dropbox和Droptext),然后在手机上安装并查看差异。
更新(2012):https://testflightapp.com/ 已经对其部署系统进行了重大改进,包括跟踪用户使用情况。我相信,随着这些添加,将部署系统的品牌为其获得这些其他功能,这是值得的。一个人可以使用我的系统在iPad上编写代码,在远程计算机上构建和编译,然后将其安装在iPad上进行开发测试,然后为Beta用户使用TestFlight。或者完全使用测试飞行。
解决方案
网站文件布局
- name.com/index.php (iPhone网站,可选但建议)
- name.com/application/index.php (基本自动链接创建站点)
- name.com/application/application.ipa (仅需要更新的文件)
- name.com/application/application.plist
- name.com/application/application57.png
- name.com/application/application512.png
- name.com/application/application_distribution_profile.mobileprovision
使用Automator的解决方案:
第一动作:运行shell脚本 构建和存档并保存到.IPA文件。可能需要一段时间才能弄清楚如何对其进行修改以适应您的状况(这可能与Xcode 4不起作用,如果您有问题,则只需在Xcode内部构建和存档)
PROJDIR="/Users/username/Xcode/applicationfolder"
PROJECT_NAME="application"
APPLICATION_NAME="Application"
TARGET_SDK="iphonesimulator4.0"
PROJECT_BUILDDIR="${PROJDIR}/build/Distribution-iphoneos"
TARGET_TEST_NAME="application"
BUILD_HISTORY_DIR="${PROJDIR}/distribution/" #where you want the .ipa to go
DEVELOPER_NAME="First Last (TMTE9G3NGS)"
PROVISONING_PROFILE="/Users/username/Xcode/Application_Distribution_Profile.mobileprovision"
# compile project
echo Building Project
cd "${PROJDIR}"
xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Distribution
#Check if build succeeded
if [ $? != 0 ]
then
exit 1
fi
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${PROJECT_BUILDDIR}/${PROJECT_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}"
动作二:获取查找器项目
刚刚保存的应用程序.IPA文件。
动作三:上传到FTP服务器
Google供脚本(不能发布URL)在AutomatorWorld Dot com上,应该很容易找到。使用该脚本将文件上传到您想要的位置。在我的情况下name.com/application/application.ipa
现在为网站结束。
如果您想有一种基本方法供用户下载文件,只需将index.php文件(以下创建),application.plist文件(下面创建),.ipa文件和57 Pixel和512 Pixel image放在文件夹。
我又走了一步,创建了一个iPhone HTML网站,您可以转到该网站,该网站还显示了该文件最后更新时。您可以使用此模板创建该站点: http://snipt.org/vmup/ 我必须使用基本站点来复制它为IPA和MobileProvision链接创建的URL。这是我为链接带有自动更新最后更新日期的片段。对于最后更新的文本,我必须将文件更改为.php
<li><a href="URL FROM BASIC SITE HERE"><span class="menuname">Install Application Name</span><span class="itemarrow"></span></a></li>
<sup>
Last Updated: <?= date("m/d/Y H:i",filemtime("applicationfolder/application.ipa")) ?> (TIME ZONE HERE)
<sup>
基本自动链接创建应用程序索引文件:
<?php $ipas = glob('*.ipa'); $provisioningProfiles = glob('*.mobileprovision'); $plists = glob('*.plist'); $sr = stristr( $_SERVER['SCRIPT_URI'], '.php' ) === false ? $_SERVER['SCRIPT_URI'] : dirname($_SERVER['SCRIPT_URI']) . '/'; $provisioningProfile = $sr . $provisioningProfiles[0]; $ipa = $sr . $ipas[0]; $itmsUrl = urlencode( $sr . 'index.php?plist=' . str_replace( '.plist', '', $plists[0] ) ); if ($_GET['plist']) { $plist = file_get_contents( dirname(__FILE__) . DIRECTORY_SEPARATOR . preg_replace( '/![A-Za-z0-9-_]/i', '', $_GET['plist']) . '.plist' ); $plist = str_replace('_URL_', $ipa, $plist); header('content-type: application/xml'); echo $plist; die(); } ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Install iOS App</title> <style type="text/css"> li { padding: 1em; } </style> </head> <body> <ul> <li><a href="<? echo $provisioningProfile; ?>">Install Team Provisioning File</a></li> <li><a href="itms-services://?action=download-manifest&url=<? echo $itmsUrl; ?>"> Install Application</a></li> </ul> </body> </html>
应用程序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>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>IPA FILE LINK HERE</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>URL FOR 512 PIXEL IMAGE HERE</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>URL FOR 57 PIXEL IMAGE HERE</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>COM.COMPANY.APPLICATION</string>
<key>bundle-version</key>
<string>VERSION NUMBER HERE (YOU DON'T REALLY NEED TO UPDATE IT UNLESS YOU WANT TO)</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>APPLICATION NAME HERE</string>
</dict>
</dict>
</array>
</dict>
</plist>
其他提示