[Mobile] Configure Android Emulator
The Android Emulator simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device. To learn more about the Android emulator capabilities and system requirements, you can refer to this Android developer document: Run apps on the Android Emulator.
In this article, we guide you step by step on how to configure Android Studio Emulator for mobile testing.
Install Appium via NPM
- Download and install the suitable version of Node.js for your system from the Node.js website: Downloads.Note:
Make sure you install Node.js into a location with full Read/Write permissions.
- Install Appium version 1.12.1 or newer via NPM. To install the latest Appium version, copy and paste the command-line argument as follows:
npm install -g appium
Note:To learn more about Appium, you can refer to the Appium document here: Getting started.We recommend installing the latest Appium version.
- Some emulators support Appium directly when installed. If you want to run an application on an emulator, check your emulator settings before installing Appium.
Configure Android Studio
Installation
Download and install Android Studio. You can download Android Studio from the Android developer website here: Android Studio. Android Studio will guide you through each step during the installation and automatically download the necessary components to create emulators.
Create an Android project
-
After installing successfully, in the Welcome Page window, click Create new project. Android Studio provides a variety of sample projects for you to choose from. Here, we choose Empty Activity as an example, then click Next.
-
In the next interface, you can configure your project as follows:
Name The name of your project. Package Name By default, this is generated as com.example.<projectname>
.Save location The save location of your project. In case you want to change the default location, click Browse (folder icon). Language The language to build your Android app. You can select either Java or Kotlin from the dropdown menu. Minimum SDK The lowest version of Android supported by your app Use legacy android.support libraries. If your app requires legacy library support, check this box. To learn more about Android support libraries, you can refer to the Android developer document here: Support libraries
-
Click Finish. A new project window opens containing sample files to build an Android app. If you want to learn more about building an Android app, you can refer to this Android developer document: Build a simple user interface.