title: How to run a single unit test using gradle wrapper 2.2.1 from command line
body: <p>Using Android studio with gradle wrapper version 2.2.1, I am trying to run all the tests in one single test class, as well as a specific test inside that class and have tried using:</p>
  
  <pre><code>./gradlew  test --tests DownloadsActivityTest
  </code></pre>
  
  <p>like the documentation suggests, as well as  </p>
  
  <pre><code>-DandroidTest.single=DownloadsActivityTest
  </code></pre>
  
  <p>But neither of these versions work. </p>
  
  <p>How do I run a single test class, and a single test from the command line using the gradle wrapper?</p>
  
  <pre><code> ./gradlew --version
  
  ------------------------------------------------------------
  Gradle 2.2.1
  ------------------------------------------------------------
  
  Build time:   2014-11-24 09:45:35 UTC
  Build number: none
  Revision:     6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
  
  Groovy:       2.3.6
  Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
  JVM:          1.7.0_51 (Oracle Corporation 24.51-b03)
  OS:           Linux 3.17.6-200.fc20.x86_64 amd64
  
  [16:33][j@localhost:~/myHomeDir]$ ./gradlew  test --tests DownloadsActivityTest
  WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
       In case of problem, please repackage it with jarjar to change the class packages
  WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.3 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
       In case of problem, please repackage it with jarjar to change the class packages
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Problem configuring task :app:test from command line.
  &gt; Unknown command-line option '--tests'.
  
  * Try:
  Run gradlew help --task :app:test to get task usage details. Run with --stacktrace     option to get the stack trace. Run with --info or --debug                                                                                                                                  option to get more log output.
  
  BUILD FAILED
  
  Total time: 4.466 secs
  </code></pre>