You are on page 1of 5

Appium Configuration in MAC

Prerequisite:
1)​ ​Install Brew​::
ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install​)"

2)Ensure you have admin access in your machine and you have set some password for your
account.

3) Now we have to install ANT from ​http://ant.apache.org​ .​After downloading it extract


it and paste the path in environment variables. (Link for Reference :
http://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.Wa-kU
q2B2nR​)
or
nano ~/.bash-profile

4) Shut down your terminal and try​ ant –version.

5) Install npm with iOS. (Reference


link:​https://docs.npmjs.com/getting-started/fixing-npm-permissions​)

6) If you still face permissions error, we can use ​sudo​​ link for the same
sudo authorize-ios

Other requirements for setting up Appium with iOS are as


under:
1)System Requirements:
a) Require Node 6 or above (brew install node)
b) Xcode 8 and iOS 10 (npm install -xcode)
(xcode-select --install)

npm install -g npm@latest


2)External dependencies
a)brew install ideviceinstaller
b)brew install carthage
c)npm install -g ios-deploy --unsafe-perm=true
​or
sudo npm install -g ios-deploy --unsafe-perm=true
d)npm install -g deviceconsole
e)gem install xcpretty (if you ​have write permissions​​ for ruby)
or
e)gem install xcpretty --user-install (Ensure you have set ruby in your
path)
f)brew install libimobiledevice -HEAD -iOS10
g)brew install libimobiledevice - iOS9

2.1) Before moving further ensure that you have appium and node installed in your machine
https://www.npmjs.com/package/appium-doctor/tutorial
https://github.com/appium/appium-doctor

a) Go to above link and download ​8.9.3 LTS.


Now use :
node -v
To see if Node is installed, type the above on your command line.
npm -v
To see if npm is installed, type the above on your command line.

b)In order to install , use command :


npm install -g appium@1.6

if it gives error change permissions or use


sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
or use
sudo npm install -g appium@1.6
RefLink​​:
https://docs.npmjs.com/getting-started/fixing-npm-permissions

b)node -v

c) Follow Above 1 and 2 step and then call


sudo npm install appium-doctor -g
or
npm install appium-doctor

d) Run command ::
Go to path where your node modules is present is present.
For me it is under:
/Users/ashish/node_modules/appium-doctor

So in terminal use :
cd /Users/ashish/node_modules/appium-doctor
then run
​node appium-doctor

e) Ensure everything is installed


- if command line tools are not installed go to below link
https://developer.apple.com/download/more/?=for%20Xcode

f)Set JAVA home


http://www.sajeconsultants.com/how-to-set-java_home-on-mac-os-x/

You may also use ​/usr/libexec/java_home -v 1.7​ command on a terminal


shell to figure out where is your java 1.7 home directory

WebDriverAgent Configuration
a) go to => node_modules/appium-xcuitest-driver/WebDriverAgent
i)open finder and paste the path
/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driv
er/WebDriverAgent
also open same in terminal using
cd
/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driv
er/WebDriverAgent

ii) use ls to list all files

b) mkdir -p Resources/WebDriverAgent.bundle

c) sh ./Scripts/bootstrap.sh –d
i) Before using open command , manually go to path where your
WebdriverAgent is present and open the xcode project - if you get
any error opening the project use command
sudo chmod -R 777 . appium-xcuitest-driver/* and ensure you are in
node_modules directory
d)​Open Xcode with​ WebDriverAgent.xcodeproj –

e) Click on project in Xcode and build WebDriverAgent project with sign::


i) In order to run app we need apple account to sign in . For this , go to Xcode and click
on Xcode in Top and click on preference and click on Accounts and add new Account.

ii) Now come back to Xcode and Select TEAM from Signing(Debug)
Now Run the same

iii) Success message for build success will come.

iv) Now click on WebDriverAgentRunner and select team , after selecting team you will
get provisioning profile error so for this go to BUILD
SETTINGS—>BASIC—>PACKAGING.

Click on Product Bundle Identifier change the identifier to


com.facebook.WebDriverAgentRunnerss by adding ss to existing.

v) Ensure that WebdriverAgentLib and WebDriverAgentRunner are building


successfully.

vi)Now run integration app and use COMMAND+1,2 or 3 to adjust phone screen

vii) Now we need to get the app for eclipse .. Goto Xcode—>File—>Project Settings and
click on arrow in DerivedData

viii)
DerivedData—>WebDriverAgent…vugp—>Build—>Products—>Debug-Iphonesimulat
or—->IntegrationApp.

ix) Drag the Debug-iphonesimulator in terminal and cd to its prior to change the directory
cd
/Users/deep/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgi
vnnvuygpwhzy/Build/Products/Debug-iphonesimulator.

You might also like