快速开始
1. 安装Xcode和Xcode命令行工具
> Download the latest version of Xcode from the Apple developer website or get it using the Mac App Store.
从Apple开发人员网站或者Apple Store中下载最新版本的Xcode
> Once you have Xcode installed, open a terminal, run xcode-select --install, and click the Install button to install the required command line developer tools.
安装完Xcode之后,打开命令行终端,运行命令`xcode-select --install`,然后点击 `install` 按钮来安装命令行开发工具
> Don't worry if you see a message telling you the software cannot be installed because it is not currently available from the Software Update Server. This usually means you already have the latest version installed. You can also get the command line tools from the Apple developer website.
如果出现以下信息,也别担心,说明你已经安装过了Xcode 命令行工具了
```
the software cannot be installed because it is not currently available from the Software Update Server
```
2. 在命令行终端中同意Xcode license
sudo xcodebuild -license
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree
You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf
3. 下载安装包
根据你的MacOS版本下载对应的PKG安装包 github下载地址
If you are using macOS, you should install MacPorts using the macOS package installer unless you do not wish to install it to /opt/local/, the default MacPorts location, or if you wish to install a pre-release version of MacPorts base
如果使用的是 macOS,建议用 MacPorts的安装包直接安装,除非你不希望MacPorts直接安装到 /opt/local 目录下(MacPorts的默认安装目录)
4. MacPorts更新
安装完成后,应该经常使用selfupdate命令进行更新,将MacPorts更新到最新版本。
sudo port selfupdate