Giter Club home page Giter Club logo

sdkbox-cocos2d-x-binary's Introduction

How to create sdkbox sample

Steps:

mkdir samples
cd samples

# must clone this repo
git clone --depth 1 https://github.com/sdkbox/sdkbox-cocos2d-x-binary.git

# unzip the iOS lib
unzip -o prebuilt/ios/Archive.zip -d prebuilt/ios/

# create facebook sample
./sdkbox-cocos2d-x-binary/create_project.sh facebook

How to run sdkbox samples

Steps:

mkdir samples
cd samples

# must clone this repo
git clone --depth 1 https://github.com/sdkbox/sdkbox-cocos2d-x-binary.git

# get facebook sample
git clone --depth 1 https://github.com/sdkbox/sdkbox-sample-facebook.git

# run sample with specified language and platform
# eg: cpp and ios
./sdkbox-cocos2d-x-binary/run_sample.sh facebook cpp ios
# javascript and android
./sdkbox-cocos2d-x-binary/run_sample.sh facebook js android

Memo:

  1. All sample projects must be in same level directories
+-- sdkbox-cocos2d-x-binary
+-- sdkbox-sample-facebook
| +-- cpp
| +-- lua
| \-- js
+-- sdkbox-sample-fyber
+-- sdkbox-sample-appodeal
+-- <more>

Make sure CCLOG write logs to lldb

cocos/base/CCConsole.h

from:

void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2);

to:

#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)
void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2);
#else
void CC_DLL log(const char * format, ...);
#endif

cocos/base/CCConsole.cpp

from:

void log(const char * format, ...)
{
    va_list args;
    va_start(args, format);
    _log(format, args);
    va_end(args);
}

to:

#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)
void log(const char * format, ...)
{
    va_list args;
    va_start(args, format);
    _log(format, args);
    va_end(args);
}
#endif

platform/ios/CCCommon-ios.mm

add:

void log(const char * format, ...)
{
    va_list args;
    va_start(args,format);
    NSLogv([NSString stringWithUTF8String:format], args) ;
    va_end(args);
}

install and run iOS app on device

set PROJECT_NAME=facebook_cpp
set CONFIGURATION=Debug

# choose language
cd cpp

# build
xcodebuild -target $PROJECT_NAME-mobile \
    -configuration $CONFIGURATION \
    -project proj.ios_mac/$PROJECT_NAME.xcodeproj

# install and run .app on device
ios-deploy --noninteractive --debug \
    --bundle proj.ios_mac/build/$CONFIGURATION-iphoneos/$PROJECT_NAME-mobile.app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.