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 discussionwebsite: http://www.c ocoagame.net
For more exciting video courses, please follow Cocos class: http://v.51work6.com
Welcome to join Cocos2d-x Technical Discussion group: 257760386 Welcome to Luxgen iOS Classroom public platform
Cocos porting to android-Cross-compiling with command line package