I'm writing a C/C++ Android app. One of the libraries I'm using prints additional debugging information depending on whether an environment variable is set. Is there's any way to set one?
I was hoping that the launch target could be configured with an environment variable in Android Studio. Under Launch Options, there's an option to provide flags to the am start
call but Activity Manager doesn't provide any way of setting an environment variable prior to launch.
Include a wrap.sh file in your APK: https://developer.android.com/ndk/guides/wrap-script.html
This only works for debuggable APKs, but given that you want it for logging that's probably for the best anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With