1

Is there a Gradle command-line command to run unit tests and espresso ui tests using only an apk(debug or release)? Any help is appreciated. thanks.

display name
  • 879
  • 11
  • 20

1 Answers1

0

Use ./gradlew connectedAndroidTest

It requires an debug .apk file in directory {project_folder}/app/build/outputs/apk

If you don't have any .apk there use in terminal ./gradlew assembleDebug

If you have Permission denied info please put: `chmod u+x gradlew' and then use above intructions.

Read this: What are list of tasks thats ConnectedAndroidTest executes?

I recommend you also for instrumentation tests using monkey framework.

If you have any question, please free to ask

Community
  • 1
  • 1
piotrek1543
  • 19,130
  • 7
  • 81
  • 94
  • Thanks for replying. But that will generate a new debug apk. you also need the source code. What I was looking for was that you have a debug apk, you take that debug apk to some other folder and run android espresso UI test using some command. – display name Dec 18 '15 at 22:59
  • Read please about Continuous Integration and configuring Jenkins/Hudson for Android. I think it may help you to deal with it. Yes, however you made a debug .apk you still need to be connected with Android SDK, so my solution is partially but ... the nearest you would be have a CI server which would made a debug app and run the test – piotrek1543 Dec 19 '15 at 09:23
  • 1
    I think there's no solution to make it without Android SDK. According to my experience, only `monkey` can make Android tests without source code – piotrek1543 Dec 19 '15 at 09:25