LoginSignup
8

More than 5 years have passed since last update.

posted at

provisioning profileからName/UUIDを抽出する

やり方

UUIDの抽出

$ xmllint <(security cms -D -i your.mobileprovision) --xpath '/plist/dict/key[text()="UUID"]/following-sibling::string[position()=1]/text()'

Nameの抽出

$ xmllint <(security cms -D -i your.mobileprovision) --xpath '/plist/dict/key[text()="Name"]/following-sibling::string[position()=1]/text()'

解説

  • provisioning profileはそのままだと、plutilコマンドなどでparseできない。
  • securityコマンドで一度textに変換する。
  • 変換結果は Process Substitution を用いて標準出力からファイルディスクリプタとしてかませる
  • xmllintのxpathオプションで対象のKeyの名前のノードの兄弟ノードのテキストを抽出する。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
8