iOS开发常用Mac终端命令

  常用命令:

  1、grep -lr "prefs:root=" *

    cd 当某一文件夹下,在当前文件目录下搜索对应的内容(橘色字符串替换为你想要搜索的内容)。可以用来搜索工程中在第三方类库中用到的私有API。

  2、把对应的 Objective-C .m 文件编译成 cpp 文件

  clang -x objective-c -rewrite-objc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk ViewController.m

     cd 到要编译的文件目录下,把红色部分替换成对应的要编译的.m文件

原文地址:https://www.cnblogs.com/ZachRobin/p/9717171.html