解析在bash mobileprovision文件? [英] Parsing mobileprovision files in bash?
问题描述
我绑建立一个PHP / bash的/ MySQL系统自动化即席分布iPhone应用程序。但我想,按照该阅读项目mobileprovision文件的应用程序标识符键,改变Info.plist文件。
I am tying building a php/bash/mysql system for automating adhoc distribution for iPhone apps. But I want to read the application-identifier key in mobileprovision file of projects and change it info.plist file according to that.
我目前可以从PHP构建IPA文件如果cfbundleidentifer关键是与它提供的文件。
I can currently build ipa files from php IF the cfbundleidentifer key is same as its provision file.
我发现了一个code这样的 https://gist.github.com/711794 但我想bash脚本将它集成到我的系统。
I found a code like this https://gist.github.com/711794 but I want bash script to integrate it to my system.
感谢
推荐答案
一个在许多解决方案...
One solution among many...
使用egrep的-a选项,对待像文本文件,二进制文件和-A 2',这将显示字符串后,两行要匹配:ApplicationIdentifier preFIX
Use egrep with the -a option, which treats binary files like text files and '-A 2' which will display the two lines after the string you want to match: ApplicationIdentifierPrefix.
在此之后,使用SED修剪支架的线和空白。
After that, trim the line of brackets and whitespace using sed.
使用一系列管道
egrep -a -A 2 ApplicationIdentifierPrefix file.mobileprovision | grep string | sed -e 's/<string>//' -e 's/<\/string>//' -e 's/ //'
这篇关于解析在bash mobileprovision文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!