page.title=Systrace Walkthrough
meta.tags="android, performance, profiling, tools, compute, systrace"
page.tags="android", "performance", "profiling", "tools", "compute", "systrace"
page.metaDescription=Collect system and application process execution data to identify performance bottlenecks.
page.image=tools/performance/thumbnails/tools_systrace.png
page.article=true
@jd:body
In this document
You should also read
This walkthrough shows the basic usage and workflow for the Systrace tool in the Android
Device Monitor.
Systrace collects system and application process execution data and generates detailed,
interactive reports from devices running Android 4.1 and higher.
What it's good for:
- Evaluating container performance.
- Finding performance bottlenecks in the execution of your code.
Prerequisites
Working with Systrace
- Connect your mobile device to your computer.
- Open your application in Android Studio, build the source, and run it on your device.
- From Android Studio, start the Android Device Monitor: Tools -> Android -> Android
Device Monitor.
- Make sure your
device and the package for your application are showing in the Devices (DDMS mode) or
Windows (Hierarchy Viewer mode) tab.
You can choose Window > Reset Perspective to
get back to the default arrangement.
- Click the DDMS button, because Systrace is one of the DDMS tools.
- Click the Systrace button
.
- In the Android System Trace popup, choose your settings for the trace.
- Destination File: Where the trace is stored as an HTML file. Default is in
your home directory as
trace.html
.
- Trace Duration: Default is 5 seconds,
and 30 seconds is a good time to choose.
- Trace Buffer size: Default is unlimited.
- Enable Application Traces from: Make sure your app is selected.
- Select tags to enable: Choose at least one value to trace, for example Graphics
and View System.
- Click OK to start tracing.
- Interact with your app.
- When the trace is done, you are automatically returned to Android Device Monitor.
- Go to your home directory, or the directory you chose as the file destination.
- Open the
trace.html
file in your browser.