在编译webrtc ios的过程工遇到的问题
编译 gn gen out/ios_64 --args='target_os="ios" target_cpu="arm64"
出线错误
ERROR at //build/config/ios/ios_sdk.gni:100:21: Script returned non-zero exit code.
_ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")
^----------
Current dir: /Users/lenkeng/Documents/webrtc_build/webrtc/src/out/ios_64/
Command: python -- /Users/lenkeng/Documents/webrtc_build/webrtc/src/build/config/mac/sdk_info.py iphoneos
Returned 1.
stderr:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Traceback (most recent call last):
File "/Users/lenkeng/Documents/webrtc_build/webrtc/src/build/config/mac/sdk_info.py", line 69, in
FillXcodeVersion(settings)
File "/Users/lenkeng/Documents/webrtc_build/webrtc/src/build/config/mac/sdk_info.py", line 26, in FillXcodeVersion
lines = subprocess.check_output(['xcodebuild', '-version']).splitlines()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['xcodebuild', '-version']' returned non-zero exit status 1
See //build/config/ios/rules.gni:5:1: whence it was imported.
import("//build/config/ios/ios_sdk.gni")
^--------------------------------------
See //webrtc/webrtc.gni:32:3: whence it was imported.
import("//build/config/ios/rules.gni")
^------------------------------------
See //BUILD.gn:9:1: whence it was imported.
import("webrtc/webrtc.gni")
^-------------------------
出现这个问题主要是由于xcode-select 路径配置有问题
https://github.com/meteor/meteor/issues/7905
经查,修改一下xcode-select path
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/