Prepare your Mac for (mobile) test automation
The Mac mini I use for mobile test automation got stuck at booting up after an update of OSX (thanks Apple) and there was no way to recover (I didn't have a time machine backup). Maybe I could have found a clever way to restore access to the Macintosh HD, but I decided to just go for the reinstall instead and make it a bit more detailed this time than in one of my previous blogposts.
To change it, you can do what they also described on this Appium GitHub topic:
Once all that is done you need to add ANDROID_HOME to your bash_profile to make sure we can use the ADB command.
After that, you can install Carthage via the terminal `brew install carthage`.
Or open a simple server via terminal 'appium &'
For running Appium with a certain chrome driver version see stackoverflow.
Installations
OSX updates (1)
First make sure you have installed all OSX (security) updates. Via the app store > updates > check for updates.Install Xcode
- Navigate to the App Store
- Search for Xcode
- Login with Apple ID
- Get/Install (if asked, also install the command line tools)
To change it, you can do what they also described on this Appium GitHub topic:
- sudo xcode-select -s /Applications/Xcode.app
- Quit Appium, Restart Appium and try again
Install Android Studio
- Download the installer
- Open the dmg
- Drag Android Studio to the Applications folder
- Open android studio
- Don't import anything > next
- Custom installation
- Select the theme you like
- Select Android Vitual Device
- Emulator settings leave default, next
- Finish
Once all that is done you need to add ANDROID_HOME to your bash_profile to make sure we can use the ADB command.
- nano ~/.bash_profile
- export ANDROID_HOME=<your_path_to_the_android_sdk>
- export PATH=$ANDROID_HOME/platform-tools:$PATH
- export PATH=$ANDROID_HOME/tools:$PATH
If you forgot to write down the location, open Android studio and find it in the preferences (Appearance & Behaviour > System Settings > Android SDK).
More info can be found on this stackoverflow topic.
OSX updates (2)
Software update (again)- App Store >> check for more updates (Xcode / command line / etc)
- Install all updates that are shown
Install Java
Download the Java SDK from the oracle website and install it.Install Homebrew + Carthage
Download and install via the instructions on the brew website.After that, you can install Carthage via the terminal `brew install carthage`.
Install Ruby + gems
- Install Ruby via the terminal `brew install ruby`
- Install the lapis_lazuli gem via the terminal `gem install 'lapis_lazuli'` (will also take care of cucumber, water, selenium-webdriver and some other needed gems)
- Install the appium_lib gem via the terminal `gem install 'appium_lib'`
Install Appium
Download the latest version from the Git website. Installing is as simple as just opening the dmg, and drag the Appium into the Applications folder.
OR via the terminal
OR via the terminal
- brew install node
- npm install -g appium
- npm install wd
Download latest Chrome driver
Download the latest Chrome driver for Android (if needed, which depends on the the version of Chrome on the Android phone and on the the version that comes with Appium, see running Appium below).
Next steps
Run the iOS simulator
- Start Xcode
- Xcode menu
- Open developer tools
- Simulator >> will start iPhone X with iOS 11.3
Run the Android Emulator
- Start Android studio
- Click on the AVD manager logo in the top right corner
- If needed add a new device that is matching the capabilities you need
- I always choose one with play store so I can update the Chrome app easily
- It takes some time to download other images (e.g. Android 8.0, 7.1, 7.0)
- If not sure which one to take, go for the recommended
- Start up a device (e.g. Nexus 5 X with Android 8.1)
- Log into the Google Play Store
- Update the apps (or at least the Chrome app)
- Enable Developer Options and make sure that debugging option is enabled (not sure if this was needed with an emulator, but with a real device this for sure is needed so I always enable this by default)
Run Appium
Open Appium desktop app and start a simple server (for test).Or open a simple server via terminal 'appium &'
For running Appium with a certain chrome driver version see stackoverflow.
Final words
With this step by step guide, you should now be able to start you mobile tests as described in my previous blogpost. In case you're stuck with anything, give me a ping and I'll try to help out.
Comments
Post a Comment