Mac配置记录

记录一点配置Mac的相关博客/命令/……

Proxy

ClashXPro可以正常工作
Clash-verge-rev最新版出于神秘原因内核通信错误。
临时在终端配置代理:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
alias proxy=" export http_proxy=socks5://127.0.0.1:7890; 
export https_proxy=socks5://127.0.0.1:7890;
export all_proxy=socks5://127.0.0.1:7890;
export no_proxy=socks5://127.0.0.1:7890;
export HTTP_PROXY=socks5://127.0.0.1:7890;
export HTTPS_PROXY=socks5://127.0.0.1:7890;
export ALL_PROXY=socks5://127.0.0.1:7890;
export NO_PROXY=socks5://127.0.0.1:7890;"
alias unproxy=" unset http_proxy;
unset https_proxy;
unset all_proxy;
unset no_proxy;
unset HTTP_PROXY;
unset HTTPS_PROXY;
unset ALL_PROXY;
unset NO_PROXY"

oh-my-zsh装好后可以写入.zshrc

brew

1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

最后还要执行一些命令配置环境,按照引导复制粘贴即可。

oh-my-zsh

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Xcode

需要将系统升级到支持最新版本Xcode,在Appstore下载,不然就要到苹果开发者官网下载老版本,但是似乎需要注册成为会员才行。
安装命令行工具:

1
xcode-select --install

如果提前下载了brew那xcode-select应该会同步安装好。
如果没代理可能比较慢。

git

Xcode自带git,但还是安装新的。

1
brew install git

然后设置username email ssh等。

Vscode

有Xcode这个配置就比较简单,配一下code runner的json就行。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
"code-runner.executorMap":{

"javascript": "node",

"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",

"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"zig": "zig run",

"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"php": "php",

"python": "python -u",

"perl": "perl",

"perl6": "perl6",

"ruby": "ruby",

"go": "go run",

"lua": "lua",

"groovy": "groovy",

"powershell": "powershell -ExecutionPolicy ByPass -File",

"bat": "cmd /c",

"shellscript": "bash",

"fsharp": "fsi",

"csharp": "scriptcs",

"vbscript": "cscript //Nologo",

"typescript": "ts-node",

"coffeescript": "coffee",

"scala": "scala",

"swift": "swift",

"julia": "julia",

"crystal": "crystal",

"ocaml": "ocaml",

"r": "Rscript",

"applescript": "osascript",

"clojure": "lein exec",

"haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",

"rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",

"racket": "racket",

"scheme": "csi -script",

"ahk": "autohotkey",

"autoit": "autoit3",

"dart": "dart",

"pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",

"d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",

"haskell": "runghc",

"nim": "nim compile --verbosity:0 --hints:off --run",

"lisp": "sbcl --script",

"kit": "kitc --run",

"v": "v run",

"sass": "sass --style expanded",

"scss": "scss --style expanded",

"less": "cd $dir && lessc $fileName $fileNameWithoutExt.css",

"FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"sml": "cd $dir && sml $fileName",

"mojo": "mojo run",

"erlang": "escript",

"spwn": "spwn build",

"pkl": "cd $dir && pkl eval -f yaml $fileName -o $fileNameWithoutExt.yaml",

"gleam": "gleam run -m $fileNameWithoutExt"

},
"code-runner.runInTerminal": true
}


C/C++

Xcode已经装好gcc和clang,直接在终端里跑就行了。有一点比较好笑的是,由于mac的命令行用的是zsh,而我一开始将测试文件夹名称设为了C&C++,导致终端以“&”字符将命令分开了,一直跑不起来。这个故事警示我们最好不要在命名文件/文件夹时使用特殊字符。

Python

从官网下载对应python,为python3/pip3设置别名即可。

Java & IntelliJ IDEA

Java安装参考博客:# Mac 上用 Homebrew 安裝 Java 的方式
可以通过brew直接安装:brew install temurin 然后export JAVA_HOME="$(/usr/libexec/java_home)"
IntelliJ IDEA安装即可。

IDA Pro

https://bbs.kanxue.com/thread-285999.htm
Mac食用。

Ubuntu & pwn

https://hamor.top/posts/tech/mac-m%E8%8A%AF%E7%89%87pwn%E7%8E%AF%E5%A2%83%E9%83%A8%E7%BD%B2/#%e4%ba%8cutm%e5%ae%89%e8%a3%85ubuntu
通过ssh连接方法:服务器上执行sudo systemctl status ssh,随后ifconfig查看inet地址。
主机上ssh username@ip,输入密码即可。
最好在虚拟机中设置代理。
与主机共享文件夹问题:
https://juejin.cn/post/7349360417092321306#heading-6

桥接模式似乎是有问题,经常ssh连一半断掉,用共享网络。

Android emulator

https://www.bluestacks.com/mac


Mac配置记录
https://murasame-mio-misaki.github.io/2025/08/23/Mac配置记录/
Author
Miss.M
Posted on
August 23, 2025
Licensed under