Clash를 사용하려면 소스에서 컴파일하거나 미리 컴파일된 바이너리를 다운로드할 수 있습니다.
미리 컴파일된 바이너리 사용
Clash 코어 바이너리는 여기에서 다운로드할 수 있습니다: Clash Premium 안내
소스에서 컴파일
Golang 1.19+를 사용해 기기에서 Clash를 컴파일할 수 있습니다:
shell
$ go install github.com/Dreamacro/clash@latest
go: downloading github.com/Dreamacro/clash v1.15.1바이너리는 $GOPATH/bin 디렉터리에 빌드됩니다:
shell
$ $GOPATH/bin/clash -v
Clash unknown version darwin arm64 with go1.20.3 unknown time크로스 플랫폼/운영체제 컴파일
Golang은 교차 컴파일을 지원하므로 아키텍처나 운영체제가 다른 장치용 Clash를 빌드할 수 있습니다. 예를 들어 다음처럼 make 명령으로 간단히 빌드할 수 있습니다:
shell
$ git clone --depth 1 https://github.com/Dreamacro/clash
Cloning into 'clash'...
remote: Enumerating objects: 359, done.
remote: Counting objects: 100% (359/359), done.
remote: Compressing objects: 100% (325/325), done.
remote: Total 359 (delta 25), reused 232 (delta 17), pack-reused 0
Receiving objects: 100% (359/359), 248.99 KiB | 1.63 MiB/s, done.
Resolving deltas: 100% (25/25), done.
$ cd clash && make darwin-arm64
fatal: No names found, cannot describe anything.
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
$ file bin/clash-darwin-arm64
bin/clash-darwin-arm64: Mach-O 64-bit executable arm64다른 빌드 대상은 이 사이트의 크로스 플랫폼 컴파일 안내에서 확인하세요.
