title: Dumpsys-like functionality for apk app
body: <p>I am looking for a solution to access the internal state of our app from adb for debugging purposes. 
  I have used dumpsys a lot to get the internal state of system services so now I wonder if I can expose an interface from our app to adb. The only thing I have thought of so far is to log the information periodically and then just read logcat but if possible I would like to be able to interact directly with the app over adb so question is how to implement this in our app. </p>