# EspressoDevice

# EspressoDevice

Artifact:[androidx.test.espresso:espresso-device](https://developer.android.com/jetpack/androidx/releases/test-espresso)  
[View Source](https://cs.android.com/search?q=file:androidx/test/espresso/device/EspressoDevice.kt+class:androidx.test.espresso.device.EspressoDevice)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/espresso/device/EspressoDevice "View this page in Java")

<br />

```
class EspressoDevice
```

<br />

*** ** * ** ***

Entry point for device centric operations

## Summary

|                                           ### Public companion functions                                            |
|---------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DeviceInteraction](https://developer.android.com/reference/kotlin/androidx/test/espresso/device/DeviceInteraction) | [onDevice](https://developer.android.com/reference/kotlin/androidx/test/espresso/device/EspressoDevice#onDevice())`()` Starts a {@link DeviceInteraction} fluent API call. |

## Public companion functions

### onDevice

```
fun onDevice(): DeviceInteraction
```

Starts a {@link DeviceInteraction} fluent API call. This method is used to invoke operations that are device-centric in scope. This method should not be called on the main thread.  

|                                                          Throws                                                          |
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------|
| [kotlin.IllegalStateException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html) | when being invoked on the main thread. |