|
1.先完全安装android-mac SDK,eclipse-mac ,NDK-MAC
2.同步下载gamekit svn trunk.
将NDK-MAC拷贝到gamekit source文件夹下,我使用的是Android-ndk-r7.
3.设置编译路径
$cd 到gamekit source路径
export NDK=~/android-ndk-r5c 我在这里使用的是android-ndk-r7的绝对路径
export NDK_BIN=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin
export PATH=$PATH:$NDK_BIN
4.编译
chmod a+x ./configure-android
./configure-android ../build_android 这里../build_android使用gamekit source的绝对路径即可
这里会在gamekit source文件夹下生成一个makefile文件,
注意:如果上面这步失败,提示libstdc++.a 没有找到,需要去网上下载这个文件或者从早期的NDK相同的目录拷贝过来,我是从NDK-R5里拷贝过来的
make
等待编译成功后,libogrekit.so 会在 <ogrekit_src>/Samples/AndroidDemo/Demo/libs/armeabi目录下面
5. put a sample blend file to the SDCard.
将工程实例用的blend资源文件发送到sdcard里,这里先要将真机连上MAC 电脑,注意:gamekit 只能在真机上运行,目前模拟器不支持opengl es 2.0所以只能在真机上测试。
怎么在mac里使用adb put 见http://esausilva.com/2010/10/02/how-to-set-up-adb-android-debug-bridge-in-mac-osx/
5.1 .mac 使用 adb 方法:如果你完全安装了android-sdk,AVD ,进行以下步骤
- Open Terminal
- Type cd ~ this will take you to your home directory
- Type touch .profile this will create a hidden file named profile
- Type open -e .profile this will open the file you just created in TextEdit
- In the file, type export PATH=${PATH}:/pathToTheAndroidSdkFolder/android-sdk-mac_86/platform-tools
- Save file, close TextEdit, Quit Terminal, and Relaunch Terminal
重新打开终端输入 adb push <ogrekit_src>/Samples/IPhoneDemo/momo_ogre_i.blend /sdcard/momo_ogre_i.blend
<ogrekit_src>为gamekit代码路径
6.运行demo,先打开eclipse
a. Select 'Menu File/New/Android Project'.
b. Select 'Create project from existing source'.
Location <ogrekit_src>/Samples/AndroidDemo/Demo
c. Select Build Target.这里选择真机
d. Click 'Finish' button.
e. Build.
成功,一个小monkey. |
|
|