简体   繁体   中英

Install application and espresso test apk and run on device

I am very new to android and learning it for the first time.

On my android project, when I do

gradle build

gradle assembleDebugAndroidTest

I get the application and test apks

So I have these two questions

1) How do I install them on a specific connected device/emulator?

2) How do I start the tests to run on the device ?

Thanks very much.

Run adb devices to see your connected devices:

List of devices attached 
emulator-5554   device
emulator-5556   device

Then, use ANDROID_SERIAL to specify the one you want.

To install:

ANDROID_SERIAL=emulator-5554 gradle installDebug

To run tests:

ANDROID_SERIAL=emulator-5554 gradle connectedAndroidTestDebug

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM