This applies to version 2.1.1. Tested and working.
If you already use Mingw32, installing Cygwin is an innecesary step (and probably, headache).
This takes a few minutes.
Open create-android-project.bat
Modify the following line (to use Mingw32 instead of cygwin):
Replace C:with your Mingw installation path.
set _CYGBIN=e:\cygwin\bin
with
set _CYGBIN=C:\MinGW\msys\1.0\bin
Modify the following three lines:
Replace /d/dev/cocos2d-2.1beta3-x-2.1.1/ with your current cocos2d-x path.
1.
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%~dpn0.sh"') do set _CYGSCRIPT=%%A
with
set _CYGSCRIPT="/d/dev/cocos2d-2.1beta3-x-2.1.1/create-android-project.sh"
2.
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%cd%"') do set _CURRENTDIR=%%A
with
set _CURRENTDIR="/d/dev/cocos2d-2.1beta3-x-2.1.1/"
3.
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%_NDKROOT%"') do set _NDKROOT=%%A
with
set _NDKROOT="/d/dev/android-ndk-r8d"
Replace /d/dev/android-ndk-r8d with you current NDK path.
Just run the bat file and you’re done!
Using Mingw with new Android projects (v2.1.2) is even easier than using Cygwin.
You can also use this for latest version 2.1.2, even though we have a new project-creator python script (which I recommend using).
Mingw32 also work with the new Android projects as described here:
https://github.com/cocos2d/cocos2d-x/blob/master/samples/Cpp/HelloCpp/proj.android/README.md
Just append the Mingw msys bin directory to path, instead of cygwin’s
C:.0\bin (or whatever path you installed it too).
And skip Cygwin installation and all related steps (no need to modify Cygwin\etc\fstab, neither adding CYGWIN and SHELLOPTS variables to eclipse’s enviroment variables)