Installing a Mac development environment
You should close and open a new command line window after each installation.
NAGRA recommends using Mac for development purposes.
- Xcode (From App store)
Xcode command-line tools (xcode-select --install
)
If you need to update Xcode, be sure to do this afterwards as it often breaks. You can use Xcode to install the CLI as well. [Homebrew]
Click https://brew.sh and then follow instructions.Homebrew installs to a new location for machines with Apple Silicon instead of Intel. Older packages that require brew in the old location will break.
If you see the following error during installation or when updating or upgrading, it means you need to reinstall the Xcode CLI (see above)
CODEError: python@3.8: the bottle needs the Apple Command Line Tools to be installed.
If you get the brew shallow version warnings/errors on Mac, follow the on-screen instructions to fix brew first.
CODEgit -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
You should then be able to
brew update
and/orbrew upgrade
.
brew list - get list of installed items
brew install x [-v n.n.n]
brew uninstall x
- node
(brew install node
) - currently installs Node 16 - [nvm]
Click https://github.com/nvm-sh/nvm and follow readme for instructions.nvm list - show all versions of Node that nvm recognises
nvm install x
nvm use x
nvm alias default x - default version to use. Packages installed via Brew might ignore this.- There may be more versions of Node installed via brew than nvm uses.
- yarn might use a default version installed when being run via Jenkins. If it is, uninstall, set the version of Node you need, then reinstall yarn.
watchman
(brew install watchman
)
If this does not work or you experience issues with watchman, uninstall (brew install watchman
) and redo manually. The usual problem is that brew install fails to make the directory.CODEunzip watchman-*-linux.zip sudo mkdir -p /usr/local/{bin,lib} /usr/local/var/run/watchman sudo cp bin/* /usr/local/bin sudo cp lib/* /usr/local/lib sudo chmod 755 /usr/local/bin/watchman sudo chmod 2777 /usr/local/var/run/watchman
- yarn
(brew install yarn
)
Yarn installs against a default version of Node; usually, the one initially installed. You can change the version Yarn runs against in a command session by changing the Node version with nvm. However, the Jenkins process defaults to the version Yarn was installed against. This is important as some dependencies may require a different version to the one used to install Yarn. If you have problems with Node versions running Yarn via Jenkins, you may have to uninstall Yarn, change the desired Node version and reinstall Yarn. - Start Xcode and install anything requested.
Create a default project and build the simulator to get at least one simulator installed and set up. Install CocoaPods
CODEsudo gem install cocoapods
- sudo gem install cocoapods will install the latest version of cocoapods.
- Podfile.lock contains the version of cocoapods at the enddownloaded and executed when the command is run.
If you are installing on Apple devices containing the new M1 chip, you will need to run pod install.
CODEarch -x86_64 pod install
Install the JDK for Android and Gradle (not React).
CODEbrew tap AdoptOpenJDK/openjdk brew install --cask adoptopenjdk8 (or whatever version you want
Apple Silicon can run old versions of JDK for x86 using Rosetta (although there could be issues).