-
-
Save j796160836/fdcb6d10685cb823938273bd6c56b0a8 to your computer and use it in GitHub Desktop.
getudid
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
#!/bin/bash | |
function getUDID { | |
udid=($(system_profiler SPUSBDataType | grep -A 11 -w "iPad\|iPhone\|iPad" | grep "Serial Number" | awk '{ print $3 }')) | |
if [ -z $udid ]; then | |
echo "No device detected. Please ensure an iOS device is plugged in." | |
exit 1 | |
else | |
for i in "${udid[@]}"; do | |
echo -n $i | pbcopy | |
echo "UDID: $i" | |
done | |
fi | |
} | |
getUDID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment