How to Build Android cocos2d-x-3.3 Development Environment on win7, win7cocos2d-x-3.3

Source: Internet
Author: User

How to Build Android cocos2d-x-3.3 Development Environment on win7, win7cocos2d-x-3.3

1. Tools to be installed to build a development environment:

 

A. Visual Studio 2012

B. Cocos2d-x-3.3 version

C. Java JDK 1.7.

D. Android SDK

E. Android NDK


2. Download and install Visual Studio 2012 (for: https://msdn.microsoft.com/library/dd831853 (v = vs.110). aspx)

 

3. Download The Cocos2d-x-3.3 version of the game engine

 

Users can log on to the cocos2d-x official website to download the 3. x Series cocos2d-x engine version (for: http://cn.cocos2d-x.org/download/), as shown in:


In this guide we will take the current newer stable version of Cocos2d-x 3.3 Final engine as an example, here we strongly recommend the use of the new version of Cocos2dx, the new version of the engine has many new features, fixed many of the old version of the BUG.

 

After the download is complete, put the decompressed parent folder to the specified location, here, I save the location: C: \ work \ study \ cocos2dx \ version, open the cocos2d-x-3.3 folder, shows the directory structure:


Where:

1) build: Mainly used to build project solutions

2) cmake: used to store modules and find corresponding resources, such as files and audios.

3) cocos: the API used to store cocos2d-x

4) docs: Document Description

5) extensions: used to store some extension class libraries, such as GUI controls

6) external: used to store some physical engines, such as Box2D, chipmunk, and ConvertUTF.

7) licenses: license statement for storing all dependent projects

8) plugin: provides some plug-ins.

9) projects: a new project directory that stores the created cocos2d-x Project

10) templates: Contains templates for creating cocos2d-x projects under different platform ides

11) test: store test items

12) tools: stores required tools, such as Python scripts for creating projects.

Go to the build folder and double-click the cocos2d-win32.vc2012.sln file to start Visual Studio 2012 and see a solution in VS, as shown below:


The architecture diagram of the cocos2d-x is as follows:


4. Download and install and configure Java JDK 1.7


Because we are developed for Android, We need to install Java JDK (for: http://www.oracle.com/technetwork/java/javase/downloads/index.html)

 

When downloading is completed, double-click the. exe file. Note that it is not recommended to install it in a space or a Chinese folder. There are no other restrictions. Note that the installation path is: C: \ Installed \ Java, you also need to configure environment variables.

 

After the environment variable is configured, click Start> RUN> Enter cmd command and enter java-version in the DOS window. The following interface indicates that the installation is successful:


5. Configure the Android SDK Environment


Download Android SDK (for: http://developer.android.com/sdk/index.html) and ADT plug-in (can be installed online or offline)

 

Extract the secret file and place it in a directory. The directory here is C: \ Installed \ android, which contains the eclipsedomainsdkfolder and sdkmanager.exe file.


Double-click eclipse.exe under the eclipsefolder and set the default work area (workspace.


Configure the SDK environment variable ANDROID_SDK

 

Install the ADT plug-in and select "Help" --> "Install NewSoftware..." from Eclipse ...", As follows:


Click "Add" to Add Repository:


You can also install Archive locally.

 

Click Start> Run and enter adb-h in the DOS window. If the following interface is displayed, the installation is successful:


6. Configure the Android NDK Environment

 

Download Android NDK (for: http://developer.android.com/tools/sdk/ndk/index.html), after the download is completed decompress and placed in a directory, where the location is: C: \ Installed \ Android \ adt-bundle-windows-x86_64-20131030, set the environment variable NDK_ROOT. Shows the directory structure:


7. Configure the Python Environment

 

Download Python (for: https://www.python.org/), after the download is complete double-click the python-2.7.9.amd64.msi file to install Python.

 

Click Start> Run and enter python in the DOS window. If the following interface is displayed, the installation is successful:


8. Creating a Cocos2d-x Project

 

Before you create a cocos2d-x project, if the environment variable you mentioned earlier is not configured, you can go to the root directory of the cocos2d-x-3.3, double-click setup. py, and preconfigure the environment.

 

After the environment is configured, go to the directory: cocos2d-x-3.3/tools/cocos2d-console/bin, open the DOS window terminal, run the cocos. py script to create the project:

Python cocos. py new second_cocoscom.hp.game-l cpp-d C: \ work \ study \ cocos2dx \ version \ cocos2d-x-3.3 \ projects

 

Parameter description:

A. second_cocos is the project name

B.-p: the name of the next packet, including at least three levels

C.-l is followed by the development language, including cpp, lua, and js.

D.-d and the Directory stored in the project


The project structure under the C: \ work \ study \ cocos2dx \ version \ cocos2d-x-3.3 \ projects directory is:


9. Generate the Android project file

 

In the new second_cocos project, execute the build_native.py script under the proj. android directory for compilation, and generate the libcocos2dcpp. so file in the libs/armeabi directory.


10. Import the Android Project

 

Start Eclipse IDE and import the Android Project

A. Right-click PackageExplorer and select Import ..."

B. In the displayed dialog box, select "Exsiting Android projectinto workspace" (import an existing Android project to the workspace)


The running effect is as follows:


Now the environment has been set up.

Where the document is: http://download.csdn.net/detail/shenjichao2008/8439741


Related Article

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.