Created
May 15, 2012 03:37
-
-
Save jonathanpenn/2698887 to your computer and use it in GitHub Desktop.
Ruby script that fetches the UUID of the first iOS device plugged into your machine
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
#!/usr/bin/env ruby | |
ioreg = `ioreg -w 0 -rc IOUSBDevice -k SupportsIPhoneOS` | |
device_uuid = ioreg[/"USB Serial Number" = "([0-9a-z]+)"/] && $1 | |
if device_uuid | |
puts device_uuid | |
else | |
puts "No device detected." | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment