Can an Xcode .mobileprovision file be 'installed' from the command line?

后端 未结 7 1185
野的像风
野的像风 2020-12-22 18:47

I\'m trying to automate the process of building apps for our clients using bash scripts running on a Mac Mini Server (OSX 10.7).

My script is based on the spectacul

相关标签:
7条回答
  • 2020-12-22 19:42

    If you don't want to download external dependencies (like Ben did), the following should work in most cases:

    uuid=`grep UUID -A1 -a adhoc.mobileprovision | grep -io "[-A-F0-9]\{36\}"`
    cp adhoc.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision
    

    Note that a UUID is composed of hexadecimal digits so the correct range is [-A-F0-9] and not [-A-Z0-9].

    Bonus: Download and install profiles

    Using the cupertino tool, the following snippet downloads all your distribution profiles from the Developer Portal and installs them.

    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
    

    cupertino (the ios command) can be installed with sudo gem install cupertino.

    0 讨论(0)
提交回复
热议问题