Build an Android project on Cocos2d-x 3.0-Eclipse

Source: Internet
Author: User

Build an Android project on Cocos2d-x 3.0-Eclipse

End of March

This article continues with some of the basics of Cocos2d-x 3.0, where the previous blog introduced how to compile our Cocos2d-x project on Visual Studio 2012 and successfully run Helloworld. Similar to previous versions, the command is changed to cocos when an empty project is created. This blog brings you is, how to run our Cocos2d-x project in Eclipse, if the children's shoes have to see my write Cocos2d-x 2.2.3 version of the cross compiling environment to build, after reading this blog, you will know that Cocos2d-x 3.0 has had such a big change, become so simple, trouble configuration all disappeared, reduce the difficulty of learning.

Prerequisites

Download ADT Bundle (SDK and ADT are bound to Eclipse) http://developer.android.com/sdk/index.htmlinstall jdk?ndk=python, then configure the environment

Workflow

When using Eclipse to build Android, we recommend that you follow these steps:

Go to the Cocos2dx project you created and enter proj. android directory. For example, Xiao Wu created a project named MyGame under E:/MyProject/and entered MyGame/proj. run the following command in the android directory: Python build_native.py(Note: If you want to run the cpp-tests project provided by the cocos2d-x, go directly to the build directory and run the command python android-build.py-p 10 cpp-tests)

After compilation, we can import the proj. android project to our Eclipse. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD48cD48L3A + yLu688q508NFY2xpcHNltPK/qtlvq205ttatcrbbmryb2lkz + fill "http://www.2cto.com/uploadfile/Collfiles/20140502/2014050209214336.png" alt = "\"/>

Import libcocos2dx Project (Note: Do not directly import the java project under the D: \ Cocos2dx \ cocos2d-x-3.0 \ cocos \ 2d \ platform \ android directory, unless you create a cpp-tests project, this is a test project provided by the cocos2d-x; if you create a project using the cocos command, make sure libcocos2dx is in the directory where your project is located ), for example, the Java project under MyProject is copied from Cococs2dx, put it in a directory of the project created with the cocos command, and then import it using Eclipse. As shown in:


Then you can right-click-> Run as to directly Run the Android project, no additional configuration (Cocos2d-x 3.0 is so simple ).


The above content is how to run our Cocos2d-x project in Eclipse, very easy, about Cocos2d-x 3.0 in Windows environment configuration basic content has been introduced, thank you for your support.

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.