Created
December 13, 2016 16:55
-
-
Save sgtsquiggs/5f215ffc0a4387740bce86a70a26a96e to your computer and use it in GitHub Desktop.
Fastlane action to download device UDIDs for the current team
This file contains 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 characters
module Fastlane | |
module Actions | |
class DownloadDevicesAction < Action | |
def self.run(params) | |
require 'spaceship' | |
ship = Spaceship::Portal.login(ENV['DELIVER_USER'], ENV['DELIVER_PASSWORD']) | |
ship.team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) | |
devices = ship.devices | |
for device in devices | |
puts "#{device['deviceNumber']}\t#{device['name']}" | |
end | |
path = File.absolute_path('devices.txt') | |
File.open(path, 'w') do |f| | |
f.puts "Device ID\tDevice Name" | |
devices.each do |device| | |
f.puts "#{device['deviceNumber']}\t#{device['name']}" | |
end | |
end | |
path | |
end | |
def self.description | |
"Download device list from Apple Dev Portal" | |
end | |
def self.details | |
[ | |
"This action allows you to download the full device list from Apple.", | |
"It's extra useful if you maintain your device list in a repo.", | |
].join(" ") | |
end | |
def self.return_value | |
"The downloaded device list path" | |
end | |
def self.authors | |
["sgtsquiggs"] | |
end | |
def self.is_supported?(platform) | |
platform == :ios | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment