Created
October 12, 2011 15:15
-
-
Save coreycollins/1281472 to your computer and use it in GitHub Desktop.
Revisions
-
coreycollins created this gist
Oct 12, 2011 .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,47 @@ require 'csv' require 'watir-webdriver' require 'fileutils' require 'net/http' ####### USAGE ####### # # ruby autoprovison.rb ids.txt # ##################### IOS_PROVISIONING_DISTRIBUTION_URL = "https://developer.apple.com/ios/manage/provisioningprofiles/viewDistributionProfiles.action" puts "Navigating to apple portal" b = Watir::Browser.start(IOS_PROVISIONING_DISTRIBUTION_URL) unless b.title =~ /.*App IDs - iOS Provisioning Portal - Apple Developer.*/ puts "Logging in.." b.text_field(:name, "theAccountName").set "#####USERNAME#####" b.text_field(:name, "theAccountPW").set "#####PASSWORD#####" b.send_keys :enter end CSV.foreach(ARGV[0]) do |row| begin id = row[0] sleep(7) puts " Adding new distribution profile...#{id}" b.link(:id, "index_").click puts " Filling in profile name." b.text_field(:name, "provisioningProfileName").set id puts " Selecting app id." b.select_list(:name, "cfBundleDisplayId").select_value id puts " Saving." b.button(:id, "save_submit").click rescue Exception => exp puts exp.message end end