通过find快速查找字符串

经常上 iOS-Runtime-Headers 看看私有API,有没有什么比较有意思的玩法,以前都是傻乎乎的一个个头文件去看。其实可以通过find来查找的。

1
find . -name "*.h" -print0 | xargs -0 grep "allInstalledApplications"

结果

1
2
./PrivateFrameworks/FrontBoard.framework/FBApplicationLibrary.h:- (id)allInstalledApplications;
./Frameworks/CoreServices.framework/LSApplicationWorkspace.h:- (id)allInstalledApplications;