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

时间:2020-02-04 09:56:04

标签: ios provisioning-profile fastlane

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

1 个答案:

答案 0 :(得分:1)

此脚本可以做到,您需要传递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已添加到多个团队,因此我只选择第一个团队。 然后通过ID获取配置文件,然后将其删除。