Created
August 19, 2019 19:58
-
-
Save andrewgrant/f842d87f48c4d54256e8d37c6d0d9f95 to your computer and use it in GitHub Desktop.
Revisions
-
andrewgrant created this gist
Aug 19, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ # Uncomment the line if you want fastlane to automatically update itself # update_fastlane require 'spaceship' default_platform(:ios) platform :ios do desc "Pulls a list of all devices from our accounts and dedupes them " lane :dump_devices do device_list = {} launcher = Spaceship::Launcher.new("[email protected]", "password") teams = ["ABCDE12345", "ABCDE12345", "ABCDE12345"] teams.each { |team| # select_team will prompt for a team, unless we set this var first... # (either way it needs to be called to update internal state) team_id team launcher.select_team() devices = launcher.device.all #Loop through all devices from account and add them to our hash devices.each { |device| if !device_list.has_key? device.udid device_list[device.udid] = device end } } open('device_list.csv', 'w') { |f| device_list.each do |key, device| f.printf("%s|%s|%s|%s\n", device.udid, device.name, device.platform, device.model) end printf("Wrote %d devices", device_list.keys.count) } end end