Windows cocos2dx3.0 development environment and Android build environment

Source: Internet
Author: User

COCOS2DX update to the 3.x version, I have not changed, and now the development team requirements for a unified version, I will build the environment of the process recorded.

First, windowns under the development environment construction

1. Required Tools1) Cocos2d-x-3.0rc0.zip http://cn.cocos2d-x.org/download/when writing a blog post, the latest version is V3.2.    2) VS2012 http://www.baidu.com/s?wd=VS2012 3) Python https://www.python.org/download/releases/2.7.8/This according to the version of your system    2. Install VS2012 this should not be explained too much.        3. Installation of Python Python installation is particularly simple, all the way to next, after the installation is completed to add the Python installation path into the environment variables. The environment variable, advanced system settings, properties--right--computer, locate the path in the system variable, click Edit, insert the Python installation path, my default installation, so the path is C:\Python27,        When inserting here, you should pay attention to the semicolon. Click OK to start cmd, enter the Python carriage return, and the display indicates that the configuration was successful. (If you do not log off the computer successfully)
4. Configure the COCOS2DX3.0 development environment to extract cocos2d-x-3.0rc0.zip to any path, my is C:\cocos2d-x-3.0rc0, in this directory found setup.py, directly double-click Run, the following screen appears:
Return to the computer after completion. After re-login, start cmd, enter Cocos carriage return, if the following interface appears, the configuration is successful.
Here you can see some basic usage of cocos. Let's create a new project, and execute Cocos New in CMD to see the use of the command.
For example, if we want to create a project named Test under C:\projects, you can use the following command: Cocos new-p com.kuki.test-l cpp-d c:\projects test
The creation process is as shown.
After the creation, we can open the C:\projects\test\proj.win32 directory under the Test.sln with VS2012 to develop. The development environment under Windows is now complete.
Second, Android build environment build     1. Required tools         1) Android SDK  http://developer.android.com/sdk/installing/index.html?pkg =tools        2) Android NDK  http://developer.android.com/tools/sdk/ndk/index.html# installing        3) Java JDK  http://www.oracle.com/technetwork/java/javase/downloads         4) Apache Ant  http://ant.apache.org/bindownload.cgi      & Nbsp;2. Configuring environment variables         NDK and ant all just need to be unpacked, and after the SDK is unpacked you need to use the SDK Manager.exe to update the version of Android platform tools you need. Here I put in the c:\Android directory, the JDK installation process is also very simple, all the way next, I installed the path is C:\Program files\java\jdk1.8.0_11.         1) Create a new java_home variable in the system variable with a value of C:\Program files\java\jdk1.8.0_11         2) Create a new classpath variable with the value:.; %java_home%\lib;%java_home%\lib\tools.jar (Note that there is a "."  , representing the current path)         3) Add% to the PATH variable Java_home%\bin;%java_home%\jre\bin; C:\android\ant\bin (here to modify according to your own situation)          Next Run the COCOS2DX root directory setup.py associated ndk, SDK and ant, enter the path, I am here:        c:\Android\ndk        c:\Android\sdk        c:\android\ant\bin (note here is the bin directory)          After the configuration is complete, rerun the setup.py, and if so, all are configured correctly. You need to log off the computer for the configuration to take effect.
At this point, the Android build environment is configured to complete, can finally pack the APK!        If you add CPP, to add your own new CPP in the Proj.android/jni android.mk file, do not use Notepad here, you can use UE.        Start cmd, CD to the project directory, execute Cocos compile-p Android, start compiling. After the successful compilation of the APK file in the project path \bin\debug\android directory.

also, if you compile the APK, you are prompted with an error:Android Platform not specified, searching a default one ... No valid Android platform found, would not generate apk.
you need to add a platform number, such as: Cocos run-p Android--ap Specifies that the Android platform version used is
detailed Cocos command instructions can be used to view Help Cocos--help

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.