🔥 Apple 모듈에 의존하기

327자
3분

Swift 패키지 매니저는 macOS와 Linux를 위한 빌드 시스템을 포함하고 있어요. Xcode 11은 libSwiftPM과 통합되어 iOS, watchOS 및 tvOS 플랫폼에 대한 지원을 제공한답니다. 커맨드 라인에서 Xcode를 사용하여 패키지를 빌드하려면 xcodebuild를 사용할 수 있어요. 예를 들어, 다음과 같이 호출할 수 있죠:

xcodebuild -scheme Foo -destination 'generic/platform=iOS'
shell

여기서 Foo는 여러분이 빌드하려는 라이브러리 제품의 이름이에요. SwiftPM 패키지에 사용 가능한 전체 스킴 목록은 xcodebuild -list로 얻을 수 있답니다.

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list


User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES


Resolve Package Graph

Resolved source packages:
  Foo: /Users/codingmax/MyProjects/Foo



Information about workspace "Foo":
    Schemes:
        Foo
text

특정 스킴에 사용 가능한 대상 목록은 다음 호출로 얻을 수 있어요:

xcodebuild -showdestinations -scheme Foo
shell

아래와 같이 사용 가능한 대상 목록을 출력합니다.

Available destinations for the "Foo" scheme:

{ platform:macOS, arch:x86_64, id:6013DD23-135B-5F9D-AA45-557E526268C6 }
{ platform:macOS, arch:x86_64, variant:Mac Catalyst, id:6013DD23-135B-5F9D-AA45-557E526268C6 }
{ platform:macOS, arch:x86_64, variant:DriverKit, id:6013DD23-135B-5F9D-AA45-557E526268C6 }
{ platform:DriverKit, name:Any DriverKit Host }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:macOS, name:Any Mac }
{ platform:macOS, variant:Mac Catalyst, name:Any Mac }
{ platform:iOS Simulator, id:3418E8C7-CCC7-43B9-8C06-526F84C6F0EB, OS:17.0.1, name:iPad (10th generation) }
{ platform:iOS Simulator, id:BBD59E9E-CCF9-4EA5-93FD-11C4DF8DAE44, OS:17.0.1, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:A9054155-9963-4924-8204-246F01DD64E2, OS:17.0.1, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:D21DCC05-6FC9-43FF-B3C7-55AC80E2165B, OS:17.0.1, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:8EC0397F-974C-4C72-8399-7141663BF847, OS:17.0.1, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:906746C9-CC9E-48A6-8E0A-688ECCE83268, OS:17.0.1, name:iPhone 15 }
{ platform:iOS Simulator, id:C3176E58-9DE0-4024-8FBD-7CCEC343633A, OS:17.0.1, name:iPhone 15 Plus }
{ platform:iOS Simulator, id:EF87849E-6B14-4A5A-8128-5BEC5DDC8A2D, OS:17.0.1, name:iPhone 15 Pro }
{ platform:iOS Simulator, id:6885FFF0-DC27-4DFC-8F43-E435D1549D61, OS:17.0.1, name:iPhone 15 Pro Max }
{ platform:iOS Simulator, id:1A8C8B6E-78A3-462C-A984-3BAE9A32B2A3, OS:17.0.1, name:iPhone SE (3rd generation) }



Ineligible destinations for the "Foo" scheme:

{ platform:tvOS, id:dvtdevice-DVTiOSDevicePlaceholder-appletvos:placeholder, name:Any tvOS Device, error:tvOS 17.0 is not installed. To use with Xcode, first download and install the platform }
{ platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device, error:watchOS 10.0 is not installed. To use with Xcode, first download and install the platform }
text