How to download all iOS Provisioning Profiles? under Apple account

how to download all iOS Provisioning Profiles? under Apple account

sometimes new test equipment is added, and then you have to download it from Apple"s website, and the baler needs to be updated. Can you use the command on the terminal to update all Provisioning Profiles??


I have found a solution myself, and I can use spaceship to do this.

before we can use it, we first need to install fastlane with gem.

sudo gem install fastlane

then write the following code to run and download all the iOS Provisioning Profiles under the Apple account locally

require "spaceship"

def downloadProfiles(account, psw)
    puts Spaceship.login(account, psw)

    downloadProfiles = Array.new
    downloadProfiles += Spaceship.provisioning_profile.development.all
    downloadProfiles += Spaceship.provisioning_profile.ad_hoc.all

    downloadProfiles.each do |p|
        puts "Downloading -sharp{p.uuid}"
        File.write("/Users//Library/MobileDevice/Provisioning Profiles/-sharp{p.uuid}.mobileprovision", p.download)
    end
end

-sharp  ID 
downloadProfiles "Your Apple Account", "Your PSW"
Menu