使用.mobileprovision文件提供xcodebuild [英] Provide xcodebuild with .mobileprovision file
问题描述
我正在设置Jenkins以自动化iOS版本。是否有可能提供未添加到Xcode中的配置工具的.mobileprovision文件到xcodebuild?
I am setting up Jenkins for automating iOS builds. Are there any possibility to provide a .mobileprovision file that is not added to the provisioning tool in Xcode to xcodebuild?
我知道我可以使用PROVISIONING_PROFILE和PROVISIONING_PROFILE [sdk = iphoneos *]但他们需要将配置文件添加到管理器。
I know that I can use PROVISIONING_PROFILE and PROVISIONING_PROFILE[sdk=iphoneos*] but they require the provisioning profile to be added to the Organizer.
我知道我可以使用xcrun进行操作。但在运行xcrun之前,我必须使用xcodebuild成功签署应用程序。
I know that I can do the operation with xcrun. But before running xcrun I must successfully sign the app with xcodebuild.
有什么方法可以将配置文件(.mobileprovision)提供给xcodebuild吗?
推荐答案
我们有一个解决方案 - 基本上你需要做的是通过将.mobileprovision文件复制到以UUID为名的目录来'安装'.mobileprovision文件。移动配置文件。这就是当您双击.mobileprovision文件时Xcode Organizer实际执行的操作。
We have a solution for this - essentially what you need to do is to 'install' the .mobileprovision file by copying it to a directory named after the UUID of the mobile provision file. This is what the Xcode Organizer actually does when you double-click a .mobileprovision file.
有一个名为mpParse的程序可以从mobileprovision文件中提取UUID脚本使用 - 链接在代码中下载。然后将mobileprovision文件复制到正确的位置很简单。
There's a little program called mpParse that can extract the UUID from the mobileprovision file that the script uses - link for download in the code. Then it's dead simple to copy the mobileprovision file to the correct place.
这是我做的shell脚本:
Here's a shell script I made to do this:
#!/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
运行脚本后,可以使用PROVISIONING_PROFILE和xcodebuild中的PROVISIONING_PROFILE [sdk = iphoneos *]来创建你的应用程序。我们在生产中使用它。
Once you've run the script, you can use PROVISIONING_PROFILE and PROVISIONING_PROFILE[sdk=iphoneos*] in xcodebuild to create your app. We use this in production.
编辑:仅供参考,我在这里回答了这个问题(可以从命令行安装Xcode .mobileprovision文件吗?)并且当没有人知道时提出上述内容: - )
Just for reference, I asked essentially this question here a little while back ( Can an Xcode .mobileprovision file be 'installed' from the command line? ) and came up with the above when no-one seemed to know :-)
更新:
作为替代mpParse可以使用苹果工具:
/ usr / libexec / PlistBuddy -c'打印UUID'/ dev / stdin<<< $(security cms -D -i path_to_mobileprovision)
这篇关于使用.mobileprovision文件提供xcodebuild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!