Clang Objective-C 转换成C++

  1. 指定真机
xcrun -sdk iphoneos clang -rewrite-objc xxxx.m
  1. 指定模拟器
xcrun -sdk iphonesimulator clang -rewrite-objc xxxx.m
  1. 指定SDK版本
    (1) 查看当前机器已安装的 SDK
xcodebuild -showsdks

// 结果
iOS SDKs:
    iOS 12.1                        -sdk iphoneos12.1

iOS Simulator SDKs:
    Simulator - iOS 12.1            -sdk iphonesimulator12.1

macOS SDKs:
    macOS 10.14                     -sdk macosx10.14

tvOS SDKs:
    tvOS 12.1                       -sdk appletvos12.1

tvOS Simulator SDKs:
    Simulator - tvOS 12.1           -sdk appletvsimulator12.1

watchOS SDKs:
    watchOS 5.1                     -sdk watchos5.1

watchOS Simulator SDKs:
    Simulator - watchOS 5.1         -sdk watchsimulator5.1

(2) 指定版本

xcrun -sdk iphonesimulator12.1 clang -rewrite-objc xxxx.m

你可能感兴趣的:(Clang Objective-C 转换成C++)