Cocos2dx developed in xcode and compiled to android (2)

Source: Internet
Author: User

1. Check that your eclipse environment has been configured on mac. [android code can be compiled on eclipse and can be run on a virtual machine or on a real machine.] the address of my sdk is:

[Plain]
Localhost: android-sdk-macosx b126 $ pwd
/Android/android-sdk-macosx
Localhost: android-sdk-macosx b126 $

2. Download The ndk from the Internet and decompress it to a directory. The decompressed directory is as follows:

[Plain]
Localhost: android-ndk-r8 b126 $ pwd
/Android/android-ndk-r8

3. Download cocos2dx and decompress it to a directory. The decompressed directory is:

[Plain]
Localhost: cocos2d-1.0.1-x-0.13.0-beta b126 $ pwd
/Android/cocos2d-1.0.1-x-0.13.0-beta

4. input data to the terminal in the cocos2dx directory:

[Plain]
Localhost: cocos2d-1.0.1-x-0.13.0-beta b126 $ vim create-android-project.sh

Display:

[Plain]
#! /Bin/bash
# This script shocould be called by create-android-project.bat
# Or shoshould be runned in linux shell. It can not be runned under
# Cygwin.
# Don't modify the script until you know what you do.
 
# Set environment paramters
NDK_ROOT_LOCAL = "/home/laschweinski/android/android-ndk-r5"
ANDROID_SDK_ROOT_LOCAL = "/home/laschweinski/android/android-sdk-linux_86"
 
NEED_BOX2D = false
NEED_CHIPMUNK = false
NEED_LUA = false
 
# Try to get global variable
If [$ NDK_ROOT "aaa "! = "Aaa"]; then
Echo "use global definition of NDK_ROOT: $ NDK_ROOT"
NDK_ROOT_LOCAL = $ NDK_ROOT
Fi
 
If [$ ANDROID_SDK_ROOT "aaa "! = "Aaa"]; then
Echo "use global definition of ANDROID_SDK_ROOT: $ ANDROID_SDK_ROOT"
ANDROID_SDK_ROOT_LOCAL = $ ANDROID_SDK_ROOT

There are two places to modify. One is the sdk and the other is the ndk address:

[Plain]
NDK_ROOT_LOCAL = "/home/laschweinski/android/android-ndk-r5"
ANDROID_SDK_ROOT_LOCAL = "/home/laschweinski/android/android-sdk-linux_86"
I believe this step is okay.

5. Save and run the command

[Plain]
Localhost: cocos2d-1.0.1-x-0.13.0-beta b126 $./create-android-project.sh

The subsequent steps and I in: cocos2dx in windows development, compiled to android (2) http://www.bkjia.com/kf/201205/130697.html 6th step after the introduction is the same, please refer to see Ha, I will not introduce it here.



From the ComeOnTom Column

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.