我需要使用应用名称及其实时版本进行报告。我的Apple ID在多个团队中被分配为管理员,我需要遍历每个应用商店团队中的所有应用,并获取其名称和实时版本。
我现在只能使用以下脚本为一个开发团队获取应用程序名称和版本,现在我需要为分配了Apple ID的所有开发团队获取应用程序名称和版本。
lane :get_apps_names_and_versions do |options|
require "spaceship"
all_apps = ""
Spaceship::Tunes::Application.all.collect do |app|
all_apps << "#{app.name} #{app.live_version.version} \n"
end
File.write('all_apps', all_apps[0..-3])
end
[我只是通过让所有团队进入并遍历他们,然后为每个团队获取应用来做到这一点。
lane :get_apps_names_and_versions do |options|
require "spaceship"
clientTunes = Spaceship::Tunes.login(options[:appleID],options[:password])
all_apps = ""
clientTunes.teams.each do |team|
ENV['FASTLANE_ITC_TEAM_ID'] = "#{team['contentProvider']['contentProviderId']}"
Spaceship::Tunes.select_team
Spaceship::Tunes::Application.all.collect do |app|
begin
live_version = app.live_version.version
all_apps << "#{app.name} #{live_version} #{app.bundle_id}\n"
UI.message "#{app.name} #{live_version} #{app.bundle_id}\n"
rescue
all_apps << "#{app.name} NO Live Version \n"
UI.message "#{app.name} NO Live Version \n"
end
end
end
File.write('all_apps', all_apps[0..-3])
end