Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
iTunesConnect: Receive the app identifier of the next app to be uploaded (Waiting for Upload status), since you can not specify which app you want to deploy next (http://stackoverflow.com/questions/7568420/how-to-perform-ios-app-validation-from-the-command-line#comment23525642_7569194)
# encoding: utf-8
require 'pty'
require 'pry'
command = "xcrun -sdk iphoneos Validation -online -upload -verbose notHere.ipa"
# upload it now: http://stackoverflow.com/questions/7568420/how-to-perform-ios-app-validation-from-the-command-line
output = ''
begin
PTY.spawn(command) do |stdin, stdout, pid|
begin
stdin.each do |line|
output += line
if line.include?"ExistingBundleIdentifier" or line.include?"ReservedBundleIdentifier"
identifier = line.split('"')[1]
puts identifier
exit
end
if line.include?"warning: Can't connect to iTunesConnect"
puts output
raise "Some error when trying to fetch the app identifier"
end
end
rescue Errno::EIO
binding.pry
puts "Errno:EIO error, but this probably just means " +
"that the process has finished giving output"
end
end
rescue PTY::ChildExited
puts "The child process exited!"
binding.pry
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.