Skip to content

A bare bones example of how to instrument Android code using the AGP Instrumentation API.

License

Notifications You must be signed in to change notification settings

MCeley/InstrumentationExample

Repository files navigation

Instrumentation Example

Starting in version 8.0, Google is removing the Transform API from the Android Gradle Plugin. Since the example that Google maintains is out of date and takes some fixing up in order to get running, I wanted to create a simple, bare bones example of how to use transformClassesWith as part of the AGP Instrumentation API.

This project shows how to do the following:

  • Create a library module that has some logging functionality.
  • Create an Android app that includes that library module.
  • Create a Gradle plugin using the buildSrc directory.
  • Inject logging calls from the library module into the Android app using the AGP Instrumentation API.
  • Inject logging calls that consume parameters from the locals pool.

About

A bare bones example of how to instrument Android code using the AGP Instrumentation API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages