Parsing mobileprovision files in bash?

后端 未结 6 604
一个人的身影
一个人的身影 2020-12-02 14:32

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 p

6条回答
  •  清歌不尽
    2020-12-02 15:26

    One solution among many...

    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.

    After that, trim the line of brackets and whitespace using sed.

    Using a series of pipes:

    egrep -a -A 2 ApplicationIdentifierPrefix file.mobileprovision | grep string | sed -e 's///' -e 's/<\/string>//' -e 's/ //'
    

提交回复
热议问题