1、请先确认你eclipse环境已经mac上配置好了【在eclipse上能够编译android代码,并可以运行在虚拟机上或者真机上】我sdk所在的地址是:
localhost:android-sdk-macosx b126$ pwd /Android/android-sdk-macosx localhost:android-sdk-macosx b126$
localhost:android-ndk-r8 b126$ pwd /Android/android-ndk-r8
localhost:cocos2d-1.0.1-x-0.13.0-beta b126$ pwd /Android/cocos2d-1.0.1-x-0.13.0-beta
localhost:cocos2d-1.0.1-x-0.13.0-beta b126$ vim create-android-project.sh
#!/bin/bash # This script should be called by create-android-project.bat # or should 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
NDK_ROOT_LOCAL="/home/laschweinski/android/android-ndk-r5" ANDROID_SDK_ROOT_LOCAL="/home/laschweinski/android/android-sdk-linux_86"
相信这步大家没问题了。
5、保存,并用命令运行
localhost:cocos2d-1.0.1-x-0.13.0-beta b126$ ./create-android-project.sh