Skip to content

Instantly share code, notes, and snippets.

@arpitdsoni
Created October 24, 2019 21:43
Show Gist options
  • Save arpitdsoni/d35c8083925580d7727425b392c01e6d to your computer and use it in GitHub Desktop.
Save arpitdsoni/d35c8083925580d7727425b392c01e6d to your computer and use it in GitHub Desktop.
Save all devices for a dev provisioning profile using fastlane
desc "Save all devices for a dev provisioning profile to devices.txt"
lane :get_devices_dev_profile do
require "spaceship"
Spaceship::Portal.login()
bundle_id = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier).first
profile = Spaceship::Portal.provisioning_profile.development.find_by_bundle_id(bundle_id: bundle_id).first
devices = profile.devices
File.open('devices.txt', 'w') do |f|
f.puts "Device ID\tDevice Name"
devices.each do |device|
f.puts "#{device.udid}\t#{device.name}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment