Skip to content

ionic setup

mdublin edited this page Jul 27, 2017 · 11 revisions

IF YOU NEED TO RECREATE WORKING LOCAL REPO CURRENTLY YOU HAVE TO:

  1. start new ionic project (call it onpoint) in a directory where the actual onpoint git directory is not located
  2. make sure to use Ionic v1 flag when starting: $ ionic start onpoint --type ionic1
  3. cd into this new project, then pull down the actual onpoint repo:

$ git init

$ git remote add origin https://github.com/votesmart/onpoint.git

$ git fetch --all

$ git reset --hard origin/master

A major issue seen recently, if you do updates and don't keep track, is potentially different versions of Ionic that are install globally vs locally in the project/repo directory.

right now, current global version is 3.6.0 so you have to update the package.json to that version as well, so you don't get any errors regarding node_modules not found, etc, when running ionic

Unless otherwise indicated, all commands executed from root of Ionic project.

$ git clone https://github.com/votesmart/onpoint.git

$ cd onpoint/www/lib

$ rm -rf votesmartjs

$ git clone https://github.com/votesmart/votesmartjs.git

$ cd ../..

$ git submodule init

ignore warning about angular-soap

$ git submodule update

$ cd onpoint/www/lib/votemsartjs

$ git checkout two

$ npm install

$ npm install -g ionic

$ npm install -g cordova

$ gulp

until this is added to master branch package.json, install $cordovaLaunchNavigator

$ cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator

Git repo for this plugin: https://github.com/dpa99c/phonegap-launch-navigator

$ ionic cordova add platform ios

respond Y to everything

$ ionic cordova platform add ios

$ ionic cordova platform add android

$ ionic cordova build ios

$ ionic cordova build android

See here for emulator configuration

For device ios build

$ cd platforms/ios

$ open -a Xcode onpoint.xcodeproj

In General settings for onpoint project, you'll need to change both the bundle identifier and move up the deployment target to ios 10.3 as it currently defaults to ios 9.

Make sure iPhone is connected then just run the build.

Clone this wiki locally