# InstrumentationContext

# InstrumentationContext

[View Source](https://cs.android.com/search?q=file:com/android/build/api/instrumentation/InstrumentationContext.kt+class:com.android.build.api.instrumentation.InstrumentationContext)  
Added in 4.2.0  

<br />

```
interface InstrumentationContext : Serializable
```

<br />

*** ** * ** ***

Instrumentation context data that will be injected to[AsmClassVisitorFactory](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/instrumentation/AsmClassVisitorFactory)on instantiation.

## Summary

|                                                                           ### Public properties                                                                           |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)`<`[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>` | [apiVersion](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/instrumentation/InstrumentationContext#apiVersion()) The asm api version to be passed to the[ClassVisitor](https://asm.ow2.io/javadoc/org/objectweb/asm/ClassVisitor.html)constructor. |

## Public properties

### apiVersion

Added in 4.2.0  

```
val apiVersion: Property<Int>
```

The asm api version to be passed to the[ClassVisitor](https://asm.ow2.io/javadoc/org/objectweb/asm/ClassVisitor.html)constructor.  

```text
| AGP version | Corresponding ASM version |
|-------------|---------------------------|
| 4.2.0 - 7.0 |            ASM7           |
|    7.1.0+   |            ASM9           |
```