Skip to content

Instantly share code, notes, and snippets.

@mmmulani
Created December 14, 2014 16:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmmulani/9cbb5e4083b172c9a076 to your computer and use it in GitHub Desktop.
Save mmmulani/9cbb5e4083b172c9a076 to your computer and use it in GitHub Desktop.
Generates a class-dump for all of Xcode along with C symbols
#!/bin/bash
# Run this with:
# find /Applications/Xcode.app/ -type f -perm -100 -exec ./extract.sh '{}' \;
# Afterwords run: (to remove all empty directories)
# find . -d -type d -empty -exec rmdir {} \;
APP=$1
BASE_DIR=`pwd`
OUTPUT=$(file "$APP")
if [[ $OUTPUT == *Mach-O* ]]; then
TARGET_DIR=$BASE_DIR"/"$APP
mkdir -p "$TARGET_DIR"
class-dump -H -o "$TARGET_DIR" "$APP" > /dev/null
nm -g -U -j "$APP" > "$TARGET_DIR"/exported_symbols.h
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment