问题1. 执行xcodebuild
报错
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
解决1. 终端执行如下命令
// Install Xcode
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
问题2. 执行clang -rewrite-objc main.m
报错
➜ CopyPropertyForNSStringDemo clang -rewrite-objc main.m
main.m:9:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
^
1 error generated.
解决2. 添加相应SDK
xcrun -sdk iphoneimulator clang -rewrite-objc main.m