我正在尝试使用运行在Mac Mini Server (OSX 10.7)上的bash脚本自动化为我们的客户构建应用程序的过程。
我的脚本是基于最初发布在https://gist.github.com/949831上的github非常有用的脚本
我使用xcodebuild构建应用程序,然后使用xcrun签名并嵌入mobileprovision文件。
当我使用GUI (例如双击)手动安装到Xcode中的mobileprovision文件时,它工作得很好。如果我简单地尝试使用复制到服务器上的带有SCP的profile配置文件,它将失败(Code Sign error:无法找到配置配置文件'123abc123‘)。
这可能是因为文件没有“安装”。
有没有办法从终端安装mobileprovision文件?我使用的是SSH,所以使用'open‘命令这样的命令将不起作用。
谢谢!
发布于 2012-05-01 23:18:12
自从提出这个问题以来,我已经自己构建了一个解决方案。秘诀是简单地将文件复制到~/Library/MobileDevice/Provisioning Profiles/文件夹,但(这里有点棘手)重命名为UUID.mobileprovision。
UUID保存在文件本身的文本部分中(在plist中)。不幸的是,该文件还包含二进制文件,因此“默认读取”无法读取它。幸运的是,this guy构建了一个小的命令行实用程序来获取UUID (以及其他一些东西)。
下面是我的完整工作脚本:
发布于 2012-05-27 23:17:23
如果你不想下载外部依赖项(就像Ben那样),下面的方法在大多数情况下都可以用:
uuid=`grep UUID -A1 -a adhoc.mobileprovision | grep -io "[-A-F0-9]\{36\}"`
cp adhoc.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision请注意a UUID is composed of hexadecimal digits,因此正确的范围是[-A-F0-9]而不是[-A-Z0-9]。
奖励:下载并安装配置文件
下面的代码片段使用cupertino tool从开发人员门户下载所有分发配置文件并安装它们。
ios profiles:download:all --type distribution
for file in *.*provision*; do
uuid=`grep UUID -A1 -a "$file" | grep -io "[-A-F0-9]\{36\}"`
extension="${file##*.}"
echo "$file -> $uuid"
mv -f "$file" ~/Library/MobileDevice/Provisioning\ Profiles/"$uuid.$extension"
done库比蒂诺( ios命令)可以与sudo gem install cupertino一起安装。
发布于 2014-10-04 20:12:26
所有其他答案的概要update_provisioning_profile.sh
#!/bin/sh
#
# Download and install a single iOS provisioning profile
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile
# Configure the team identifier
# Copy it from developer portal or just use cupertino to get it:
# ios devices
# Copy the string in parens and set it as TEAM
TEAM="team id"
# Configure the profile name you want to manage
# Copy it from developer portal or use cupertino to get a list (ignoring Xcode managed profiles):
# ios profiles --team ${TEAM} | grep -v 'iOS Team Provisioning Profile'
# Copy the name as-is and set as PROFILE
PROFILE="profile name"
# Fetch the profile using `cupertino` tool
# you need to run `ios login` once to setup the account
ios profiles:download "${PROFILE}" --team ${TEAM}
PROFILE_FILE=`echo $PROFILE | tr ' ' '_'` # `cupertino` tool will replace spaces with _
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ${PROFILE_FILE}.mobileprovision)`
# copy where Xcode can find it
cp ${PROFILE_FILE}.mobileprovision "$HOME/Library/MobileDevice/Provisioning Profiles/${UUID}.mobileprovision"
# clean
rm ${PROFILE_FILE}.mobileprovision易于适应您的配置需求。
https://stackoverflow.com/questions/10398456
复制相似问题