fastlane 如何自动删除配置文件?

Fastlane How to automate the deletion of provisioning profile?

我处于需要自动删除应用商店配置文件的情况。 我尝试 fastlane match nuke distribution 但它撤销了证书,我只想删除配置文件。

这个脚本可以做到你需要传递 TeamID 和 bundellID

lane :delete_profiles do |options|
    require "spaceship" 
    ENV['FASTLANE_TEAM_ID'] = options[:team_id]
    Spaceship::Portal.select_team
    matching_profiles = Spaceship::Portal.provisioning_profile.app_store.find_by_bundle_id(bundle_id: options[:bundle_id])
    Spaceship::Portal.client.delete_provisioning_profile!(matching_profiles.first.id)
  end

fastlane delete_profiles bundle_id:'YourBundelID' team_id:'YourTeamId'

由于我的 Apple ID 被添加到多个团队,所以我只是 select 团队第一。 然后通过 ID 获取配置文件,然后将其删除。