github.com/igoogolx/clash@v1.19.8/docs/zh_CN/introduction/getting-started.md (about) 1 --- 2 sidebarTitle: 快速开始 3 sidebarOrder: 2 4 --- 5 6 # 快速开始 7 8 为了开始使用 Clash, 您可以从源码编译或者下载预编译的二进制文件. 9 10 ## 使用预编译的二进制文件 11 12 您可以在这里下载 Clash 的内核二进制文件: [https://github.com/Dreamacro/clash/releases](https://github.com/Dreamacro/clash/releases) 13 14 ## 从源码编译 15 16 您可以使用 Golang 1.19+ 在您的设备上编译 Clash: 17 18 ```shell 19 $ go install github.com/Dreamacro/clash@latest 20 go: downloading github.com/Dreamacro/clash v1.15.1 21 ``` 22 23 二进制文件将会被编译到 `$GOPATH/bin` 目录下: 24 25 ```shell 26 $ $GOPATH/bin/clash -v 27 Clash unknown version darwin arm64 with go1.20.3 unknown time 28 ``` 29 30 ## 跨平台/操作系统编译 31 32 Golang 支持交叉编译, 所以您可以为不同架构或操作系统的设备编译 Clash. 您可以使用 _make_ 来轻松地编译它们, 例如: 33 34 ```shell 35 $ git clone --depth 1 https://github.com/Dreamacro/clash 36 Cloning into 'clash'... 37 remote: Enumerating objects: 359, done. 38 remote: Counting objects: 100% (359/359), done. 39 remote: Compressing objects: 100% (325/325), done. 40 remote: Total 359 (delta 25), reused 232 (delta 17), pack-reused 0 41 Receiving objects: 100% (359/359), 248.99 KiB | 1.63 MiB/s, done. 42 Resolving deltas: 100% (25/25), done. 43 $ cd clash && make darwin-arm64 44 fatal: No names found, cannot describe anything. 45 GOARCH=arm64 GOOS=darwin CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version=unknown version" -X "github.com/Dreamacro/clash/constant.BuildTime=Mon May 8 16:47:10 UTC 2023" -w -s -buildid=' -o bin/clash-darwin-arm64 46 $ file bin/clash-darwin-arm64 47 bin/clash-darwin-arm64: Mach-O 64-bit executable arm64 48 ``` 49 50 对于其他构建目标, 请查看 [Makefile](https://github.com/Dreamacro/clash/blob/master/Makefile).