我正在设置Jenkins来实现iOS构建的自动化。是否有可能提供一个没有添加到Xcode中的准备工具中的.mobileprovision文件来构建xcodebuild?
我知道我可以使用PROVISIONING_PROFILE和PROVISIONING_PROFILEsdk=iphoneos*,但是它们需要将配置配置文件添加到组织者中。
我知道我可以用xcrun做这个手术。但在运行xcrun之前,我必须使用xcodebuild成功地签署应用程序。
,我是否可以提供供应配置文件(.mobileprovision)给xcodebuild??
发布于 2012-06-23 07:57:01
我们有一个解决方案--本质上你需要做的是‘安装’.mobileprovision文件,将它复制到以移动提供文件的UUID命名的目录中。当双击.mobileprovision文件时,Xcode管理器实际上就是这样做的。
有一个名为mpParse的小程序可以从脚本使用的移动提供文件中提取UUID,以便在代码中下载。然后,将移动设备文件复制到正确的位置是非常简单的。
下面是我编写的一个shell脚本:
#!/bin/sh
# 2012 - Ben Clayton (benvium). Calvium Ltd
# Found at https://gist.github.com/2568707
#
# This script installs a .mobileprovision file without using Xcode. Unlike Xcode, it'll
# work over SSH.
#
# Requires Mac OS X (I'm using 10.7 and Xcode 4.3.2)
#
# IMPORTANT NOTE: You need to download and install the mpParse executable from http://idevblog.info/mobileprovision-files-structure-and-reading
# and place it in the same folder as this script for this to work.
#
# Usage installMobileProvisionFile.sh path/to/foobar.mobileprovision
if [ ! $# == 1 ]; then
echo "Usage: $0 (path/to/mobileprovision)"
exit
fi
mp=$1
uuid=`/usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin <<< $(security cms -D -i ${mp})`
echo "Found UUID $uuid"
output="~/Library/MobileDevice/Provisioning Profiles/$uuid.mobileprovision"
echo "copying to $output.."
cp "${mp}" "$output"
echo "done"您可以直接从https://gist.github.com/2568707下载脚本
一旦运行了脚本,就可以在xcodebuild中使用PROVISIONING_PROFILE和PROVISIONING_PROFILEsdk=iphoneos*创建应用程序。我们在生产中使用这个。
编辑:仅供参考,我刚才问了这个问题( Can an Xcode .mobileprovision file be 'installed' from the command line? ),在没有人知道的情况下,我想出了上述问题:-)
更新:作为mpParse的替代品可以使用苹果工具:/usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin <<< $(security cms -D -i path_to_mobileprovision)
发布于 2017-03-02 09:58:56
如果您使用“从fastlane发出的叹息”,您可以将它的输出分配给变量provision_id=sigh
如果叹息有params:sigh(...),这也有效。
这是唯一对我有用的剧本:
`var=$(grep UUID -A1 -a -a grep -io "-A-Z0-9{36}")‘
与:"$var.mobileprovision"连用
https://stackoverflow.com/questions/11128284
复制相似问题