Ionic and Cordova on Win 10: Mac Supplemental - AliceDigitalLabs/SupportingLiveProjects_2018 GitHub Wiki

Supplementary information for Mac Users

This is an additional page to Ionic and Cordova an Win 10

There are (quite a few) things which are different between the two operating systems, so although you can follow pretty much the same installations, some actions to be taken are different.

1. Useful Stuff

Bringing up a 'terminal' (command line) from a folder in the Finder

You'll have to enable this facility:

  1. Go to System Preferences
  2. In the Preferences windoow, choose 'keyboard'
  3. Choose 'Shortcuts'
  4. In the left-hand pane, choose 'services'
  5. In the right-hand list, make sure you switch on the setting 'New Terminal At Folder' in 'files and folders'.

(You may need to hold the 'Option/alt' key, then right click on the Finder icon in the dock and click Relaunch.)

Now, when you right click on a folder in Finder, you'll be able to bring up a command window there.

To test this, bring up the terminal in a folder, and type pwd. Check that the working directory of the terminal is the same as the folder which you spawned it from.

Using 'sudo'

Sometimes you will need to do something using administrative privileges. If you're using Terminal to execute commands, you can do this by prepending the command

sudo

to your command. This will allow you to elevate the command to super-user level. It will ask you for a a password. BE CAREFUL. If you don't understand the command you are using, and its effects, DONT' USE SUDO*

Showing Hidden Files

In macosx, any files prefixed by a '.' are hidden by the Finder. You need to change this setting.

  1. Open Terminal
  2. use the following command:
defaults write com.apple.finder AppleShowAllFiles YES.
  1. Hold the 'Option/alt' key, then right click on the Finder icon in the dock and click Relaunch.

Setting environment variables

To change the environment variables, you need to change the content of the following file:

~/.bash_profile

Be careful! If you're unsure of what you change, make a copy of the file before you change it :-)

Environment variables are set like this:

export MY_VAR="some value"

you can also prepend values to a variable like this:

export MY_VAR="somestuff$MYVAR"

This makes it very useful for adding values to your path. For example:

export PATH="/usr/local/opt/node@8/bin:$PATH"
export PATH="/usr/local/opt/gradle-4.10.2/bin:$PATH"
export PATH="/usr/local/opt/Android/sdk/platform-tools:$PATH"

When you start a process, such as terminal session, your environment variables are read. To make terminal re-read the environment variables when you have changed them, issue the following command:

source ~/.bash_profile

JAVA

If you're look for how to set the PATH and JAVA_HOME - take a look here

THAT'S IT! :-)