Skip to content

Instantly share code, notes, and snippets.

@BlakeLucchesi
Created May 11, 2014 19:52
Show Gist options
  • Select an option

  • Save BlakeLucchesi/b65fd3ccf7f5fcd9856a to your computer and use it in GitHub Desktop.

Select an option

Save BlakeLucchesi/b65fd3ccf7f5fcd9856a to your computer and use it in GitHub Desktop.
Connected iDevice UDID
def connected_device_id
output = `system_profiler SPUSBDataType`
device_id = output.match(/Serial Number: ([\w\d]{40})/)
if device_id.nil?
puts "Sorry could not find any connected devices to perform build with.\n"
raise Exception.new('Could not find a local iOS device to compile the build against.')
else
puts "Found a connected iDevice with identifier: #{device_id[1]}\n"
device_id[1]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment