Created
May 11, 2014 19:52
-
-
Save BlakeLucchesi/b65fd3ccf7f5fcd9856a to your computer and use it in GitHub Desktop.
Connected iDevice UDID
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 characters
| 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