android

How to use startNativeTracing


I am trying to get a trace of an Android device but I am getting

ERROR: emulator tracing not enabled 

How do I get a trace using startNativeTracing() for a real device?


Solution

  • According to the SDK, You can't use it in real device. For this to work requires running everything inside the qemu emulator; otherwise, this method will have no effect. The trace file is specified on the command line when the emulator is started. For example, the following command line:

    emulator -trace foo
    

    If you want to trace the code in real hardware, startMethodTracing method is the one to use. However, it doesn't trace the native code.