Skip to content

Instantly share code, notes, and snippets.

@pixelknitter
Forked from gorbster/find_dsym.sh
Created October 25, 2012 21:46
Show Gist options
  • Save pixelknitter/3955644 to your computer and use it in GitHub Desktop.
Save pixelknitter/3955644 to your computer and use it in GitHub Desktop.
Find a matching dSYM UUID in the Spotlight index
#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "1 argument (UUID) required, $# provided"
MDFIND=/usr/bin/mdfind
UUID=`echo ${1} |
sed -e 's/\([a-z0-9]\{8\}\)\([a-z0-9]\{4\}\)\([a-z0-9]\{4\}\)\([a-z0-9]\{4\}\)\([a-z0-9]\{12\}\)/\1-\2-\3-\4-\5/' | \
awk '{print toupper($0)}'`
${MDFIND} "${UUID}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment