Clone the Ushahidi repo
git clone [email protected]:ushahidi/tenfour-mobile.git TenFour_Mobile
cd TenFour_Mobile
Ensure the latest XCode is installed
Download and install XCode
https://developer.apple.com/xcode/
Once XCode is installed, install the command line tools
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcode-select --install
Check your version of GCC
gcc --version
Ensure that Homebrew is installed
Install Homebrew, if its not already installed
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Add the Homebrew location export PATH="/usr/local/bin:$PATH"
to your environment $PATH
.
open -e ~/.bash_profile
Update the Homebrew recipes
brew update
If you have permission issues with /usr/local/
, try running
sudo chown -R `whoami` /usr/local/
brew update
Check health of Homebrew recipes
brew doctor
Install Node via Homebrew
brew install node
Check the version of Node
node --version
Install some NPM utilities
npm install -g npm
Check the version of NPM
npm --version
Install the latest Cordova
Install the latest Cordova
npm install -g cordova@latest
If you run into permission problems, try using sudo
sudo npm install -g [email protected]
Check the version of Cordova
cordova -v
Clean up the Cordova build files
cordova clean
Install the latest Ionic and necessary dependencies
Install the latest Ionic
npm install -g ionic@latest
If you run into permission problems, try using sudo
sudo npm install -g ionic@latest
Install some Ionic and Cordova utilities
npm install -g xcode@latest
npm install -g cordova-common@latest
npm install -g cordova-ios@latest
npm install -g cordova-android@latest
npm install -g cordova-browser@latest
sudo npm install -g ios-sim@latest
npm install -g ios-deploy@latest
npm install -g android-simulator@latest
Check the version of Ionic
ionic info
List the root level NPM packages
npm list --depth=0
Remove, Clean, Install
rm -rf node_modules/
npm install
Ensure that Java JDK is installed on your machine
Download and install the latest Java JDK
https://support.apple.com/kb/dl1572?locale=en_US
Check your version of Java
java -version
Ensure the latest Android is installed
Download and install the latest Android Studio
https://developer.android.com/studio/index.html
Once installed, find the location where the Android SDK is installed
Android Studio > Preferences > Appearance & Behaviour > System Settings > Android SDK > Android SDK Location
Open your ~/.bash_profile
to include the location of the Android SDK
open -e ~/.bash_profile
Add the lines to the bottom of your ~/.bash_profile
, pointing to your Android SDK Location
(mine was /Library/Android
)
export PATH=/Library/Android/tools:/Library/Android/platform-tools:$PATH
export ANDROID_HOME=/Library/Android
export ANDROID_SDK=/Library/Android
export ANDROID_SDK_ROOT=/Library/Android
Test running the Android Command Line Tools
android --help
Update the necessary SDKs
android list sdk --all --extended
android update sdk -u -a -t android-24
android update sdk -u -a -t extra-android-m2repository
android update sdk -u -a -t extra-google-google_play_services
android update sdk -u -a -t extra-google-analytics_sdk_v2
android update sdk -u -a -t extra-intel-Hardware_Accelerated_Execution_Manager
Run Android SDK Manager
android sdk
Run Android Virtual Device Manager
android avd
Check whether the Cordova requirements for iOS are installed
cordova requirements ios
Build the project for iOS
ionic cordova build ios
Run the app in the iOS Simulator or attached iOS device
ionic cordova run ios --livereload --consolelogs
ionic cordova run ios --livereload --consolelogs --target "iPhone-SE"
Build the app in release and production mode for archiving
ionic cordova build ios --prod --release
More information on Cordova's iOS Platform Guide
https://cordova.apache.org/docs/en/latest/guide/platforms/ios/
Check whether the Cordova requirements for Android are installed
cordova requirements android
Build the project for Android
ionic cordova build android
Run the app in the Android Emulator or attached Android device
ionic cordova run android --livereload --consolelogs
Build the app in release and production mode for archiving
ionic cordova build android --prod --release
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore rollcall.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk rollcall
./zipalign -f -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk platforms/android/build/outputs/apk/Rollcall.apk
More information on Cordova's Android Platform Guide
https://cordova.apache.org/docs/en/latest/guide/platforms/android/
Commands for Git version control
Check local changes
git status
Revert local changes
git reset --hard
Commit local changes
git add .
git add -u
git commit -m "message about the changes"
git push
Create a tag
git tag 1.0
git push origin --tags
Check outdated NPM dependencies
npm outdated
Update all dependencies to latest Ionic2
npm install ionic-angular@latest --save --save-exact