> For the complete documentation index, see [llms.txt](https://learn-web3.gitbook.io/aptos/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn-web3.gitbook.io/aptos/smart-contract/setup-dev-environment-for-aptos-under-macos.md).

# MacOS下搭建Aptos开发环境

Aptos在MacOS上搭建Aptos开发环境搭建

### Rust

Aptos很多工具包都需要Rust支持，所以我们先安装Rust。

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

运行以下命令，说明安装成功。

```bash
cargo --version
```

### Aptos CLI

下载地址：

{% embed url="<https://github.com/aptos-labs/aptos-core/releases/download/aptos-cli-v1.0.0/aptos-cli-1.0.0-MacOSX-x86_64.zip>" %}
&#x20;Aptos 下载地址
{% endembed %}

下载之后，解压出名为`aptos`的文件复制到 `/usr/local/bin`, 然后运行下面命令：

```bash
chmod +x /usr/local/bin/aptos
```

### Move analyzer

这个在开发Move module的时候，可以做语法提示，错误分析等。

```bash
cargo install --git https://github.com/move-language/move move-analyzer --features "address32"
```

*注意："address32"是必须参数，因为Aptos地址为32位的，而不是默认的20位。*

完成之后执行如下命令，则说明成功。

```
move-analyzer --version
```

### Move prover

用于做形式化证明，是Aptos合约开发的核心安全工具。

1. 下载Move的repo, 然后运行其中的环境配置脚本

```bash
git clone https://github.com/move-language/move
cd move
./scripts/dev_setup.sh -ypt
```

运行如下命令，则说明安装成功。

```bash
boogie /version
```

### VSCode 插件配置

安装插件：damirka.move-syntax

安装插件：move.move-analyzer，这个插件需要配置这一步 [#move-analyzer](#move-analyzer "mention") 的路径。

![](https://1167150119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj5drALjutaFKso9Wta2S%2Fuploads%2FpXjHJ02OAP4xElAxQF8l%2Fimage.png?alt=media\&token=477ab551-e573-48ce-8813-dd1c26ea4fd0)

*Tips: 执行`which move-analyzer` 可以查看到安装路径。*

到这里开发环境就基本搭建完成了，接着可以进行：

[编写并发布一个智能合约到Aptos](/aptos/smart-contract/publish-your-first-smart-contract-on-aptos.md)
