Debugging sample cocos2d-x project in AndroidStudio

Hello,

I am using cocos2dx3.15 framework.I was just testing “Debugging cpp-tests”.

Following link i followed.
https://github.com/chukong/cocos-docs/blob/v3-unified-documentation/installation/Android-Studio.md

I imported the CPP tests to AndroidStudio.I have set breakPoint. But i am not able to debug.

Please help me out, steps to debug c++ file in AndroidStudio.

ANDROID STUDIO VERSION I’m using - 2.3.1

Thanks

Have you succeeding running the sample? Did you click debug icon to run the project?

@zhangxm,

Thanku for reply:)

Yes, successfully i have run the Project. I have clicked debug icon to run the project.

But i am unable to debug by using breakPoints like it supports in Xcode.

Thanks

Change armeabi to amreabi-v7a.

@piotrros

Thanx for the reply.

Where exactly we need to do these.

Thanks

 externalNativeBuild {

                ndkBuild {
                    targets "MyGame"
                    arguments "NDK_MODULE_PATH=$cocospath:$cocospath/cocos:$cocospath/external:$cocospath/cocos/prebuilt-mk"
                    arguments "-j" + Runtime.runtime.availableProcessors()
                    abiFilters "armeabi-v7a"
                }

            //          available abiFilters (for debugging):
            //          abiFilters "x86", "armeabi", "armeabi-v7a", "arm64-v8a"

 }

@piotrros Thanku. Will try and let you know.

Hello,
I am also stuck in the android C++ debug.

https://github.com/chukong/cocos-docs/blob/v3-unified-documentation/installation/Android-Studio.md

As the above link suggested

  1. I created a new project using cocos 2dx v3.15.
  2. Updated android studio to latest version.
  3. While I opened android studio i got my cpp Class files and when i added break point and debugged it break point are not excecuting at all.

I wont get any message in debugger console as well.
and i tried to make changes as “piotrros” suggested but it didn’t reflected any changes.

Do we need to change any configuration or android.mk file??

Thanks,

@sushant,

What is the NDK version you are building?

I have tried with NDK version: android-ndk-r13b . I didn’t do any changes in code. It was working well with cocos 2dx v3.15. Helloworld project.

Make sure LLDB installed under SDK Tools.

Regards,
Gurudath

@Gurudath,
Thanks for the reply i will check LLDB and will inform you about the status.

@Gurudath,
Thanks for the suggestion as you told regarding NDK version i was using old NDK version,When I upgraded my NDK version to android-ndk-r13b It fixed my issue now i am able to debug cpp code as well.

Thanks.