Yet Another Mach-O Unused ObjC Selector/Class/Protocol Detector. 检测ObjC无用方法、无用类、无用协议。
🐍 Snake, Yet Another Mach-O Unused ObjC Selector/Class/Protocol Detector.
ObjC Metadata * Classes ✔ * Protocols ✔ * Methods ✔ * Categories ✔ * Binding Info ✔ * ObjC-Specific Sections *
__objc_selrefs✔ *
__objc_superrefs✔ *
__objc_classrefs✔ *
__objc_classlist✔ *
__objc_catlist✔ *
__objc_protolist✔
See SnakeKit
brew tap flexih/tap && brew install snake
Usage: snake [-dscp] [-l path] path/to/binary ...-s, --selector Unused selectors -c, --class Unused classes -p, --protocol Unused protocoles -d, --duplicate Duplicate selectors -a, --allclass All Classes -l, --linkmap arg Linkmap file, which has selector size, library name -j, --json Output json format --help Print help
snake -l path/to/linkmap path/to/binary [-dscpa]
bin/snake -l demo/release/demo-LinkMap-normal-x86_64.txt demo/release/demo.app/demo -c ``` Total Lib Count: 1 Total Unused Class Count: 3
SceneDelegate UnusedClass ViewController
bin/snake -l demo/release/demo-LinkMap-normal-x86\_64.txt demo/release/demo.app/demo -sTotal Lib Count: 1 Total Class Count: 2 Total Unused Selector: 2
@ UnusedClass -[UnusedClass unusedMethOfUnusedClass] 6
@ UsedClass -[UsedClass unusedMeth] 6 ```
Used selectors
python2 storyboard.py path/to/x.storyboard
git clone --recursive https://github.com/flexih/Snake.git