Tips & Tricks

Let’s discuss some common issues and solutions.

We'll cover the following

DesiredCapabilities

We can learn about all the capabilities of Android and iOS at https://caps.cloudgrey.io.

Android

  • Make sure the ANDROID_HOME environment variable is set with the proper value.

  • Make sure the Android device (real device or emulator) is up and running.

  • If the connected real device is not recognized, make sure to enable “Developer Options” and "USB Debugging"

  • It is recommended to run the command adb kill-server && adb devices once to reset the connection to the android device before starting the Appium session.

  • If an Android emulator is used with Fastboot and the emulator isn’t detected by adb devices, try doing a cold boot : Android Studio → Tools → AVD Manager → Actions → Cold Boot Now

  • Make sure “Verify Apps” in settings of “Developer Options” is disabled, to allow Appium to install apps without any issues.

  • When using uiautomatorviewer, make sure only one android device is connected.

  • When uiautomatorviewer is failing to capture the current state of the application, kill the Appium session and retry.

     ps -ef | grep -i appium | awk '{print $2}' | tr -s '\n' ' ' | xargs kill -9
    

iOS

  • Make sure Instruments.app is not open.

  • When running Appium for the first time, make sure to authorize the use of Instruments. See the UIAutomation Driver doc.

  • If you’ve ever run Appium with sudo, you might need to run sudo rm /tmp/instruments_sock and try again as without sudo.

  • If Instruments is crashing when running against a physical device (“exited with code 253”), ensure Xcode has downloaded device symbols. Go to Window → Devices, and it should start automatically. This is needed after any iOS version upgrades.

  • If you see an iOS Simulator failed to install the application and the path is correct, try restarting the computer.

  • Make sure your MacOS keychain that holds the certificate(s) needed for building your app and the WebDriverAgent is unlocked.

Get hands-on with 1400+ tech skills courses.