Over17 / UnitySystracePlugin

Unity Systrace Plugin for Android
Apache License 2.0
70 stars 11 forks source link

# Unity Systrace Plugin for Android Systrace screenshot

Unity profiler has a nice timeline view with named sections. It may be very helpful to have these sections displayed on a system-wide trace collected from an Android device using systrace tool, as it gives information about scheduling, CPU status, other processes running in the system etc. In version 2018.2, Unity introduced a profiler native plugin API; used together with Android tracing API, it allows to develop an integration plugin.

IMPORTANT NOTE: In Unity 2019.1, native systrace support has been introduced (with same functionality as this plugin). It means that starting from 2019.1, there is no need to use this plugin - everything should just work out of the box.

Few comments on the implementation:

System Requirements

Usage

  1. Copy the contents of Assets directory to your project (it will be easier if you retain the path, then the plugin importer will set CPU architecture for the .so's correctly)
  2. Attach the Assets/Scripts/SystracePlugin.cs script to a game object of your choice in your first scene to make sure the plugin is loaded as early as possible
  3. Enjoy

How to Build

Run ndk-build in src/ directory of the repo. Grab the libraries in src/libs/

Useful Links

License

Licensed under Apache 2.0.

Unity Native Plugin API headers licensed under Unity Companion License, please see the header contents for details.