1.首先需要安装好XCode2.打开XCode 打开XCode,进入Preferences --> Download 点击Command Line Tools (115.6 MB) 这行的 Install 按钮 (如图) 安装结束后,在/usr/bin里面就发现了gcc。