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?
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.
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.
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).
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.
You can switch the run configuration with the drop down as shown in this screen shot:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With