Home » Android » android – Why doesn't rsDebug work?

android – Why doesn't rsDebug work?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I’ve inserted an rsDebug method in the Android RenderScript sample “Fountain”, but I’m getting no messages out of logcat.

Here’s a code snippet to demonstrate what I’ve tried:

int root() {
    float dt = min(rsGetDt(), 0.1f);
    rsDebug("dt", dt);
    ...
}
How to&Answers:

I have been working with the renderscript example CarouselView example from here and here is what I did to get rsDebug to work:

  1. Added debuggable=”true” to the application tag in the manifest file:

    <application android:debuggable="true">
    
  2. Added

    \#include "rs_debug.rsh" 
    

to the carousel.rs renderscript file.

Answer:

Besides the answer of Dave i want add following hint:

Messages in renderscript are outputted in the “Verbose”-level.
So it may be easy to ignore them because you are in the wrong level.

So in Android Studio you can change the logcat-output here:

enter image description here