Creating emulators and simulators

We'll now look at how we can create emulators and simulators, starting with an iOS simulator and then move on to an Android simulator.

An iOS simulator

We don't need to create a simulator for Mac; it already comes with Xcode under developer tools. When you start the Appium server for the first time, it will prompt you to authorize the use of Instruments, or if you are running it from npm, run sudo authorize_ios to work with the simulator.

An Android emulator

There are two ways to create an AVD for testing android apps:

  • Create the AVD from the command line
  • Create the AVD using the AVD Manager

Let's create AVD using the command line, as follows:

  1. Open the Command Prompt and type android list targets; this will generate a list of available targets.
  2. Run android create avd –n <name of the AVD> -t <targetID which you can get from the first step> --abi <again you can get it from first step>.

Note

You can also customize the AVD with options; visit http://developer.android.com/tools/devices/managing-avds-cmdline.html for more details.

The preceding link can change; if it has changed, then you can search on Google with the keywords "avds command line".

Second, we can create the AVD from the AVD Manager (you can find this under the Android SDK folder). We need to perform the following steps to create the AVD:

  1. Double-click on AVD Manager and click on the New button. The following screen will be displayed:
    An Android emulator
  2. Enter the name of the device and the necessary details.
  3. Click on the OK button.

After you complete these steps, the emulator will be displayed under the Android Virtual Devices tab.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.187.194