Developer tools enhance
Install xcode
xcode-select --install
Install git
Latest Mac OS X has git integrated.
$ git --version
Type the above command will show the git version installed by default or it will prompt you to install one.
sudo command
Unlike redhat, ubuntu, to execute a sudo command in darwin Terminal on your Mac, you must be logged in with an administrator account that has a password. When you're logged in to your Mac using an administrator account, you can use the sudo command in the Terminal app to execute commands as a different user, such as the root user. After you enter the command, Terminal asks you to enter your account password.
Install macport
Mac os don't have native package manager such as rpm or apt-get, which can install linux package and its dependencies from package repository using command line. Third party tools filled this void. The most popular package management tools for mac os are macport and homebrew.
So far macport has more packages and the architecture is more stable on the newer versions of mac os.
Homebrew is geared towards ease of use, and its repository is limited by the fact that it uses OS X's shipped libraries wherever it can. Homebrew is the installing tool in the documents for lots of softwares like springboot, Git, Ruby, and Node. Homebrew don't need sudo command to install software.
Without macport or homebrew, you can still download the *.pkg files from various websites then double-click to install them on your mac os. The recommended website is apple's app store.
So in short, if you don't want to use command line to install packages, use app store or other package providers' download page, if you are a developer favor quick moving, use homebrew, otherwise use macport. Installing both homebrew and macport on the same machine will invite compatibility issue in the long run.
To install homebrew, go to homebrew page and follow the instructions.
To install macport, go to macport download page and download the pkg file corresponding to your mac version. The mac version can be found by clicking the apple icon at the top left corner, then select "About This Mac".
Alternatively, you can run the following scripts to install macport from git repo source code. You need to login with an administrator account that has a password to finish the install.
$
mkdir -p /opt/mports$
cd /opt/mports$
git clone https://github.com/macports/macports-base.git$
git checkout v2.6.3 # skip this if you want to use the development version
$
cd /opt/mports/macports-base$
./configure --enable-readline$
make$
sudo make install$
make distclean
$echo "export PATH=/opt/local/bin:/opt/local/sbin:\$PATH" >> ~/.profile
After the install, the command "port version" should tell you the version 2.6.3 is installed.
From now on, if you find any linux command missing, for example wget, you can type
$port search wget
$sudo port install wget
to have the command installed.
Java Stack
Install java
now you have macport, you can search for openjdk
$port search openjdk
then install one of the jdk from the list.
$sudo port install openjdk14
Alternatively, you can go to oracle website and download the openjdk14 and double-click. The advantage of this approach is, you don't need to login with an administrator account.
After installation, you can verify the jdk installation path:
$echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk{your-jdk-version}.jdk/Contents/Home
Install maven
You need to download maven binary then add it to the command path.
The following script did that for you
$wget http://mirror.cogentco.com/pub/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
$tar xzvf apache-maven-3.6.3-bin.tar.gz
$echo "export PATH=/opt/apache-maven-3.6.3/bin:\$PATH" >> ~/.profile
after that, you can type "mvn --version" to verify the installation.
Install spring tools 4 for eclipse
Got a dmg file from https://spring.io/tools and double click it.
Javascript Stack
Install nodejs
You can use
$port search nodejs
$sudo port install nodejs14
to have macport to install nodejs for you.
Alternatively, you can go to https://nodejs.org/en/download/ and download the MacOs Installer and double click to install it.
Once installed, type "node --version" to verify it is installed.
Install npm
The npm to NodeJS is like maven to Java. When you download Node.js, you automatically get npm installed on your computer. The npm (Node Package Manager) is a command-line tool for interacting with online repository for open-source Node.js projects.
use command "npm version" to verify the tool is enabled.
Install Visual Studio Code
Visual Studio Code is the most popular javascript IDE. The installation is copied from the Visual Studio Code site.
- Download Visual Studio Code for macOS.
- Open the browser's download list and locate the downloaded archive.
- Select the 'magnifying glass' icon to open the archive in Finder.
- Drag
Visual Studio Code.app
to theApplications
folder, making it available in the macOS Launchpad. - Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options, Keep in Dock.
Install angularjs
install angular cli with npm:
$npm install -g @angular/cli
after angularjs is installed, verify with
$ng --version
Python Stack
Install pyenv and python
Python has many versions, the default version on your mac might not satisfy your project's requirement, you want to be able to install multiple versions of python and switch among them freely. The solution here is pyenv.
If you are use homebrew, installing pyenv is as simple as
brew install pyenv
macport doesn't have a pyenv port yet.
Anyway, you can install pyenv wihtout homebrew or macport.
You can follow the instructions and install pyenv with pyenv-installer.
once pyenv is installed, you can install and use multiple versions of python.
To install a particular python version.
$ pyenv install 3.7.3
Then you can set that version as system default.
$ pyenv global 3.7.3
The python version 3.7.3 is now the default, you can verify that with
$ python -v
Install pycharm or do python support for visual studio.
pycharm is python dedicated IDE, it is recommended for developers who want to build large python project. pycharm is reported to be heavy and slow. The alternative is visual studio code with python support installed.
DB Stack
Depending on the requirements, there are many kinds of database we can use, here we only cover MySQL and MongoDB as examples of structured and non-structured databases.
Install mysqlDb
Install mysql and set it as default
$ sudo port install mysql8-server
$ sudo port select mysql mysql8
set the owner
$ sudo chown -R _mysql:_mysql /opt/local/var/db/mysql8/ $ sudo chown -R _mysql:_mysql /opt/local/var/run/mysql8/ $ sudo chown -R _mysql:_mysql /opt/local/var/log/mysql8/
auto start at machine boot
$ sudo port load mysql8-server
undo
$ sudo port unload mysql8-server
set password
$ /opt/local/lib/mysql8/bin/mysqladmin -u root -p password
Install MongoDb
solution with homebrew can be found
for macport
$ port install mongodb@4.4.0
$ sudo port select mongodb@4.4.0
$ sudo port load mongodb@4.4.0
verify the mongodb started with command "mongo"
Cloud Stack
Install docker and kubernetes
docker is the full development platform to build, run and share containerized applications.
kubernetes is the best container orchestration system for GCP (as aws-cli for AWS).
A Docker Desktop package for mac installs both docker and kubernetes.
Install aws cli
aws-cli is the command line util to interact with amazon cloud. You can install it with a mac os package file.
Install azure-cli
azure-cli to microsoft cloud is aws-cli
currently microsoft support provided only one installation method via homebrew
Install Vagrant
Vagrant allows you to capture environment dependencies in a config file so that you can recreate them on other machines.
Install Ansible
Ansible allows you to manage many remote servers with ssh command. It can be installed with pip
$ pip install --user ansible
No comments:
Post a Comment