Android Studio creates new projects that will be deployed to the Android Emulator or a connected device in just a few clicks. Once your app is installed, you can use Apply Changes to distribute specific code and resource changes without creating a new APK.
Follow these steps to build and run your app:
- On the toolbar, select your application from the run configurations drop-down menu.
- From the target device dropdown menu, select the device on which you want to run your application.
Change the run / debug configuration
When you run your application for the first time, Android Studio uses a default run configuration. The run configuration specifies whether you will be deploying your app from an APK or an Android App Bundle, the module to run, the package to deploy, the activity to launch, the target device, emulator settings, logcat options, and more.
The default run / debug configuration creates an APK, starts the default project activity, and uses the Select Deployment Target dialog box for target device selection.
If the default settings don’t fit your project or module, you can customize the run / debug configuration or even create a new one at the project, default and module levels. To edit a run / debug configuration, choose Run> Edit Configurations.
Change build variant
By default, Android Studio creates the debug version of your app that is intended for development use only when you click Run.
To change the build variant Android Studio uses, choose Build> Select Build Variant in the menu bar.
For projects without native / C ++ code, the Build Variants panel has two columns: Module and Active Build Variant. The value for the Active Build Variant module deploys the connected device IDE, detects the structure variant and can be viewed in the editor.
To switch between variants, click in the Active Structure Variant cell of a module and select the variant you want from the list field.
For projects with native / C ++ code, the Compile Variants panel has three columns: Module, Active Build Variant, and Active ABI. Active Structure Variant module distributes the value to the IDE device and determines the structure variant that is visible in the editor. For native modules, the Active ABI value determines the ABI the editor uses, but does not affect the distributed.
To learn more about Android & IOS / Swift, join our Android & IOS / Swift trainings, create your own application with Android & IOS / Swift trainings