After the installation, the corresponding environment, we can start to create the cocos2d-x android project into the cocs2d-x directory, open the create-android-project.bat with a text editor (on windows 7 if you double-click normally, some files may not be created due to insufficient permissions. You can add cd/d % ~ to the first line of the file ~ Dp0, right-click it and run it as an administrator.) Find the following definitions: @ echo off: This script is used to create an android project.: You shoshould modify _ ANDROIDTOOLS _ CYGBIN _ NDKROOT to work under your environment.: Don't change it until you know what you do. cd/d % ~ Dp0setlocal: Check if it was run under cocos2d-x rootif not exist "'% \ create-android-project.bat" echo Error !!! You shoshould run it under cocos2dx root & pause & exit 2 if not exist "% ~ Dpn0.sh "echo Script" % ~ Dpn0.sh "not found & pause & exit 3: modify it to work under your environment set _ CYGBIN = D: \ cygwin \ binif not exist "% _ CYGBIN %" echo Couldn't find Cygwin at "% _ CYGBIN %" & pause & exit 4 :: modify it to work under your environmentset _ ANDROIDTOOLS = E: \ android-sdk-windows \ toolsif not exist "% _ ANDROIDTOOLS %" echo Couldn't find android sdk tools at "% _ ANDROIDTOOLS %" & pause & exit 5 :: modify it to wo Rk under your environmentset _ NDKROOT = E: \ android-ndk-r8-windows \ android-ndk-r8if not exist "% _ NDKROOT %" echo Couldn't find ndk at "% _ NDKROOT %" & pause & exit 6:: create android projectset/P _ PACKAGEPATH = Please enter your package path. for example: org. cocos2dx. example: set/P _ PROJECTNAME = Please enter your project name: if exist "% \ % _ PROJECTNAME %" echo "% _ PROJECTNAME %" exists, please use another Name & pause & exit 7 echo "Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 & 3.0" echo "Other versions have not tested. "call" % _ ANDROIDTOOLS % \ android. bat "list targetsset/P _ TARGETID = Please input target id: set _ PROJECTDIR = %%%_ PROJECTNAME % echo Create android projectcall" % _ ANDROIDTOOLS % \ android. bat "create project-n % _ PROJECTNAME %-t % _ TARGETID %-k % _ PACKAGEPATH %-a % _ PROJECTNAME %-p % _ PROJ ECTDIR %: Resolve ___. sh to/cygdrive based * nix path and store in % _ CYGSCRIPT % for/f "delims =" % A in ('% _ CYGBIN % \ cygpath.exe "% ~ Dpn0.sh "') do set _ CYGSCRIPT = % :: resolve current dir to cygwin pathfor/f "delims =" % A in ('% _ CYGBIN % \ cygpath.exe "� %"') do set _ CURRENTDIR = % :: resolve ndk dir to cygwin pathfor/f "delims =" % A in ('% _ CYGBIN % \ cygpath.exe "% _ NDKROOT % "') do set _ NDKROOT = % A: Throw away temporary env vars and invoke script, passing any args that were passed to usendlocal & % _ CYGBIN % \ bash -- login "% _ CYGSCRIPT %" % _ CURRENTDIR % _ PROJECTNAME % _ NDKROOT % _ PACKAGEPATH %" windows "pause