So actually I made it work now, and you can put breakpoints in Android Studio (I'm using version 3.2 I think).
In your android project folder, at
AGK_libraries\apps\<project_folder>\Test_app\build\jniObjs\local you will have three folders:
-
arm64-v8a
-
armabi-v7a
-
x86
These contains the library symbols for the different builds by the NDK compiler. Android Studio needs those to be able to debug.
So in Android
Studio > Run > Edit Configuration. There is a
Debugger tab:
- make sure the debug type is not set to
Java. Should be
Dual or
Native for C++ code
- Under Symbol Directories: click
+ to add directories. (I added all three
arm64-v8a, armabi-v7a, x86)
Another thing I did, which I'm not sure was necessary, but:
- in the
Application.mk, the default AppGameKit template has
APP_OPTIM := Release. I changed that to
Debug
I've done something similar as you before (with dumping to a log file). But my best solution, for now is to create two projects:
- one with Visual Studio that creates a windows app.
- one with Android Studio that I build with the AppGameKit build script and launch from Android Studio
With exception of the
Core.h/
Core.cpp, the two projects share all the same C++ files. Most code will be independent of Android or Windows, so sharing code is not a problem.
In some cases, for example, zooming with pinch zoom vs mouse scroll, I have code for both, and I do a check at startup to determine which to use.
Anyway, this way, I can build and debug very fast in Visual Studio, test my code in a windows executable, and I prefer VS as an IDE over Android Studio. Every once in a while, I will build the project in Android Studio, make sure everything works on android as well.
When debuging Android specific functions (pinch zoom code for example), being able to debug directly in Android Studio was very helpful.