This file contains 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 | |
# This script checks the binary and all nested frameworks for duplicated classes (both ObjectiveC and Swift). | |
# The script fails if it finds any duplicated classes. | |
function print_classes() { | |
otool -ov "$1" | | |
sed -n '/Contents of (__DATA,__objc_classlist)/,/Contents of/p' | # all lines for (__DATA,__objc_classlist) section | |
egrep '^[0-9]' | # take just a class header | |
cut -d ' ' -f 3 | # take just a symbol name |