1

I am trying to develop an app that allows the user to record system traces using systrace, i want to be able to run this inside a regular Android application, without the need of a PC or ROOT access to use the ADB.

From Android 9, there is an option to record system traces from the Developer Options, this works perfectly on the device without any external tools, but i need to have more control over this, because i will be running the systrace command over a period of time and then uploading the results to a server automatically (everything happens in the app)

Is there any way that i can do this from an Android Application ?

I tried using python inside an app and then running systrace, but it fails with an error because it can't find ADB.

1
  • I think your only option is launching that developer menu after giving the user instructions, so that the user can then do the rest. Commented Sep 3, 2020 at 19:33

1 Answer 1

1

This is not possible and that's by design. System Trace data is considered personal data because it may include information like what apps the users was using (all processes are dumped in a trace). When you use the on-device trace app you'll get a prompt to confirm before sharing a trace. By allowing automatic trace uploading it would bypass the privacy protections put in place.

p.s. the systrace Python script is just a wrapper around some adb commands so it's only supposed to be run from a PC.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.