Cocos2d-x 3.2 android platform novice Development Environment configuration tutorial
The following content refer to the development environment in cocoachina configuration tutorial http://www.cocoachina.com/cocos/20140529/8596.html, I think the configuration process inside, not very detailed, on the basis of this blog to improve the HA, what is the problem, you can leave a message.
Some time ago, after learning android development, think about doing fun games to play, now learning cocos2d-x 3.2, want to know, this game engine ......
The first step is to configure the development environment ......
I. general preparations
1. Install Cocos2d-x 3.2Download it from the Cocos2d website and decompress it.
2. Install Eclipse and Android SDK
EclipseDownload it from its official website. The Android SDK is downloaded from the Android Developer Center. Eclipse is the IDE required for Android development. This is a very good IDE, with many plug-ins making him three heads and six heads. To develop Android programs, you need to download the relevant plug-ins. However, if each plug-in needs to be configured by yourself, it will be very painful.
If you are a newbie, we recommend that you use ADT Bundle. This is a combination of Eclipse + Android SDK. All projects have been configured for you.It is best to use ADT.
3. Install JDKEclipse can run only in a Java environment. If the Java environment is not installed in advance, an error is reported. Generally, environment variables are automatically configured after installation. If the problem persists, find out how to install JDK on the network.
4. Install the CDT plug-inThis is an Eclipse plug-in that supports C/C ++ development in Eclipse. Download the package from the Eclipse official website and copy the content in the features and plusins folders to the corresponding folder under the Ecplise installation directory.
5. Install NDK-r9dThis is a necessary tool for mixed compilation of C/C ++ and Java. Write down the directory to which the file is downloaded and decompressed, because it will be used in subsequent installation.
6. Install ANT-1.9.4Cocos Android development requires it, So download it and install it.
7. Configure Environment Variables
Ii. configuration process in PC environment
1. Install VS2012There are many others online. Three activation serial numbers are contributed:
YKCW6-BPFPF-BT8C9-7DCTH-QXGWC
RBCXF-CVBGR-382MK-DFHJ4-C69G8
YKCW6-BPFPF-BT8C9-7DCTH-QXGWC
2. Install python 2.7.6The installation program for the Cocos2d-x is written in phthon, so this software is needed. Do not download Versions later than python3.0. Otherwise, an error will occur. If it is Mac, it comes with it.
3. Configure the development environmentAfter the above work is completed, you can configure it. Start the command line (CMD) tool for Windows. Go to the installation directory of Cocos2d-x 3.2 and execute:
- Python setup. py
Cocos2d-x version 3.2 uses this setup. py for installation, which is very convenient. After the installation is completed, you will be asked to configure the directories such as ANT, NDK, and SDK installed in the preparations above, and enter the installation path.
4. Create your own projectAfter you configure the Cocos2d-x environment with setup. py, your command line will be more like the "cocos" command, the new project will use this command. Example:
- Cocos new hello (project name)-p com. hello (package name)-l cpp (project type)-d E: MyCocoscocos2d (directory)
The new project copies all the source files and libraries to your project directory. Therefore, the new project file will be very large, and many people doubt the necessity of this, But you will know that this configuration method is correct in future development. After the project is created, you can develop it:
A. Develop VS2012.Find proj. win32 in your project directory and open the solution. The rest is your task. In general, it can be run directly. Generally, in vs2012, project development, compilation, debugging, and then porting to the mobile phone platform.
B. Android development.Use the project import in Eclipse to import the project solution in proj. android. After the import, it cannot be started due to SDK issues. Here we will focus on the following:
1. Use the org directory in xxxxmytestcocos2dcocosplatformandroid1_rc to overwrite the org directory in E: cocos2dmytestproj. androidsrc in the project directory of vs2012, for example (E: example. (Solve the android project error)
2. Run the following command on the windows cmd terminal to compile the project:
Compilation takes a long time. Please wait.
After compilation, generate libcocos2dcpp. so
In ADT, refresh, you can see
3. Run the project with a real machine (I started to run it with a simulated machine, and the app always stops running abnormally. This was not the case on the real machine ).