Skip to content

Instantly share code, notes, and snippets.

@mehmetboraezer
Created March 17, 2017 16:41
Show Gist options
  • Save mehmetboraezer/ff45e42047c0ad7c17d8eeb0b8a24af7 to your computer and use it in GitHub Desktop.
Save mehmetboraezer/ff45e42047c0ad7c17d8eeb0b8a24af7 to your computer and use it in GitHub Desktop.
Appium iOS Environment Setup Steps without GUI

Appium iOS Environment Setup Steps

After Installation OSX

  • Remove unnecessary dock items.

  • Allow remote login (ssh) and screen sharing on system preferences.

iTunes Configuration

  • Open iTunes and accept user agreement.

  • If update is available, install last version.

Update OSX

  • Open App Store and install last version.

Install Xcode and Command Line Tools

  • Xcode installer needs environment variables with your credentials to access the Apple Developer Center. Set these variables in the .bashrc file:

     XCODE_INSTALL_USER
     XCODE_INSTALL_PASSWORD
    
  • Load new environment variables

     source ~/.bashrc
    
  • Install Xcode command line installer (xcversion)

     curl -sL -O https://github.com/neonichu/ruby-domain_name/releases/download/v0.5.99999999/domain_name-0.5.99999999.gem
     sudo gem install domain_name-0.5.99999999.gem
     sudo gem install --conservative xcode-install
     rm -f domain_name-0.5.99999999.gem
     xcversion install 7.3.1
  • Install Command Line Tools

     xcversion install-cli-tools
  • Accept Xcode Licence

     sudo xcodebuild -license accept
  • Setting up instruments without delay (iwd) for xcode 7 and iOS >= 9.0

    For iOS >= 9.0 instruments without delay (iwd) does not work by passing binaries through the command line (appium does this under the hood for xcode < 7). See iwd

    For enabling iwd for xcode >= 7,

     sh <appium-instruments>/bin/xcode-iwd.sh <path to xcode> <path to appium-instruments>

    eg. sh ./bin/xcode-iwd.sh /Applications/Xcode.app /Users/xyz/appium-instruments/

    Note: iwd with xcode7 will only work for iOS >= 9.0, you can switch to older xcode for iOS < 9.0

Install Brew

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

Install Node.js

brew install node

Install Java

brew install java

Install Appium (version 1.5.*)

npm install -g appium

Enable Xcode “Developer Mode”

sudo /usr/sbin/DevToolsSecurity --enable

Install ideviceinstaller

brew install ideviceinstaller
sudo chmod -R 777 /var/db/lockdown/

Install iOS WebKit Debug Proxy

brew install ios-webkit-debug-proxy

Set Auto-login

git clone https://github.com/mehmetboraezer/autologin && cd autologin/source
sudo chmod +x autologin.sh keygen.py
sudo ./autologin.sh <USERNAME> <PASSWORD>

Disable screensaver

sudo defaults delete /Library/Preferences/com.apple.screensaver loginWindowIdleTime
sudo defaults delete /Library/Preferences/com.apple.screensaver loginWindowModulePath

Disable password requirement after sleep or etc.

osascript -e 'tell application "System Events" to set require password to wake of security preferences to false'

Generate a random "ComputerName" at each reboot

echo '@reboot /usr/sbin/scutil --set ComputerName $RANDOM' > cron
sudo crontab cron && rm cron

Disable Notification Service

launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
killall -9 NotificationCenter

Install Python3

brew install python3
brew linkapps python3
pip3 install virtualenv

Turn off notifications from startup

sudo defaults write -g ApplePersistence -bool no

Reboot system

sudo shutdown -r now "Rebooting now"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment