Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can only run tests in Android Studio

I migrated from Eclipse Adt to Android Studio, and under run the only option i have is to run "All Tests". How can I run the App as normal android app in the simulator?

like image 640
Kordi Avatar asked Jul 03 '13 21:07

Kordi


People also ask

What is Android studio used for in testing?

Android Studio is designed to make testing simple. It contains many features to simplify how you create, run, and analyze tests. You can set up tests that run on your local machine or instrumented tests that run on a device. You can easily run a single test or a specific group of tests on one or more devices.

How run all test cases in Android?

2. Run all tests in a single class. Right click on a test class name in the editor (or a filename in the project explorer) to run all tests in a single class. The default keyboard shortcut for this is Ctrl+Shift+F10 on Linux.

How many types of testing are there in Android?

In Android, there are two test types. The tests running on our local Java Virtual Machine (JVM). The tests running on our Android platform (in which we need devices or emulator).

How do you run all tests?

To run all the tests in a solution, choose the Run All icon (or press Ctrl + R, V). To run all the tests in a default group, choose the Run icon and then choose the group on the menu.


1 Answers

You can switch the run configuration with the drop down as shown in this screen shot:

enter image description here

Afterwards, click on the run or debug button to the right of the drop down in the toolbar.

If you need to add a new run configuration you have multiple options:

You can go to Edit Configurations... (from there or the Run menu) and configure a new run configuration. To add a new configuration manually you need to find the big + button on the top left. (Most of the time I use "Android Application", "Android Test" or plain "JUnit"). On the right hand side you can select USB device or emulator.

A quicker way to run an activity (assuming it's launchable) or all tests from a single file or package is to just right-click on the class or package, and click on "Run 'name' ". This can be done from the project pane. For single class files this can be done from the code editor, too. To run a single test you can right-click inside the test method and do the same.

like image 171
Bernd S Avatar answered Sep 22 '22 14:09

Bernd S