class-dump is a command-line utility for examining the Objective-C segment of Mach-O files. It generates declarations for the classes, categories and protocols. This is the same information provided by using 'otool -ov', but presented as normal Objective-C declarations.ios
这是class-dump的官方解释,咱们用的最多就是作iOS的逆向工程。class-dump,是能够把Objective-C运行时的声明的信息导出来的工具。其实就是能够导出.h文件。用class-dump能够把未经加密的app的头文件导出来。app
官方网址:http://stevenygard.com/projects/class-dump/框架
class-dump的下载地址:http://stevenygard.com/download/class-dump-3.5.tar.gzide
点击下载后解压后会有class-dump和源码文件。将class-dump 复制到/usr/bin/class-dump。若是是OS X 10.11,由于没有/usr/bin文件夹的写权限,因此将class-dump复制到/usr/local/bin/class-dump便可。工具
同时打开Terminal,执行命令赋予其执行权限:加密
sudo chmod 777 /usr/bin/class-dumpcode
使用class-dump导出头文件的命令格式:orm
class-dump -H 须要导出的框架路径 -o 导出的头文件存放路径blog
1)找到DVTKit框架路径get
2)使用上述的操做命令格式
class-dump AppKit:
class-dump /System/Library/Frameworks/AppKit.framework
class-dump UIKit:
class-dump /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/Frameworks/UIKit.framework
class-dump UIKit and all the frameworks it uses:
class-dump /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/Frameworks/UIKit.framework -r --sdk-ios 4.3
class-dump UIKit (and all the frameworks it uses) from developer tools that have been installed in /Dev42 instead of /Developer:
class-dump /Dev42/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework -r --sdk-root /Dev42/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
以上就是安装并使用class-dump的所有过程,但愿对你们有所帮助。