.NET MAUI Multi-platform App UI ๋Š” C#, XAML ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋„ค์ดํ‹ฐ๋ธŒ ๋ชจ๋ฐ”์ผ ๋ฐ ๋ฐ์Šคํฌํ†ฑ ์•ฑ์„ ์ž‘์„ฑํ•˜๊ธฐ์œ„ํ•œ ํฌ๋กœ์Šคํ”Œ๋žซํผ ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค.

์ง€์›๋˜๋Š” ๋„ค์ดํŠธ๋ธŒ ๋ชจ๋ฐ”์ผ ๋ฐ ๋ฐ์Šคํฌํ†ฑ์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • Android 5.0 (API 21) +
  • iOS 10 +
  • macOS 10.13 + (using Mac Catalyst)
  • Windows 11
  • Windows 10 version 1890 + (using Windows UI Library 3)

Microsoft Build 2022 ์™€ ํ•จ๊ป˜ ์—ฌ๋Ÿฌ ์†Œ์‹์ด ๋ณด์—ฌ์„œ ํ™˜๊ฒฝ์„ ์ค€๋น„ํ•˜๊ณ , ๋™์ž‘์„ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.

.NET CLI๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Mac Catalyst ์•ฑ ๋นŒ๋“œ ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ์„ ์‹คํ–‰ํ•œ ๊ธฐ๋ก์ž…๋‹ˆ๋‹ค.

์‚ฌ์ „์š”๊ตฌ์‚ฌํ•ญ

  • .NET 6 ๋Ÿฐํƒ€์ž„์ด ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • XCode 13 ์ด ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ค€๋น„

Install XCode Command Line Tools

XCode ๋ฅผ ์‹คํ–‰ํ•ด์„œ Command Line Tools ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๋˜๋Š”, ํ„ฐ๋ฏธ๋„์—์„œ ์•„๋ž˜ ๋ช…๋ น์œผ๋กœ ์„ค์น˜๋ฅผ ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

$ xcode-select --install

์ด๋ฏธ ์„ค์น˜๋œ ๊ฒฝ์šฐ ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค.

xcode-select: error: command line tools are already installed, use > "Software Update" to install updates

XCode ์„ค์ •์ฐฝ์„ ์—ด๊ณ  ์œ„์น˜ Location ํƒญ์—์„œ Command Line Tools ํ•ญ๋ชฉ์ด ํ˜„์žฌ ์„ค์น˜๋œ ๋ฒ„์ „์œผ๋กœ ์„ ํƒ๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ , ๋น„์–ด ์žˆ์œผ๋ฉด ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

XCode Command Line Tools Location
XCode Command Line Tools Location

.NET 6

๊ฐ€์žฅ ์ตœ๊ทผ ์ถœ์‹œ๋œ .NET 6 SDK ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ , ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

Download .NET 6

$ dotnet --verion
6.0.300
$ dotnet --list-sdks
6.0.300 [/usr/local/share/dotnet/sdk]

Install .NET MAUI Workload

๊ฐ ํ”Œ๋žซํผ SDK์™€ .NET MAUI ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

$ sudo dotnet workload install maui --source https://api.nuget.org/v3/index.json

๊ฐ ํ”Œ๋žซํผ์˜ SDK ๋ฅผ ์„ค์น˜ํ•˜๋Š”๋ฐ, ๋ฏธ๋ฆฌ ์ค€๋น„๋œ SDK๊ฐ€ ์žˆ๋‹ค๋ฉด, ์‚ฌ์šฉ์ž๊ฐ€ SDK ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์œผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์€๋ฐ, ๋ฐฉ๋ฒ•์„ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

์‹œ์ž‘

ํ”„๋กœ์ ํŠธ ์ž‘์„ฑ

$ mkdir FirstMauiApp # ํ”„๋กœ์ ํŠธ ๋””๋ ‰ํ„ฐ๋ฆฌ ์ž‘์„ฑ
$ cd FirstMauiApp # ํ”„๋กœ์ ํŠธ ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ด๋™
$ dotnet new maui # MAUI ํ”„๋กœ์ ํŠธ ์Šค์ผ€ํด๋”ฉ

์‹คํ–‰

Visual Studio 2022 for Mac (17.3 Preview) ์—์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์—ด๊ณ  ๋””๋ฒ„๊น… ์‹œ์ž‘ ํ˜น์€ ํ„ฐ๋ฏธ๋„์—์„œ ์•„๋ž˜ ๋ช…๋ น์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-05-24 13.08.59.png
แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-05-24 13.08.59.png

# FirstMauiApp directory
$ dotnet build -t:Run -f net6.0-maccatalyst

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-05-24 13.10.19.png
แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-05-24 13.10.19.png

# FirstMauiApp directory
$ dotnet build -t:Run -f net6.0-ios

.NET CLI๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ iOS ์•ฑ ๋นŒ๋“œ ํŽ˜์ด์ง€์—์„œ ํŠน์ • ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ์—์„œ ์•ฑ์„ ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-05-24 13.55.48.png
แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-05-24 13.55.48.png

๋งˆ์นจ

XCode Command Line Tools ์„ค์น˜, ๊ทธ ํ›„ XCode ์„ค์ •์ฐฝ์˜ ์œ„์น˜ ํƒญ ๊ตฌ์„ฑ๋งŒ ์ฃผ์˜ํ•˜๋ฉด ๋ฐ”๋กœ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ์ด๋ผ ์ƒ๊ฐ๋ฉ๋‹ˆ๋‹ค.