ãã建议ï¼ä¸ºé¿å
å®å
¨ç¸å
³é®é¢ï¼æææä½è¯·å¨ç®¡çå身份ä¸è¿è¡ï¼å¨è¿è¡å½ä»¤æ¶ï¼è¯·ç¡®ä¿ä»¥ç®¡çå身份æå¼æ§å¶å°ï¼consoleï¼ã
æ¬æåå°ä»ç»å¦ä½å¨Windows 7å¹³å°æ建Cocos2d-x Androidå¼åç¯å¢ãæ¬æåæä½è¦æ±ä¸å°æè½½Windows 7å¹³å°åå®è£
Visual Studio 2012/2013ççµèãæ好æ¥æå¿«é稳å®çç½ç»ï¼å 为å¨æåæä½ä¸éè¦ä¸è½½è®¸å¤è½¯ä»¶å
ã
ããæ建å¼åç¯å¢éè¦å®è£
å·¥å
·å
æ¬
ããVisual Studio 2012/2013 âââ å 为Cocos2d-x-v3.xå¼æä¸è½ç¨èçæ¬çVSç¼è¯ï¼æ以æ们éè¦ä¸è½½å®è£
Visual Studio 2012æ2013ãVSçå®è£
ç®åï¼æ¬æç¨ä¸å讲解ã
ããCocos2d-x âââæ¬æç¨ä»¥Cocos2d-x 3.2alpha0çæ¬ä¸ºä¾
ããJAVA JDK
ããAndroid SDK
ããNDK
ããä¸è½½Cocos2d-x 3.2alpha0å¼æ
ããç¨æ·å¯ä»¥ç»éCocos2d-x å®æ¹ç½ç«ä¸è½½ææ°ççCocos2d-xãç¹å»å¯¼èªæ çâDownloadâ
ããå¨æ¬æåä¸ï¼å°ä¼ä»¥ç®åææ°çæ¬çCocos2d-x 3.2alpha0å¼æ为ä¾ã
ï¼æ³¨æï¼å¦æä½ æ³è¦ä¸è½½æ§ççCocos2d-xï¼å¯ç¹å»âlooking for an old versoin?âé¾æ¥ãä½æ¬äººå¼ºçæ¨è使ç¨ææ°çæ¬çCocos2d-xï¼æ°çå¼ææå¾å¤æ°åè½ï¼ä¿®å¤äºæ§ççå¾å¤é®é¢ãï¼
ããå³é®åå»âDownloadâé¾æ¥éæ©âsave link asâ¦âï¼å°é¾æ¥ä¿å为â¦ï¼ï¼ç¶åå°å缩æ件ä¿åè³éå½çä½ç½®ãæ¬æºä¿åä½ç½®ä¸º D:\Cocos2d-x\Cocos2d-x 3.2alpha0ã
ããï¼æ³¨æï¼è¯·ä¸è¦å°Cocos2d-xæ件夹æ¾ç½®c:\ä¸ï¼å 为ä¼å¯¼è´å¾å¤ä¼å
级å«ï¼privilegeï¼ç¸å
³çé®é¢ãå¯å°è¯å°è¯¥æ件夹æ¾å°å
¶ä»çå¦D:\åE:\ççãï¼
ããæå¼ âD:\Cocos2d-x\Cocos2d-x 3.2alpha0\buildâç®å½ï¼å¦ä¸æ示ï¼
ããåå»âcocos2d-win32.vs2012.slnâæ件ï¼ç¶åä¼èªå¨å¯å¨Visual Studio 2012/2013ã
ç°å¨ä½ 便å¯ä»¥å°HelloCpp项ç®å½ä½é»è®¤å¯å¨é¡¹ç®æ¥ç¼è¯ï¼æCTRL-F5è¿è¡æ ·æ¬ç¨åºãå¦æç¼è¯æ²¡æä»ä¹é误ï¼åæ¶è¿è¡æåçè¯ï¼ä½ ä¼çå°å¦ä¸ç»é¢ã
ããç¥è´ºä½ ï¼ä½ å·²æåå¨Windows 7å¹³å°ä¸è¿è¡Cocos2d-xå¼æãæ¥ä¸éä»ç»å¦ä½é
ç½®Androidå¼åç¯å¢ã
ããå®è£
é
ç½®JAVA JDK
ããå 为æ们æ¯é对Androidå¼åï¼æ以æ们éè¦å®è£
ç第ä¸ä¸ªè½¯ä»¶å
ç»å¯¹æ¯JDKãå¦æä½ ç¨çæ¯64ä½çWindows 7ï¼é£åºè¯¥ä¸è½½ä»¥ä¸çæ¬è½¯ä»¶64 bit JDK for windows 64bit
ããä¸è½½å®æä¹åï¼åå»exeæ件å®è£
JDKï¼æ³¨ææ好ä¸è¦å°å
¶å®è£
å¨æç©ºæ ¼æè
ä¸ææ件夹ä¸ï¼å
¶ä»æ éå¶ï¼æ³¨æè®°ä¸å
¶å®è£
è·¯å¾ï¼æ¬æºå®è£
è·¯å¾ä¸ºï¼D:\Program Files\Java\jdk1.7.0_51\
é
ç½®ç¯å¢åéï¼
ããæ°å»ºç¯å¢åéï¼JAVA_HOME å¼ä¸ºï¼D:\Program Files\Java\jdk1.7.0
æ°å»ºç¯å¢åéï¼CLASSPATH å¼ä¸ºï¼.;%JAVA_HOME%\lib;ï¼æ³¨æï¼ç¹å·è¡¨ç¤ºå½åç®å½ï¼ä¸è½çç¥ï¼
å¨ç³»ç»åéPathçå¼çåé¢å å
¥ä»¥ä¸å
容ï¼%JAVA_HOME%\bin;(注æ:è¿éçåå·ä¸è½çç¥)å°è¿éï¼JDKå®è£
å®æ¯ã
ããåå»âå¼å§ââ>âè¿è¡ââ>è¾å
¥ï¼cmdå½ä»¤ï¼å¨CMDçªå£ä¸è¾å
¥ï¼java -version
ãã
ããé
ç½®Android SDKç¯å¢
ããä¸è½½Android SDKä¸è½½ä¹å解åï¼å¹¶å°å
¶æ¾ç½®äºä½ è¦æ¾ç½®çç®å½ä¸ï¼å¨ â..\adt-bundle-windows-x86_64-20131030\eclipseâ æ件夹ä¸ä¼æä¸ä¸ªeclipse.exeç¨åºï¼æ¬æºå¨æ¡é¢ä¸å建äºè¯¥ç¨åºçå¿«æ·æ¹å¼ã
ããç°å¨å°±å¯ä»¥åå»æ¡é¢çå¿«æ·æ¹å¼å¯å¨Eclipseï¼åæ¶ä¼åºç°ä¸ä¸ªå³æ¶å¯¹è¯æ¡ï¼è¦æ±è®¾ç½®é»è®¤å·¥ä½åºï¼workspaceï¼ãéæ©âOKâæ¥åé»è®¤è®¾ç½®å³å¯ã
ããé
ç½®ç¯å¢åéï¼
ããæ°å»ºç¯å¢åéï¼ANDROID_SDK å¼ä¸ºï¼D:\TDDownload\android\adt-bundle-windows-x86_64-20131030\sdk\platforms\;D:\TDDownload\android\adt-bundle-windows-x86_64-20131030\sdk\tools\;D:\TDDownload\android\adt-bundle-windows-x86_64-20131030\sdk\platform-toolsï¼D:\TDDownload\androidæ¯SDKåæ¾çä½ç½®ï¼ã
ããå¨ç³»ç»åéPathçå¼çåé¢å å
¥ä»¥ä¸å
容ï¼%ANDROID_SDK%
ããåå»âå¼å§ââ>âè¿è¡ââ>è¾å
¥ï¼cmdå½ä»¤ï¼å¨CMDçªå£ä¸è¾å
¥ï¼adb -h æ£éªæ¯å¦å®è£
æåã
ããå¨â..\adt-bundle-windows-x86_64-20131030\sdkâ ç®å½ä¸æ两个å¯æ§è¡ç¨åºï¼âAVD Manager.exeâåâSDK Manager.exeâï¼å¯ç´æ¥éè¿å®ä»¬å建管çAVDï¼SDKã
ããå®è£
NDK
ããAndroid NDKå
å«buildãdocsãsamplesãsourcesãGNUmakefileãndk-buildãndk-gdbåreadmeçå
容ã
ããå建Cocos2d-x项ç®
ããå°åæä¸è½½çcocos2d-x-3.2alpha0å缩å
解åå°ä½ æå®çæ件夹éã
ããè¿å
¥å°ç®å½**cocos2d-x-3.2alpha0/tools/cocos2d-console/bin/cocos.py**
ããæå¼ç»ç«¯è¿è¡**cocos.py**èæ¬å建æ件
ããpython cocos.py new test -p com.coco2dx.org -l cpp -d ~/Desktop
ããåæ°è¯´æï¼
ããtest为项ç®å称
ãã-påé¢æ¥å
å
ãã-låé¢æ¥å¼åè¯è¨ç±»åï¼æcpp, lua, jsä¸ç§ç±»å
ãã-dåé¢æ¥é¡¹ç®åæ¾çç®å½
ããçæAndroid项ç®æ件
ããå¨æ°å»ºé¡¹ç®test项ç®ä¸ï¼æ§è¡proj.androidä¸ç*build_native.py*èæ¬è¿è¡ç¼è¯ã
çå¾
å®ç¼è¯æåï¼
ãã导å
¥Android项ç®
ããæå便å¯å¯å¨Eclipseç¶å导å
¥Android项ç®äºãæä½æ¥éª¤å¦ä¸ï¼
ããå³é®ç¹å»âPackage Explorerâ并éæ©âImportâ¦â
ããå½åºç°å¯¹è¯æ¡æ¶ï¼éæ©âExsiting Android project into workspaceâï¼å°ç°æAndroid项ç®å¯¼å
¥å·¥ä½åºï¼ã
ããæç
§ä¸é¢çæ¹æ³å¯¼å
¥å°Eclipseéé¢ãå°æ¨çææºè®¾ç½®æè°è¯æ¨¡å¼å¹¶ç¨USB线è¿æ¥å°çµè, å¨Eclipseä¸è¿è¡test, ç¶åå°±è½å¨ææºä¸çå°å·²ç»è¿è¡çHelloWorldäºï¼
温馨提示:答案为网友推荐,仅供参考