Cocos2d-x Xcode config for iOS / Andriod

    1. Install Xcode, Android SDK/NDK
    2. Craete cocos 2d-x project in Xcode
    4. Run
    5. Copy generated folder into the iOS project root
    6. Copy platform/android/java/src/org/cocos2dx/lib/* into*
    7. Update COCOS2DX_ROOT in
    8. Use Eclipse, or create a new target for Android in the Xcode project … I created a new target as ‘external build system’ which calls

function test_ret_code(){
▸   ret=$?
▸   if [ $ret -ne 0 ]; then
▸   ▸   echo "error: $1 failed, ret:$ret"
▸   ▸   exit 1
▸   fi

export  NDK_ROOT="/Users/sokoide/android-ndk-r8b"
echo "*** custom build started"
test_ret_code ""
/usr/bin/ant -f /Users/sokoide/Projects/iPhone/Spike/c2dxspike/c2dxspike/ debug install
test_ret_code "install"
/Users/sokoide/android-sdks/platform-tools/adb shell am start -n com.sokoide.c2dx/.spike
test_ret_code "adb shell am start"

echo "*** custom build completed"
exit 0

cocos2dx on iOS and Android Test app on iOS (480×320) and Android (800×480). I scaled the background, but didn’t for the label on top.