HaseebR7
HaseebR7

Reputation: 447

How to compile androidTest to Jar file in Android Studio?

I'd like to use my androidTest file as jar and execute it using the uiautomator command line on Android.

The file compiles to an APK just fine, but I'd like it in a Jar file.

Upvotes: 2

Views: 1093

Answers (2)

Sergey Krasilnikov
Sergey Krasilnikov

Reputation: 450

Starting from its 2.0 version uiautomator has moved from standalone 'uiautomator' test runner for jars to standard android 'am instrument' test runner for apps. This means test projects should be bound to a definite target app, that's why an apk is created. But uiautomator is still able to control other apps. My answer here might be useful: Build UiAutomator 2.0 from command line, but it is for eclipse and ant (mostly for ant).

Upvotes: 2

Arvind Yadav
Arvind Yadav

Reputation: 421

Try to add the dependency in your apps build.gradle.

enter image description here

Upvotes: 0

Related Questions