Cocos2d-x 3.4 + Android Studio 1.1.0 + VS2012 development environment Setup

Source: Internet
Author: User

Cocos2d-x is a cross-platform game engine, although now only a little bit of fur, but do feel a game engine powerful features, let me this game of small white also counted a game addiction. But because of the complexity of the configuration, let me take a lot of detours in the beginning, and now record the entire installation configuration process.


The installation packages that need to be used during the installation configuration are mainly the following:
    • Cocos2d-x 3.4: This is certainly necessary, the current highest version is 3.6 version, but it seems to have a lot of problems with the 3.5 version, or first use 3.4.
    • Android Studio 1.1.0: Google's own out of the Android integrated development environment, can also be used with eclipse.
    • VS2012: In Windows to compile the most important or to use this, the game logic debugging is also more convenient.
    • Python 2.7:cocos2d-x script is Python, and is a 2.7 version, because the version of 3.x is incompatible with the 2.7 version, so be sure to use this. Cocos2d-x The New project, the compilation is used Python, so this is very important.
    • JDK: Android development without Java, unless only to do the bottom.
    • NDK: C + + is used under Android, and it needs to be compiled with the NDK.
    • Apache-ant: This is a tool to automate the process of software compilation, testing, deployment, and so on, mostly for software development in Java environments. In short, the development of the need to install a good configuration is no longer tube.
1. Install Python. Go directly to the official website https://www.python.org/downloads/download python version 2.7. Installation is simple, almost all by default configuration can be installed, you can modify the installation directory such as: D:\Python27. Add the Python root directory to the system environment variable path after installation. Variable Name: PATH variable value: D:\Python27 2. Install the JDK. This is simple, and there are many environment variable configurations. 3. Install the VS2012. This is very simple, the biggest feature of Microsoft's Things is the use of fools. 4. Install the NDK. Go to official website http://developer.android.com/tools/sdk/ndk/index.htmlDownload r9d version, other versions do not know the line is not good, no experiment. Unzip it directly into any directory you like. Then add the environment variable:Variable Name:Ndk_rootVariable Value:D:\android-ndk-r9d 5. Install the apache-ant. Official website http://ant.apache.org/Download the latest version of the installation, and then configure the environment variables. Variable name: Ant_root variable Value: D:\apache-ant-1.9.4 6. Install Android Studio. Official website http://developer.android.com/sdk/index.html Download the latest version, the installation process is very simple. Configure environment variables after completion: variable name: Android_sdk_root variable Value: D:\USERS\CHN\APPDATA\LOCAL\ANDROID\SDK 7. Install Cocos2d-x. Official website http://cn.cocos2d-x.org/Download version 3.4, unzip directly, and then run the root directory under setup.py, if there are no environment variables configured, this script will detect and require the configuration of the appropriate variables. You can then use VS2012 to open the Cocos2d-win32.vc2012.sln in the build directory and compile the entire solution with a long time. After the compilation is complete, the project cpp-tests is started and you can see the demo window. 8. After the new Cocos2d-x project installation is complete, to create a new project, you can open a command prompt under directory D:\cocos2d-x-3.4\tools\cocos2d-console\bin and enter the command: Python cocos.py newTest-Pcom.cornergame.test-L cpp-d D:\ after the completion of the project will be in the D directory to generate the catalog test, the command red in the two places is the project name and package name. This command can be written into a batch file to be placed in this directory for later use.         Open the Test.sln under Projwin32 in the project directory, compile the entire solution, and you will see the Test window when you start. 9. Import the Cocos2d project in Android Studio to build the APK. Then select only the following: If no error has been compiled successfully, the next step can be packaged into an apk after the point of packaging, you can be in the D:\test\out\production\ Proj.android directory to see the apk file, if you click on the signature package, set the signature, the generated package is in the Proj.android directory.



From for notes (Wiz)



Cocos2d-x 3.4 + Android Studio 1.1.0 + VS2012 development environment Setup

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.