다음을 통해 공유


Objective Sharpie 도구 및 명령

Objective Sharpie에 포함된 도구와 이를 사용할 명령줄 인수에 대한 개요입니다.

Objective Sharpie가 성공적으로 설치되면 터미널을 열고 Objective Sharpie가 제공해야 하는 명령을 숙지합니다.

$ sharpie -help
usage: sharpie [OPTIONS] TOOL [TOOL_OPTIONS]

Options:
  -h, -help                Show detailed help
  -v, -version             Show version information

Telemetry Options:
  -tlm-about               Show a detailed overview of what usage and binding
                             information will be submitted to Xamarin by
                             default when using Objective Sharpie.
  -tlm-do-not-submit       Do not submit any usage or binding information to
                             Xamarin. Run 'sharpie -tml-about' for more
                             information.
  -tlm-do-not-identify     Do not submit Xamarin account information when
                             submitting usage or binding information to Xamarin
                             for analysis. Binding attempts and usage data will
                             be submitted anonymously if this option is
                             specified.

Available Tools:
  xcode              Get information about Xcode installations and available SDKs.
  pod                Create a Xamarin C# binding to Objective-C CocoaPods
  bind               Create a Xamarin C# binding to Objective-C APIs
  update             Update to the latest release of Objective Sharpie
  verify-docs        Show cross reference documentation for [Verify] attributes
  docs               Open the Objective Sharpie online documentation

Objective Sharpie는 다음 도구를 제공합니다.

도구 설명
Xcode 현재 Xcode 설치 및 사용 가능한 iOS 및 Mac SDK 버전에 대한 정보를 제공합니다. 나중에 바인딩을 생성할 때 이 정보를 사용합니다.
포드 마스터 사양 리포지토리에서 사용할 수 있는 CocoaPod 라이브러리를 검색, 구성, 설치 및 바인딩Objective-C합니다. 이 도구는 설치된 CocoaPod를 평가하여 아래 도구에 전달할 올바른 입력을 bind 자동으로 추론합니다. 3.0의 새로운 기능!
bind 라이브러리의 헤더 파일(*.h)을 초기 ApiDefinition.cs 구문 분석하고 파일을 StructsAndEnums.csObjective-C.
업데이트 최신 버전의 Objective Sharpie를 확인하고 사용 가능한 경우 설치 관리자를 다운로드하고 시작합니다.
verify-docs 특성에 대한 [Verify] 자세한 정보를 표시합니다.
docs 기본 웹 브라우저에서 이 문서로 이동합니다.

특정 Objective Sharpie 도구에 대한 도움말을 보려면 도구 이름과 옵션을 입력합니다 -help . 예를 들어 sharpie xcode -help 다음 출력을 반환합니다.

$ sharpie xcode -help
usage: sharpie xcode [OPTIONS]

Options:
  -h, -help        Show detailed help
  -v, -verbose     Be verbose with output

Xcode Options:
  -sdks            List all available Xcode SDKs. Pass -verbose for more details.

바인딩 프로세스를 시작하기 전에 터미널 sharpie xcode -sdks에 다음 명령을 입력하여 현재 설치된 SDK에 대한 정보를 가져와야 합니다. 설치한 Xcode 버전에 따라 출력이 다를 수 있습니다. Objective Sharpie는 디렉터리 아래에 설치된 Xcode*.app SDK를 /Applications 찾습니다.

$ sharpie xcode -sdks
sdk: appletvos9.0    arch: arm64
sdk: iphoneos9.1     arch: arm64   armv7
sdk: iphoneos9.0     arch: arm64   armv7
sdk: iphoneos8.4     arch: arm64   armv7
sdk: macosx10.11     arch: x86_64  i386
sdk: macosx10.10     arch: x86_64  i386
sdk: watchos2.0      arch: armv7

위에서는 컴퓨터에 SDK가 iphoneos9.1 설치되어 있고 아키텍처가 지원된다는 arm64 것을 알 수 있습니다. 이 섹션의 모든 샘플에 이 값을 사용합니다. 이 정보를 사용하여 라이브러리 헤더 파일을 초기 ApiDefinition.csStructsAndEnums.cs 바인딩 프로젝트로 구문 분석 Objective-C 할 준비가 완료되었습니다.