avatarJustin James

☰ MENU
A web developer and speaker from Arizona

Ionic - Setup on OSx


Posted In: ionic

Time to Read: 6 mins

If you are like me and just starting to work with the Ionic Framework and don’t already have a machine setup to do Android, iOS, Node, etc development then many of the guides out there leave out a number of steps that you need to do in order to get everything working.

Even being a windows user I was able to pretty easily get Ionic working on a Mac. The only difference between the Windows setup and the OSx setup is that you can only add iOS to Ionic on a Mac.

Software to be installed

General Install Steps

  1. Install homebrew and node js via http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/
  2. NPM packages
    • npm install -g cordova
    • npm install -g ionic
    • npm install -g gulp
    • npm install -g Bower
  3. Google Chrome - Download from https://www.google.com/chrome/browser/desktop/

Android Setup Steps

  1. JDK 7
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk/Contents/Home
  1. Android Studio
  2. Ant
export ANT_HOME=/users/jpjames/Development/apache-ant-1.9.4
  1. Android SDK
    • Download from [http://developer.android.com/sdk/index.html#Other](http://developer.android.com/sdk/index.html#Other_
    • Unzip to /users/[Your username]/Development
    • Open ~/.bash_profile and add the following line:
export PATH=${PATH}:/users/[Your UserName]/Development/android-sdk-macosx/tools:/users/[Your Username]/Development/android-sdk-macosx/platform-tools:${ANT_HOME}/bin
  1. Download correct Android API
    • in terminal type source ~/.bash_profile to load the ~/.bash_profile changes.
    • type android from terminal. If everything is working correct it will open up the Android SDK Manager.
    • Install API 23 with SDK Platforms checked
  2. Configure Genymotion Setup
    • After Genymotion is installed, open up the Genymotion UI and click on the Add Button.
    • Then click the Sign in button and follow the login instructions to login with the account that you create as part of the Genymotion download.
    • After you are logged in, select from the Android Version drop down 4.4.4
    • From the Device model drop down select a device type
    • Then select a device from the available list
    • Click the Next button.
    • Click the Next button and wait for the device to download
    • Click the Finish button.

iOS Setup Steps

  1. Install Xcode from app store. This will take awhile since it is ~2 gigs in size.
    • Once install is completed, open xcode and accept the license
  2. Install the IOS Simulator that Ionic will use.
npm install -g ios-sim

Verifying that everything works

  1. Open terminal
  2. Navigate the directory where you store you development projects (I use /users/[Your Username]/projects)
  3. From c:\projects type: ionic start todo blank
  4. cd into c:\projects\todo (directory was created by the ionic start command)
  5. Run the commands:
ionic platform add android
ionic platform add ios
  1. Run the command:
ionic build android
ionic build ios
  1. If using emulator run the command:
    • Note: The Genymotion emulator is seen as a device and not an emulator.
ionic emulate android
ionic emulate ios
  1. If running on a device run the command:
    • For Android, if using the Genymotion emulator, make sure to start the Genymotion device you downloaded before running the command below. You can start the device by selecting the device that you downloaded and clicking the start button.
    • For iOS: In order to run on an iOS device you must go through the Apple provisioning process.
ionic run android
ionic run ios

You are now ready to go create your ionic applications.

comments powered by Disqus