Cocos porting to android-Cross-compiling with command line package

Source: Internet
Author: User

After we developed the game program for the Win32 platform using Visual Studio under Windows, we needed to migrate them to different platforms. Cocos2d-x supports a number of platforms, however, it is not possible to introduce the porting of all platforms. We summarize the three platforms currently popular in the industry: Android, iOS and Windows Phone 8, and we introduce porting related work on Android.


Once the environment has been configured successfully, we can cross-compile, there are many ways to cross-compile, but the most convenient is the Cocos tool (located in the < cocos2d-x installation directory >\tools\ cocos2d-x 3.0). Cocos2d-console\bin), using this tool can do a lot of things, we used it to create a cocos2d-x project, now we use it to cross-compile, hit the APK install package and install APK to the device or emulator.


First through the DOS into the project to be compiled root directory, enter the "Cocos run-p Android" command, wherein the mygame is our engineering root directory, and then enter to start execution, if all together smoothly will appear the following results.

Command line cross-compilation



Command line cross-compilation succeeded

The last step in the instruction execution is to install the APK package, request at least one emulator or an Android device, start the simulator, and click the Start button.

For more information, please pay attention to the first Cocos2d-x 3.2 Edition book "Cocos2d-x: C + + volume" book Exchange Discussion website: http://www.cocoagame.net
For more exciting video courses, please follow the Cocos class: Http://v.51work6.com Welcome to join the COCOS2D-X Technical Discussion group: 257760386 Welcome to the Luxgen iOS classroom public Platform

Cocos porting to android-Cross-compiling with command line package

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.