Cocos2d-x 3.0 Android Environment built (pro-test)

Source: Internet
Author: User

Online a bunch of Android environments that tell the COCO2D-X 3.0 version number. I really can't bear to stare. It is unclear whether they have measured their own tests or not. It's just a little time to deploy the next Android environment today.

The Cocos2d-x 3.0 version greatly simplifies the deployment of the Android environment, which is simple enough to require just one command. Okay, no more nonsense, start getting to the point. (The engine I used was the Cocos2d-x 3.0 version, and the test project was the LUA project that was created.)

System for Mac)


First, the main Andriod SDK. The NDK itself participates in the online configuration. The new 3.0 requires more configuration of the ant path (which is used at compile time). To download the configuration yourself. I have a well-configured path to take the test. Configuring environment variables under the MAC system needs to be configured in. bash_profile.

Use the command: Open. Bash_profile opens the file. If you can't find it, use: touch. Bash_profile to create it.

# Cocos2d-x
Export Develop_root=${home}/develop
Export Cocos2dx_root=${develop_root}/testlua/frameworks/cocos2d-x
Export Cocos2dx_console_root=${cocos2dx_root}/tools/cocos2d-console/console
#android
Export Android_root=${develop_root}/android
Export ANDROID_SDK_ROOT=${ANDROID_ROOT}/ADT-BUNDLE-MAC-X86_64-20140321/SDK
Export android_ndk_root=${android_root}/android-ndk-r9d
Export Android_ant_root=${android_root}/apache-ant/bin


Export Ndk_root=${android_ndk_root}
Export Ant_root=${android_ant_root}


(Testlua is the project I created)

After configuration, change the Android.mk file to the project: Testlua/frameworks/runtime-src/proj.android/jni directory.

(Do not change the words of their own Niang bar).

Then change:. cocos-project.json file, this file in the project testlua/directory, the MAC system by default, see this file, you need to set up to show hidden files, run this command can display hidden files:defaults write Com.apple.finder Appleshowallfiles-bool True


Then change. The contents of the Cocos-project.json are:

{
   " ios_cfg ": {
       " Project_path ":" Frameworks/runtime-src/proj.ios_mac ",
       " Project_file ":" Testlua.xcodeproj ",
       " target_name ":" testlua IOS"
   }, 
    "Project_type": "Lua",  
& nbsp   "Has_native": true,
    "android_cfg": {
        "Project_path": "frameworks/ Runtime-src/proj.android "
   }
}

Then copy the related resources to: Frameworks/runtime-src/proj.android/assets folder (Resource contains:testlua/src. Lua files under the testlua/res and testlua/frameworks/cocos2d-x/cocos/scripting/lua-bindings/script folders).


Okay, so this whole environment is ready to be configured. Then start the real-machine debugging.

Use the command to go to the Testlua folder and run: Cocos run-p Android Command will be able to debug the Android phone.



Cocos2d-x 3.0 Android Environment built (pro-test)

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.