Installation steps to get Appium fully working on MacOS 10.11

Hello all.

I’ve been going crazy the last weeks to get appium work on my MacBook Pro.

The last time I tried to install Appium I followed this http://appium.io/getting-started.html but for some reason I messed up all of it. So I’ve wiped and reinstalled a new fresh OS 10.11

I need:

  • Run tests on real Android devices
  • Run tests on real iOS devices
  • Install Android apps on real Android devices
  • Install iOS apps on real iOS devices
  • To get work Appium inspector on real Android devices
  • To get work Appium inspector on real iOS devices
  • Be able to launch Appium from command line

I don’t need:

  • Any simulators

What I’ve got right now:

  • Fresh install of MacOSX 10.11
  • Xcode 8.0

At this point you come in action guys, what I exactly have to install/configure to satisfy my needs.

¿When I really need to run installation commands as ‘sudo’?
¿Need to download both appium from https://bitbucket.org/appium/appium.app/downloads/ and npm’s to get GUI and command line Appium working in same machine?
¿Native instruments library?
¿Any useful trick?

Hope you can help me guys. Cheers.

first add your steps to clear what you tried. then mention problems :slight_smile: you met.

you also need to install Android Studio to make easier to get or check any Android SDK updates.

I tried too many things to remember, but essentially I was facing problems and looking for solutions continuosly (instruments failed, cannot install app, versions missmatches, unsigned app, missing libraires,…). After a while I reached a point that I don’t really know what was appium failing for, which software I installed, or which permissons I need.

So format hdd and reinstall El capitán. Let’s start again from the beginig :sweat_smile:

install java JDK:
download here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

install Android Studio:
download here: Descarga Android Studio y App Tools - Android Developers

in Terminal install brew:

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

install node.js:
download installer: Node.js — Download and run

in Terminal install npm:

brew update
brew install node
npm install -g npm

Update system preference:
open bash_profile in terminal:

nano ~/.bash_profile

paste following:

export ANDROID_HOME=/Users/jenkinss/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export JAVA_HOME=$(/usr/libexec/java_home)

save and exit

install Appium UI tool form here: https://bitbucket.org/appium/appium.app/downloads/appium-1.5.3.dmg

in Terminal install Appium command line:

npm install -g [email protected]
npm install wd

now fix Appium beta with:

cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
brew install carthage
npm i -g webpack
./Scripts/bootstrap.sh -d

you are ready to use Appium in command line and UI for Android (real device or emulator) and iOS (Simulator).

for real iOS device read forum to fix Appium 1.6.0-beta1 issues.

PS i guess Appium GUI 1.5.3 will not work with xCode8.0 :slight_smile: (did not try)

4 Likes

Thank you very munch.

I followed all steps carefully, at this moment I prefer stability and I have no need to use Appium1.6 so I’ve installed Appium master branch from npm command.

Xcode command line tools wasn’t installed, so I’ve installed it as following:

xcode-select --install

No problems encountered. Xcode is at version 7.3.1 (downloaded from Apple’s developer webpage).

I installed appium-doctor through npm too. No problems encountered.

Executing appium-doctor --ios looks good. All OK.
Executing appium-doctor --android fails on $JAVA_HOME/bin, so I added to the bash_profile this line:

export PATH=$JAVA_HOME/bin:$PATH

Now appium-doctor --android is all OK.

Now I’m executing Appium UI to get inspector working. Server starts all OK. At the moment to launch Appium inspector I encountered an error: ideviceinstaller is not installed.
So I installed ideviceinstaller as following:

brew install ideviceinstaller

No problems encountered during installation.

But now Appium inspector is giving another error trying to install the ipa file in real iOS device:

[debug] [iOS] App is not installed. Will try to install.

[MJSONWP] Encountered internal error running command: Error: Installing /var/folders/kl/7nx313b50_d957z11gklppxh0000gn/T/2016822-25419-1awi904/Payload/MyAppName.app failed
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/node-idevice/main.js:159:6
at ChildProcess.exithandler (child_process.js:193:7)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Socket. (internal/child_process.js:323:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)

