Issue
I'm trying to enable malloc debug for my android application, and for the life of me i can't get it working.
My wrap.sh
scripts each contain this:
#!/system/bin/sh
LIBC_DEBUG_MALLOC_OPTIONS="free-track verbose"
logwrapper "$@"
and I've set up the following directory structure:
When I grep logcat for "malloc debug enabled", I get nothing.
If i change my wrap.sh
scripts contents to this
#!/system/bin/sh
LIBC_DEBUG_MALLOC_OPTIONS=free-track logwrapper "$@"
which is exactly what the documentation for the wrap shell script says to add (although to me that seems like invalid shell script syntax), i can see the "malloc debug enabled" log message, but my application freezes at the splash screen and never actually launches.
I'm not sure what's going on and would love any type of input.
Other notes:
- My project is using CMake.
- My debug device is running Android P.
Solution
That is for running an executable binary on Android. I think you are running a Java app with JNI calls, and that trick does not apply to you. You will have to set those environment variables from JAVA as the app starts.
Try looking at OS.setenv()
- https://developer.android.com/reference/android/system/Os.html. I hope that those environment variables can be set from Java before the JNI library is loaded, or that the library reads those environment variables on every call, and not just init.
Answered By - elcuco
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.