mac下编译android源码

按照官网的配置来设置下载源码
然后编译报错,是因为xcode版本问题,最新的xcode版本的sdk是10.11,而android编译使用的是10.10最新,
详情查看build/core/combo/mac_version.mk

build_mac_version := $(shell sw_vers -productVersion)

mac_sdk_versions_supported :=  10.6 10.7 10.8 10.9 10.10
ifneq ($(strip $(MAC_SDK_VERSION)),)
mac_sdk_version := $(MAC_SDK_VERSION)
    ifeq ($(filter $(mac_sdk_version),$(mac_sdk_versions_supported)),)
$(warning ****************************************************************)
    $(warning * MAC_SDK_VERSION $(MAC_SDK_VERSION) isn't one of the supported $(mac_sdk_versions_supported))
$(warning ****************************************************************)
$(error Stop.)
endif

故可以下载低版本的xcode,然后点击显示包内容
进入目录/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs.
把老版本的xcode里面的MacOSX10.10.sdk拷贝进去再编译就可以了。

关于BuildNumber的问题,有个简单的办法,就是在执行make命令前制定,通过如下命令,指定为 当前用户名-xxxxxx:

export BUILD_NUMBER=${USER}-xxxxxxx

你可能感兴趣的:(mac下编译android源码)