Two commands to get the Cocos2d-x project running on Android

Source: Internet
Author: User

Since cocos2d-x3.0, there is a configuration file called setup.py in the directory. Running it can help us quickly configure the necessary environment variables: cocos2d-x command line path, ANDROID_SDK path, ant_root path, ANDROID_NDK path.

The first thing to do is to download the cocos2d-x3.0 version, download Android_sdk,android_ndk, and Ant.

When the environment variable configuration is complete, we can start our new project.

We use the Cocos New command to generate a new Cocos2d-x project.


So just enter Cocos new Helloworld-p com.rm-l cpp-d. command to generate a new project.


After the game is written, a single Cocos Run command can be compiled automatically, packaged into an. apk format and run directly on the available Android devices, and the specific commands are explained below:


Because the SDK version installed on the machine is 20, it needs to be compiled with--ap 20来

Run on the command line:Cocos run–p Android --AP

Turn on your Android phone or virtual machine to see the effect directly.


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.