Cocostudio & cocos2dx 3.1
*setting & preparation
SDK, NDK, JDK, cocos2d-x 3.1, cocostudio
add System parameter
(control panel -> system -> advanced system option -> environment parameter)
//install JDK
//http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_60
//install NDK
//https://developer.android.com/tools/sdk/ndk/index.html
NDK_ROOT : C:\dev\android-ndk-r9d
//install SDK
//http://developer.android.com/sdk/index.html
ANDROID_SDK_ROOT : C:\dev\sdk
//install apache ant
//http://ant.apache.org/bindownload.cgi
ANT_ROOT : C:\apache-ant-1.9.4\bin
*setup the cocos2dx
//in this process require "python 2.x"
//please install python 2.x
in
cocos2d-x-3.1.1 directory,
on console
C:\Users\pineoc\Desktop\PROJECT-FOLDER\client\cocos2d-x-3.1.1>
python setup.py
it will appear
Setting up cocos2d-x...
->Check environment variable COCOS_CONSOLE_ROOT
->Find environment variable COCOS_CONSOLE_ROOT...
->COCOS_CONSOLE_ROOT is found : C:\Users\pineoc\Desktop\PROJECT-FOLDER\clien
t\cocos2d-x-3.1.1\tools\cocos2d-console\bin
->Configuration for Android platform only, you can also skip and manually edit y
our environment variables
->Check environment variable NDK_ROOT
->Find environment variable NDK_ROOT...
->NDK_ROOT is found : C:\dev\android-ndk-r9d
->Check environment variable ANDROID_SDK_ROOT
->Find environment variable ANDROID_SDK_ROOT...
->ANDROID_SDK_ROOT is found : C:\dev\sdk
->Check environment variable ANT_ROOT
->Find environment variable ANT_ROOT...
->ANT_ROOT is found : C:\apache-ant-1.9.4\bin
Please restart the terminal or restart computer to make added system variables t
ake effect
and reboot or restart cmd.
then you can use "cocos" command
use cocos command -> make project
$cocos new -d . -l cpp test
project will be make.
1. "test" cocos project can coding on VS(visual studio)
2. can make android app right now
1 -> test/proj.win32/test.sln excute and coding
*use cocostudio setting (on VS)
1. add project on solution this projects
cocos2d\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj
cocos2d\extensions\proj.win32\libExtensions.vcxproj
cocos2d\cocos\ui\proj.win32\libGUI.vcxproj
2. set the "project dependency" added projects
3. on AdditionalIncludeDirectories add $(EngineRoot)cocos\editor-support
4. coding and build
*build android
**setting
/test/proj.android/jni/Android.mk
delete red #
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
# LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static
# LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,.)
$(call import-module,audio/android)
# $(call import-module,Box2D)
# $(call import-module,editor-support/cocosbuilder)
# $(call import-module,editor-support/spine)
# $(call import-module,editor-support/cocostudio)
# $(call import-module,network)
# $(call import-module,extensions)
1. on cocos2d-x-3.1.1 folder, run cocos command
$cocos run -s test -p android
will build on time some minute
2. /test/publish/android/test-debug.apk appear!