Cocos2d-x in mac configuration Android Development Environment

Source: Internet
Author: User

We all know that cocos2d-x is a cross-platform game engine, but if we only use it to develop iPone/iPad-side games, it's a bit too cool, if that's the case, cocos2d-x did not show its advantages. Then I will introduce how to use cocos2d-x to create an Android platform and successfully convert the ios game project into an android game. Operation Procedure: Input pico in the interrupt. when bash_profile is enabled, enter export ANDROID_SDK_ROOT =/Users/Himi/Documents/HimiWork/AndroidTools/android-sdk $ export sources =/Users/Himi/Documents/HimiWork/AndroidTools/android-ndk $ export COCOS2DX_ROOT =/Users/Himi/Documents/cocos2d-1.0.1-x-0.12.0export NDK_ROOT =/Users/Himi/Documents/HimiWork/AndroidTools/android-ndk-r7bexport PATH = $ PATH: $ ANDROID_SDK_ROOTexport PATH = $ PATH: $ ANDROID_NDK _ ROOT, press Ctrl + X-> Y + enter to end the path configuration and create an xcode project. After adding a new class, make sure that all the class files are in the class, then recompile to make sure that the project works normally in the iPhone simulator followed by running cocos2d-x in the terminal, creating a project, project name com. dxw. test, select id2, and then file name test. Then set proj. in android, change build_native.sh to the path .. /.. /modify it .. /libs, and then copy the four files to your project libs. Some files need to be overwritten. Finally, let's take a look at whether the last java/libs in the platform project contains many java files. If not, find the corresponding file from the cocos2d-x and copy it. If it is an additional project created by yourself: to modify the mk file under jni: Set LOCAL_SRC_FILES: = hellocpp/main. cpp ..., add the cpp files in all projects to the proj. andorid to clear, delete the assert and obj files, and then continue. /build_native.sh: import the files to the project, and import them to proj. android is followed by the libcocos2dx file, and then plug in the mobile phone to run it!

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.