Saturday 28 January 2017

Installing ios-webkit-debug-proxy on MacOSX

Installing ios_webkit_debug_proxy on MacOSX:

ios_webkit_debug_proxy is used to access WebViews or MobileSafari on real iOS devices while testing with Appium.


Installation steps:
Step 1: install homebrew:
> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Step 2: Install ios_webkit-debug_proxy
> brew update
> brew install ios-webkit-debug-proxy

Step 3: To enable testing, we also need to install ideviceinstaller

ideviceinstaller is a tool to interact with the installation_proxy of an iOS device allowing to install,
upgrade, uninstall, archive, restore and enumerate installed or archived apps.
It makes use of the fabulous libimobiledevice library that allows communication with iOS devices.

> brew install ideviceinstaller


Using ios-webkit-debug-proxy:
> ios_webkit_debug_proxy -c udid_of_device:27753 -d
example:ios_webkit_debug_proxy -c 0e4b2f612b65e98c1d07d22ee08678130d345429:27753 -d

Installing Apache Ant on MacOSX

Install Apache Ant on MacOSX:
Pre-requisite: JDK 1.7 or above

Way 1: Without using brew (preferred):
Step 1: Download "apache-ant-1.10.0-bin.tar.gz" from "https://ant.apache.org/bindownload.cgi"

Step 2: Unzip the downloaded folder to the location you want.
Step 3: Set environment variable for maven in bash_profile.
> vim ~/.bash_profile

Step 4: Set path of maven/bin folder (which contains mvn file) in bash_profile as:
> export ANT_HOME="path to apache-ant_1.10.0"
> export PATH=$PATH:$ANT_HOME/bin
Save and quit bash_profile.

Step 5: check maven version.
> ant -v

Way 2: using homebrew:
Step 1: Install homebrew using command:
> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Step 2: Install maven using brew:
> brew install ant

Step 3: check maven version
> ant -v

Installing Maven on MacOSX

Install maven on MacOSX:
Pre-requisite: JDK 1.7 or above

Way 1: Without using brew (preferred):
Step 1: Download "apache-maven-3.3.9-bin.tar.gz" from "https://maven.apache.org/download.cgi"

Step 2: Unzip the downloaded folder to the location you want.
Step 3: Set environment variable for maven in bash_profile.
> vim ~/.bash_profile

Step 4: Set path of maven/bin folder (which contains mvn file) in bash_profile as:
> export M2_HOME="path to apache-maven-3.3.9"
> export PATH=$PATH:$M2_HOME/bin
Save and quit bash_profile.

Step 5: check maven version.
> mvn -v

Way 2: using homebrew:
Step 1: Install homebrew using command:
> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Step 2: Install maven using brew:
> brew install maven

Step 3: check maven version
> mvn -v

Installing ruby environment (rbenv) on MacOSX

Pre-requisites:
- OS X 10.10 or higher
- Xcode must be installed on Mac
- If Xcode beta version is installed, the name of Xcode file in "Applications" folder must be "Xcode".
(To install Xcode, either download from apple developer account or give "xcode-select --install" command in terminal)

Installing rbenv-

Step 1:
Install Brew using below command:

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

(This is the standard script that install homebrew to "/usr/local" folder, so that, user doesn't need to use "sudo" while using the
command "brew install ...")

Step 2:
Then install rbenv using brew command as:
terminal>> brew install rbenv

Step 3:
Export rbenv path to bash profile.
> vi ~/.bash_profile

In bash_profile, write following lines:
> export RBENV_ROOT=/usr/local/var/rbenv
> if which rbenv > /dev/null;
> then eval "$(rbenv init -)";
> fi;
save the bash_profile and quit.

Step 4:
Run the bash_profile.
> . ~/.bash_profile

Step 5:
give rbenv command and it should show the new version of rbenv (0.4.0, in this case)
> rbenv

Step 6: To install ruby-build on MacOSX
By default, rbenv doen't know how to install ruby build. Hence, for that we will use a plugin "ruby-build" by cloning a github project
from the link "https://github.com/rbenv/ruby-build" to a directory in our local drive "plugins"
For this step, first we need to create "plugins" folder in "/usr/local/var/rbenv"

//first go to home dir
> cd
> cd /usr/local/var/rbenv
> ls

If "plugins" folder is not found, create one.
> mkdir plugins
> cd plugins
Now clone the github project here.

> git clone https://github.com/rbenv/ruby-build.git

Step 7: Now check the latest version of ruby-build which can be installed using below command
> rbenv install --list

Step 8: install latest version of rbenv (2.1.2, in this case)
> rbenv install 2.1.2

Step 9: Now rbenv is installed on machine but the default version of ruby being used is still the
pre-installed ruby version in mac. Check it using command
> ruby -v

Step 10:
set our installed rbenv 2.1.2 as the global version.
>  rbenv global 2.1.2
> ruby -v

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Step 11: (To install bundler)
install bundler after rbenv is installed properly.
> gem install bundler

Step 12: (To install calabash-cucumber)
> gem install calabash-cucumber

Step 13: (To use binding.pry)
> gem install pry

Installing ios-webkit-debug-proxy on MacOSX

Installing ios_webkit_debug_proxy on MacOSX: ios_webkit_debug_proxy is used to access WebViews or MobileSafari on real iOS devices while ...