1. 新建build_release.bat,首先将res和src拷贝到assets下,然后调用ndk的编译方法。内容如下 rd /s /q assets xcopy "../../../res" "assets/res" /e /i /h xcopy "../../../src" "assets/src" /e /i /h ::cocos compile --no-res --compile-script 0 -m release -p android goto build :build_error pause :build call %NDK_ROOT%/ndk-build.cmd -j2 NDK_MODULE_PATH=../../cocos2d-x;../../cocos2d-x/cocos/;../../cocos2d-x/external;../../cocos2d-x/cocos/scripting NDK_TOOLCHAIN_VERSION=4.8 if errorlevel 1 goto build_error call %ANT_ROOT%/ant release if errorlevel 1 goto build_error 2. 修改ant.properties,设置签名文件所在目录 # This file is used to override default values used by the Ant build system. # # This file must be checked into Version Control Systems, as it is # integral to the build system of your project. # This file is only used by th