Appium is an open source project and has made design and tool decisions to encourage a vibrant contributing community. Use your favorite tools Appium aims to automate any mobile app from any language and any test framework, with full access to back-end APIs and DBs from test code. Tallygenicom 6600. Appium’s desktop app supports OS X, Windows and Linux Appium-Desktop for OSX, Windows and Linux We're open for discussion and would love to hear your voice in the conversation about the future of mobile apps testing!
Problem I was facing with Appium that I decided myself below. I could not find a way to install required components for Appium without using SUDO. After installing it all with SUDO, then trying to run Appium, I was getting error that Appium and NODE should have been installed without SUDO. Trying to search online for solution took me quite a while since there are almost no tutorials exist online for Appium to run on MAC while developing tests using JAVA.
Below is the step by step instruction on how to set up Appium on Mac OS and run a first test from within a Java Class. Just copy and paste commands into Terminal on your Mac and you will set it up. I wish there were more clear step by step tutorials online for Appium. Tutorials written by developers of Appium are so vague, I don't even want to recommend to look for answers on their website. Answered by Igor Vishnevskiy I have been looking for the answer everywhere on the internet and could not find anything. It took me some time to make this work.
I hope this quick guide will help the next engineer to save some time on setting up Appium to run automation on Android devices. Appium will not run if NODE or Appium itself is installed using SUDO and MAC won't let you install neither without using SUDO. There is a workaround though.
My steps make it possible to install and setup Appium the right way without need to use SUDO for installation. Everything is tested and it works. Below are the steps. Enjoy!There could be one problem while setting up Appium using bellow steps.
If you face some errors while creating or saving data into certain directories, that is caused by the luck of write permissions set to those directories. What you will need to do is to set CHMOD to 777 to the directories where components of Appium are trying to write while installing and then rerun all steps again.Step 1:Install JAVA 6. You will need JAVA 6 with Appium. I used this post to help me set up Appium on my Mac. I also used other sources to do my installation completely. Steps that need to follow:.
install xcode. install xcode command line tool.
install Appium GUI.dmg file Appium. Install homebrew (assuming you have ruby installed on your mac, if not install ruby first).
Install Java (it should come with mac OS). Install node and Maven using brew command from terminal. Install Appium server using node.
npm install –g appium. appium &. Authorize your iOS simulator and device to access by Appium by typing the command from terminal: sudo authorizeios:)I have made a video about how to configure appium on a Mac computer which can be here.And slides can be. Follow these steps.Pre-requisites to download.1.
Android SDK3. Android.apk file5. Xcode and command line toolsProcess:. Install Xcode with command line tools and appium. Paint the town red gameplay. Download all the Android SDK necessary tools, that includes mandatorily platform-tools and build-tools.
Download and install Java JDKSetting $Path and Configuring. Open bashprofile with the command open.bashprofile.Copy the contents to your.bashprofile export ANDROIDHOME=/Users/username/Library/Android/sdk. (copy it from the sdk manager in android studio)export PATH=$ANDROIDHOME/platform-tools:$PATHexport PATH=$ANDROIDHOME/tools:$PATHexport JAVAHOME=$(/usr/libexec/javahome)export PATH='/usr/local/opt/openssl/bin:$PATH'Copy the above, and save the.bashprofile. Go to Appium, and click on Android symbol. Select and choose the.apk(place the apk in the project folder).
Tick on the Device name and choose the applicable Android version in the capabilities. In the Advance settings under Android, choose the sdk path(Copy from the android sdk manager).Click on the settings symbol, and add value to the environment variables ANDROIDHOME /Users/username/Library/Android/sdk (Copy the path from sdk manager).Connect the device or launch the emulator, and click on Launch in appium, then click on Inspector, this should create a session and launch the app in your mobile and grab the current screenshot.
>>>>>> Never EVER EVER EVER sudo install anything!!! It will make all our lives easier, trust me! <<<<<<
Install Xcode or Upgrade to 8.3.3
- Goto the Mac Appstore and search for Xcode and click the Get button.
- After installation, install the Commandline Tools.
- Open a terminal and run
$ xcode-select --install
Install Homebrew
- Open a terminal and run
$ /usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
- See additional install instructions here for further details.
- Test install by running
$ brew --version
. You should see something like Homebrew 1.3.2.
Install Carthage
- Open a terminal and run
$ brew install carthage
- This is a dependency check for appium-doctor but not really needed for Android. Install it anyway as you may do iOS automation in the future.
Install JAVA
- Open a terminal and check java version:
$ java -version
- If the version is less than 1.8 or the command is not recognized you need to install java.
- If the version is 1.8 or greater then go to Ruby install.
- Go here
- Download and install jdk-8u144-macosx-x64.dmg
- Open Downloads folder and double click the DMG file.
- Double click the JDK 8 install icon.
- Click the Continue button.
- Click the Install button.
- Enter your password to install software on your system.
Install Ruby
*** DO NOT use the default system OSX Ruby. Install a newer version with a Ruby package manager RVM (below instructions) or RBENV.
- Open a terminal and check ruby version:
$ ruby -v
- If the version is less than 2.3 or the command is not recognized you need to install ruby.
- run
$ curl -sSL https://get.rvm.io bash -s stable --ruby
in terminal. This will install RVM (Ruby Version Manager) and install the latest Ruby version. - Run
$ rvm list
and see which ruby version was installed. Note the version number for next step. - Run
rvm --default use 2.4.0
to set the version as default. e.g. 2.4.0 instead of 2.x.x..
Install Node (We need this for parallelization)
- Open a terminal and run
$ brew install node
. - Test install by running
$ npm --version
. Verify version 5.3.X or greater is returned. - Test Node is installed by running
$ node -v
. Verify version 8.5.X or greater is returned.
Install Android Studio
- Click here to download.
- Open downloads folder and double click the Android Studio DMG file.
- Drag and drop the Android Studio icon over to Applications folder. Close the install dialog.
- Open Finder and goto Applications folder. Double click Android Studio.
- Select 'I do not have a previous version of studio or I do not want to import my settings' and click OK button.
- Click Next.
- Select Standard Installation and click the Next button.
- Click the Finish button.
- Enter password to allow HAXM to make changes to your system. HAXM is very import for emulator perforamce.
- Click the Finish button.
Install Android 6.0 SDK 23
- Click the Configure button. It's on the lower right side of the Android Studio welcome dialog.
- Click SDK Manager in the configuration dropdown.
- Select Android 6.0 (Marshmallow) SDK.
- Why Android 6.0? It's the most common SDK version used throughout the world and is a good starting point until you get more comfortable with mobile automation. See here!
- Click the 'Show Package Details' checkbox on lower right.
- Check the following SDK dependencies to install:
- Android SDK Platform 23
- Sources for Android 23
- Intel x86 Atom System Image.
- Intel x86 Atom_64 System Image.
- Google API's Intel x86 Atom System Image
- Google API's Intel X86 Atom_64 System Image
- Click the Apply button.
- On the next screen click the Accept radio button.
- *** Take note of your SDK Path! It's at the top of the Component Installer dialog. e.g SDK Path: /Users/YourUser/Library/Android/sdk
- Click the Next button to start the installation of SDK 23 dependencies. This will take a whie to complete..
- When everything has completed downloading, click the Finish button.
- Click the OK button to close the Component Installer dialog.
- Close Android Studio
Add Environment Variables
- Determine which shell you use. Open a terminal and run
$ echo $SHELL
. - Based on your shell, you need to edit your profile. e.g.
$ vi ~/.bash_profile or ~/.profile or ~/.zshrc
. - Add the following variables.
- export ANDROID_HOME=//Users/YourUser/Library/Android/sdk
- export JAVA_HOME=$(/usr/libexec/java_home)
- Add the Android sdk paths to your existing PATH=$PATH variable. e.g. :/Users/your-user-name/android-sdk-macosx/sdk/tools:/Users/your-user-name/android-sdk-macosx/sdk/platform-tools:/Users/your-user-name/android-sdk-macosx/sdk/build-tools:
- Save profile.
Press shift + :
typewq!
and press enter. - Force close/quit all your terminal windows and open a new one.
Test Environment Variables
- Run
$ java -version
in terminal. You should see something close to thisjava version '1.8.0_144'
or greater is returned. - Run
$ ruby -v
in terminal. You should see something close to thisruby 2.4.1
or greater. - Run
$ emulator -help
. You should see menu options for android emulator manager. - If any of the above is not working check to make sure the install locations are correct and reflected correctly in the path environment variable.
Test ADB is installed.
- Run
$ adb
in CMD. You should see thisAndroid Debug Bridge version 1.0.39
or greater along wiht additional menu options.
Create Android Emulator
- Run
$ android create avd -n EM1 -k 'system-images;android-23;google_apis;x86'
in terminal. - Enter NO to not create a custom hardware profile.
- Run the emulator:
$ANDROID_HOME/tools/emulator -avd EM1
- Verify avd output on startup includes:
- Hax is enabled
- HAX is working and emulator runs in fast virt mode.
- Verify emulator fully starts and you see the android home/desktop screen.
- Note: Emulator can also be created via the AVD Manager IDE inside of Android Studio. However, you would need to create a new project or import one to see this menu option.
Install Appium Desktop
- Download and install Appium Desktop here
Install Appium Doctor via NPM
- Run
$ npm install -g appium-doctor
- Run
$ appium-doctor
(checks setup is correct on machine)- Verify 'info AppiumDoctor Everything looks good, bye!' is displayed.
- If there are things missing please go back to the install instructions above or environment variable setup.
Install Appium via NPM
- Run
$ npm install -g appium
- Verify appium installed correctly by doing
$ appium -v
- Verify appium installed correctly by doing
Install Sublime (We should all use same editor)
- Download and install here
Install Allure Report Framework
- Open terminal and run:
$ brew tap qatools/formulas
$ brew install allure-commandline
- Test allure works. Run
$ allure
in terminal. Verify you see allure menu options after.