Appium Server Configuration

Appium Doctor

Mobile environment set up is a little more complex than that of a web development environment because of the dependencies on various sdks, emulator/simulators and their versions. The permutations and combinations increase and hence often the questions that comes up for an automation engineer in terms of application compatibility are:

  • What version of android sdk
  • What version of Xcode and command line tools
  • What versions of emulators/simulators
  • What mobile devices (Android world vs. iOS world)
  • And more....

As you can see setting up a build environment is really dependent on how much clarity we have on the above questions. Also have clarity around how much of "backward compatibility" vs. "forward compatibility". Unless we are clear about this - we are not sure "what" we are testing. Sure we can go ahead and test on a developer environment. But that is not gauranteed to be the same on another developer's machine. Hence certifying/validating and running the automation tests are heavily dependent on the environment clarity.

For Appium environment too, the above settings are necessary and appium server can set most of those values. To being, it is always advisable to run the "appium doctor", which does basic checks on availability of Xcode / Android environment (Clicking the stethescope icon will run appium doctor from UI)

Developer Mode

Because of incompatibilities between items in the tuple [os, platform sdks, appium server versions etc.], we should get comfortable playing and installing multiple appium versions of servers

For example, we had versions 1.4.8,1.4.11 and 1.4.13 (source) while writing this book. A bug that New Xcode breaks and that was fixed using appium source is here

The developer mode enables us to point to use appium source as follows:

In the above case, appium source was downloaded to /Users/pmacharl/gitprojects/appium

Server Command line

While GUI is one way to start appium server, for CI, we need to be able to start the server from command line. Cmd is also necessary so that we can code away the process of starting the server. Another reason is to be able to progrmmatically (through bash or powershell scripts) kick off the server (For eg. through Jenkins CI job)

Command line Server Start

Command line Server start from source

Summary is to say that we should get comfortable starting appium server from command line

Appium Android Settings

Appium server provides quite many settings for android. It is beyond the scope of the intent of this book to go into each field, however we would like to mention that we can set each of the field value programmatically (which we will see during scripting). Please play with different settings to get comfortable.

The app path can point to an .apk file for example.

Similary in advanced settings, we pointed the Android sdk to a specific location instead of the default, which appium server might look to. This way we are sure to use only one version of android sdk and can make updates to that one only.

Appium iOS Settings

ios basic settings is as below. We can point to a specific .app if needed

Advanced settings is as below. We can change the Xcode version if we have multiple on our machine during debugging.

Appium Server Settings

Finally appium server itself has settings that can be changed as below

Note: All of the above settings are also available as server arguments by typing "appium --help" in command line

Summary

The above information at this point might seem overwhelming with respect to the number of options available, however it will become relatively easier, once we start coding away all these complexities. That is one of purposes of CI i.e. to automate away things that are mundane and repetitive.

results matching ""

    No results matching ""