Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I send shell command in Espresso Test

I am new to Espresso. I want to test UI performance for an app(fluidity). I can create custom annotation in Espresso for getting fluidity for a particular test or automate new test cases. Does anyone know how to send command like "adb shell dumpsys gfxinfo app_package" from an espresso test?

like image 411
agasthya_tadakamalla Avatar asked Feb 20 '26 15:02

agasthya_tadakamalla


1 Answers

There's a method android.app.UiAutomation#executeShellCommand added in Android 21. And then just reading the result is needed with sth similar to what was implemented in the project screenshot-tests-for-android: implemented here

like image 153
R. Zagórski Avatar answered Feb 22 '26 03:02

R. Zagórski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!