Question

I am new to cocos2d-x and I am unable to run cpp-tests on AVD but I can run them on Linux,(http://www.cocos2d-x.org/wiki/How_to_run_cpp-tests_on_Linux) can I just go on with running codes on Linux but not AVD ? does it makes any difference ? I mean is it possible for me to just do everything and run the codes in Linux and finally I install my game on a real android device ?

Was it helpful?

Solution

To some extent yes. But you will have to check your code every now and then on Android to make sure that everything is right.

Like any other cross platform solution, there are occasions that you will have to detect the device and then use some "device specific code". Having said that, the majority of your code will remain the same. For example in Cocos2d-x you will use this:

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    // DO SOME IOS RELATED STUFF
#endif

PS: I have a question for you! Could you tell me what IDE you use on Linux? I wanted to use Eclipse and couldn't get the code completion feature working, so I gave up and moved to MAC. Let me know if you have a solution for a Linux IDE! Cheers!

OTHER TIPS

The answer here is to block out code that should be platform specific by checking the built in #defines

Check cocos2d/base/CCPlatFormConfig.h

Then you can do:

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    // DO ANDROID SPECIFIC STUFF
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    // DO IOS SPECIFIC STUFF
#endif
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top