๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Environment·Tool

๋งฅ CLT(Command Line Tools) ์„ค์น˜ ๋ฐฉ๋ฒ•(Xcode ์—†์ด)

by Leica 2020. 3. 29.
๋ฐ˜์‘ํ˜•

๋งฅ CLT(Command Line Tools) ์„ค์น˜ ๋ฐฉ๋ฒ•(Xcode ์—†์ด)

CLT(Command Line Tools, ๋ช…๋ น์ค„ ๋„๊ตฌ ํŒจํ‚ค์ง€)์€ Mac terminal ์‚ฌ์šฉ์ž๊ฐ€ ์ผ๋ฐ˜์ ์œผ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” ํˆด, ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ฐ ์ปดํŒŒ์ผ๋Ÿฌ(Linux ํŒจํ‚ค์ง€์—์„œ ์ œ๊ณต๋˜๋Š” make, GCC, clang, perl, svn, git, size, stripe, libtool, cpp, what ๋“ฑ)๋ฅผ ์ œ๊ณตํ•œ๋‹ค.

Xcode ๊ฐœ๋ฐœ ํŒจํ‚ค์ง€๋Š” CLT๋ฅผ ํฌํ•จํ•˜๋Š”๋ฐ CLT๋งŒ ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๊ตณ์ด Xcode๋ฅผ ์„ค์น˜ํ•  ํ•„์š”๋Š” ์—†๋‹ค.

๋งฅOS์— CLT๋งŒ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณด์ž.

 

๐Ÿ’ก ๋ณธ ๋‚ด์šฉ์€ MacOSX 10.9 ์ด์ƒ์„ ๊ธฐ์ค€์œผ๋กœ ํ•œ๋‹ค.

 

1. CLT ์„ค์น˜ ์—ฌ๋ถ€ ํ™•์ธ

์ด๋ฏธ ํ˜„์žฌ ๋งฅ์— CLT๊ฐ€ ์„ค์น˜๋ผ์žˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•˜์ž.

Terminal์„ ์—ด๊ณ  ํ”„๋กฌํ”„ํŠธ์— ๋ช…๋ น์–ด 'gcc'๋ฅผ ์ž…๋ ฅํ•œ๋‹ค.

no developers tools were found...๋ผ๊ณ  ์ถœ๋ ฅ๋˜๋ฉด ์„ค์น˜๊ฐ€ ๋ผ์žˆ์ง€ ์•Š์€๊ฒƒ์ด๋‹ค.

์•„๋ž˜ ๊ณผ์ •์„ ๋”ฐ๋ผ ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค.

 

2. CLT ์„ค์น˜

Terminal์— ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•œ๋‹ค.

xcode-select --install

 

๊ทธ๋Ÿฌ๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋Œ€ํ™”์ฐฝ์ด ๋œฌ๋‹ค.

'์„ค์น˜' ํด๋ฆญ

 

'๋™์˜' ํด๋ฆญ

 

๋‹ค์šด๋กœ๋“œ ์ง„ํ–‰

 

์„ค์น˜ ์™„๋ฃŒ

 

3. ์„ค์น˜ ํ™•์ธ

Terminal์— CLT ํŒจํ‚ค์ง€๊ฐ€ ํฌํ•จํ•˜๋Š” ๋ช…๋ น์–ด ์ค‘ ํ•˜๋‚˜๋ฅผ ์ž…๋ ฅํ•ด๋ณด์ž.

์ด์ „์— ์„ค์น˜ ์—ฌ๋ถ€ ํ™•์ธ์„ ์œ„ํ•ด ์ž…๋ ฅํ–ˆ๋˜ gcc๋„ ๊ดœ์ฐฎ๊ณ  git, svn, rebase, make, ld, otool, nm ๋“ฑ ๋ช…๋ น์–ด ์ค‘ ์•„๋ฌด๊ฑฐ๋‚˜ ์ž…๋ ฅํ•œ๋‹ค.

๋‚˜๋Š” git์„ ์ž…๋ ฅํ•ด๋ณด์•˜๋‹ค.

'ํ•ด๋‹น ๋ช…๋ น์–ด๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Œ'๊ณผ ๊ฐ™์€ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ค์ง€ ์•Š๊ณ  ์œ„์™€ ๊ฐ™์ด ๋ช…๋ น์–ด ์‚ฌ์šฉ๋ฒ• ๋“ฑ์ด ์ถœ๋ ฅ๋˜๋ฉด ์ œ๋Œ€๋กœ ์„ค์น˜๋œ ๊ฒƒ์ด๋‹ค.

 

[์ฐธ๊ณ ] CLT ์„ค์น˜ ๋””๋ ‰ํ† ๋ฆฌ ๋ฐ ๋ช…๋ น์–ด

CLT ํŒจํ‚ค์ง€๋Š” ๋‹ค์Œ ๋””๋ ‰ํ† ๋ฆฌ์— ์„ค์น˜๋œ๋‹ค.

/Library/Developer/CommandLineTools/

 

/Library/Developer/CommandLineTools/usr/bin/ ํ•˜์œ„์—์„œ ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ๋ช…๋ น์–ด๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ๋ช…๋ น์–ด๋“ค

 

References

https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€