Cocos2d-x SDK Integration Guide This guide explains the TestBird UI automated testing Cocos2d-X SDK (aka SDK) integration process. Cocos2d-x SDK is an essential part of TestBird UI automated testing platform. Its main function is UI object recognition on the Cocos2d-x platform. In addition, it is also capable of user behaviour recoding, local playback and cloud playback. The current SDK version only supports objects that can be recognised by the screen. The customized data information in the internal storage is not included. TestBird may obtain more information in the future to meet customers’ needs. I. SDK Integration Procedure Windows + Eclipse + NDK + Cygwin (environment) Precondition: Users have already installed NDK, Cocos2d-x, Cygwin and Eclipse environment. 1、Install libzyc Files Step one: Copy LibZyc.a and paste to the game App (assuming TestCpp) jni directory. One way of copying is to import. Drag LibZyc.a to jni directory or copy LibZyc.a from Files Explorer. Right click jni and select paste. After copy is completed, the UI will look like this: Step 2: double click jni/Andriod.mk file and add an extra line LOCAL_LDLIBS += $(LOCAL_PATH)/libzyc.a
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Cocos2d-x SDK Integration Guide This guide explains the TestBird UI automated testing Cocos2d-X SDK (aka SDK) integration
process. Cocos2d-x SDK is an essential part of TestBird UI automated testing platform. Its main
function is UI object recognition on the Cocos2d-x platform. In addition, it is also capable of user
behaviour recoding, local playback and cloud playback.
The current SDK version only supports objects that can be recognised by the screen. The
customized data information in the internal storage is not included. TestBird may obtain more
information in the future to meet customers’ needs.
I. SDK Integration Procedure Windows + Eclipse + NDK + Cygwin (environment)
Precondition: Users have already installed NDK, Cocos2d-x, Cygwin and Eclipse environment.
1、Install libzyc Files
Step one: Copy LibZyc.a and paste to the game App (assuming TestCpp) jni directory.
One way of copying is to import. Drag LibZyc.a to jni directory or copy LibZyc.a from Files
Explorer. Right click jni and select paste.
After copy is completed, the UI will look like this:
Step 2: double click jni/Andriod.mk file and add an extra line
LOCAL_LDLIBS += $(LOCAL_PATH)/libzyc.a
See the following image
Step 3: In order to ensure the SDK gets linked each time, an extra line in Build_native.sh file is
needed. For the Link to operate smoothly all the time, it is necessary to delete Libcocos2d.a file.
(Without such action, even when liyzyc.a has been updated, the link will not reload)
2、Import TestBird SDK Package
Step one: Configure the project. Select ‘build path’, then choose ‘Configure Build
Path...’
Step two: Click ‘Java Build Path’ and configure ‘Libraries’. Click ‘Add External Jars’ to
import ‘testbirdsdk.jar’.
Step three: Select‘Order and Export’, choose ‘testbirdsdk.jar’. Click ‘up’ bottom to
locate ‘testbirdsdk.jar’ above source code and gen code.
Step four: Initialise testbirdSdk. Invoke SdkManager.getInstance().init function and enter
the correct forms of appid and channelid. The first argument is appid, channelid second.
i
Step five: Configure permission in AndroidManifest.xml