Cocos2d-x Learning Notes (Android Automated Packaging bat script)

Source: Internet
Author: User

1, first according to COCOS2D-X environment configuration requirements (ant, etc.) installed, and then in the Android directory proj.android new BUILD.bat, the script is as follows:

@echo  offecho  prepare to start  echo  set path set root_path= "F:\test" set project_path= "%root_path %\proj.android "set resources_path="%root_path%\resources "set cocos2dx_path="%ROOT_PATH%\cocos2d\ Cocos\platform\android\java "Set today=%date:~0,4%%date:~5,2%%date:~8,2%set finishdir=" F:\test2\% today% "echo  Delete Android Project Assets folder echo #################################################### #if   exist %project_path%\assets  (      del /q /f %project_ Path%\assets     dir %project_path%\assets /ad /b /s > del.txt     for /f %%i in  (del.txt)  do rd %%i  /s /q) echo  Delete complete echo #################################################### #echo   Copy the latest resource resources to the Android Project Assets folder echo #################################################### #ping  -n  3 127.0.0.1>nulcall xcopy  %resources_path% %project_path%\assets /e /y echo  Copy Complete echo # ################################################### #echo  ndk compiling so files echo ############################# ####################### #ping  -n 3 127.0.0.1>nulpushd %project_path%call ndk-build  -j4 NDK_DEBUG=0echo  Compile Complete popdecho ######################################################## ########################################################### #echo   Update Android Project echo ################### ################################################################################################# ping  -n 3 127.0.0.1>nulpushd %COCOS2DX_PATH%  call android update  project --name testgame -t 1 -p %project_path%popdecho  Update Complete echo ###### ############################################## #echo   Delete bin folder echo ################################### ############### # #ping  -n 3 127.0.0.1>nulif exist %PROJECT_PATH%\bin  (      del /q /f %project_path%\bin) echo  Delete complete echo ############################## ###################### #pushd  %PROJECT_PATH%echo  Generate release  version apkecho ###################### ############################## #ping  -n 3 127.0.0.1>nulcall ant release   popdecho  generate release complete echo #################################################### #echo   Copy apk to the specified directory echo #################################################### #if  not exist % finishdir%  (      md %finishdir%) copy  "%PROJECT_PATH%\bin\ testgame-release.apk " %finishdir%echo #################################################### #echo   Execution complete!!!  pause


2, set the signature information, open ant.properties add the following:

Key.store=e:/cocos/test.keystore#keystore password Key.store.password=123456#alias name key.alias=androiddebugkey#alias password key.alias.password=123456


Cocos2d-x Learning Notes (Android Automated Packaging bat script)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.