androidandroid-ndkndk-builddumpsys

How to compile dumpsys as an standalone application with Android NDK?


I would like to compile dumpsys as an standalone application using Android NDK. However, when I enter the command ndk-build I encounter the following error:

fatal error: utils/Log.h: No such file or directory

Is it at all possible to compile dumpsys as an standalone app?

The source code and Android.mk file can be found at https://android.googlesource.com/platform/frameworks/native/+/lollipop-mr1-release/cmds/dumpsys


Solution

  • utils/Log.h isn't part of the NDK.

    The AOSP sources aren't meant to be used with ndk-build.

    You can compile dumpsys in-tree by following the instructions on how to setup an AOSP build and by calling mm from its sources directory (so you will not have to build the whole AOSP).