I think this was one of the problems I was facing for in previous installations of Appium. As far I know this error is caused by the folder /var/db/lockdown
If that’s right I think I must give permissions to the lockdown folder with the following command:

sudo chmod 777 /var/db/lockdown

I don’t want to risk so I ask you if it my thoughts are correct.

It is the best way to get it work running a chmod?
Why not chown?
Some extra software to install?

Device properties that I’m trying to get it work:

  • iPhone6 iOS 9.2.1
  • UI Automation enabled in developer settings
  • Appium capabilities set correctly to this device. Setup made carefully.

Thank you, it is going by right way. :grin:

  1. current master is 1.6.0. which version you installed? run ‘appium’ in terminal
  2. read appium logs and check what command it uses to install “ipa” file on device. now you can use it yourself in terminal to test.

I installed command line appium via npm install -g appium.

$ appium --version
1.5.3

I have installed Appium UI too. About Appium says: Version 1.5.3 (Ara)

I was unable to find the command to install ‘ipa’ file in log. I’ve seen it hundred of times, ideviceinstaller -u uuid -i pathtotheipa or something like that, but I couldn’t see it today.

But there is no drama. I finally got appium working!:astonished:

From the status of my last post I performed the following steps:

  1. $ sudo chmod 777 /var/db/lockdown
  2. Close XCode (if opened)
  3. Deattach device (if attached) from your computer > Reboot it
  4. Open XCode > Window > Devices > ctrl + click on my attached device > Show provisioning files… > add your developer provisioning profile
  5. You would be able to select your device in your Instruments developer tool at this moment.

Once Xcode Instruments developer tool is able to select your device you are ready to launch Appium server and start inspector. Worked for me!:triumph:

Thank you very much to the Appium community. Specially to you @Aleksei.
I hope this thread helps many people.

There exists some SOLVED tag or similar?

chmod isn’t the right approach. It will break again.

There is a fix for this issue in libimobiledevice (used by ideviceinstaller). You just need the latest version of libimobiledevice. Try this:

brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install ideviceinstaller
brew link --overwrite ideviceinstaller

2 Likes

While Installing App-inspector in Max os x, its showing following error please help me on this,

Error: $JAVA_HOME is not set
at checkJavaHome.then.catch.then.then.catch.then.std (/Users/sarathi/node_modules/java-home/lib/java-home.js:89:25)
at process._tickCallback (internal/process/next_tick.js:109:7)
/Users/sarathi
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open ‘/Users/sarathi/package.json’
npm WARN sarathi No description
npm WARN sarathi No repository field.
npm WARN sarathi No README data
npm WARN sarathi No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/uiautomator-client):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node ./scripts/build.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

I have set JAVA_HOME in .bash_profile, also able to see Java version while typing $JAVA_HOME -version

Thanks,
Sarathi.

Iam doing appium with real ios device testing ,

An unknown server-side error occurred while processing the command. Original error: Could not verify AppiumForMacDriver install; please install to your /Applications folder (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 163 milliseconds

could you please help me to resolve?

Appium Installation full setup on Mac for real device iOS automation (GUI & Command line tools)

Here I have displayed the procedure for the complete installation of Appium in mac for real device iOS automation in My own blog. I have given the steps for Command line tool installation and GUI installation of appium in mac in my blog.

Thank you very munch @BShivShankar Your blog helped me for understanding again how to get to work real devices on Appium.

Nowadays exists a couple official guides for this purpose. I can confirm there are quite accurate and easy to follow.

Install Appium on mac os: https://github.com/isonic1/appium-workshop/blob/master/Appium%20Mac%20Installation%20Instructions.md

Get Appium to work on real devices: http://appium.io/docs/en/drivers/ios-xcuitest-real-devices/

Hope this post still helping to avoid some suffering. Good luck automators!

Thank you so much @hamena. Your comments and praise will encourage for automators like us and always wish to give hand for emerging testers. Kindly do follow my blog for more upcoming useful posts. :smiley:

Hi Sara
i need your help here
Im working on mac os desktop application

i am unable to use driver.findElementByXapth().click;

Hi Hema Have you setup environment?