How to install developer certificate/private key and provisioning profile for iOS development via command line?

后端 未结 3 1620
Happy的楠姐
Happy的楠姐 2020-12-12 13:25

I\'m configuring automated build server for iOS application project. I\'ve done most of it. Now, it\'s the final round. The security.

Developer certificate/private k

3条回答
  •  自闭症患者
    2020-12-12 13:42

    Install certificate using command line:

    security unlock-keychain -p 
    security import my_certificate.p12 -k ~/Library/Keychains/login.keychain -P my_password -T /usr/bin/codesign
    

    Install mobile provision profile:

    The simple way:

    #install profiles, will trigger xcode to install the profile
    open "my_profile1.mobileprovision"
    
    # wait for xcode to process the request
    sleep 3
    
    # shut down xcode (optional)
    kill $(ps aux | grep 'Xcode' | awk '{print $2}')
    

    The complex way:

    PROVISION_FILE ="my_profile.mobileprovision"
    
    uuid=`security cms -D -i ${PROVISION_FILE } | grep -aA1 UUID | grep -o "[-a-zA-Z0-9]\{36\}"`
    
    cp "$PROVISION_FILE " ~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision
    

提交回复
热议问题