I am running automated tests on iOS devices. I want to not have to always have all devices connected. So I want to find all device id's and then only start the process of building, deploying, and running tests if that device is connected.
So my question is, how can I find the device uuid's of all connected devices through a shell script?
Thanks!
Edit:
instruments
command is now deprecated, you should run instead
xcrun xctrace list devices
Previous answer:
If you have Xcode installed, you can use Instruments to get all known devices also. With
instruments -s devices
The answer from @KKendall set me on the right path. Here's a version with a single sed expression:
system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad)/,/Serial/s/ *Serial Number: *(.+)/\1/p'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With