clang -rewrite-objc main.m
可能报错:main.m:9:9: fatal error: 'UIKit/UIKit.h' file not found
下面是在网上其他大神记录的,亲测可用!
指定真机
xcrun -sdk iphoneos clang -rewrite-objc main.m
指定模拟器
xcrun -sdk iphonesimulator clang -rewrite-objc main.m
指定SDK版本
xcrun -sdk iphonesimulator10.3 clang -rewrite-objc main.m