2013-05-09 4 views
16

작업 영역 및 체계를 지정할 때 xcodebuild 명령 줄 도구와 관련하여 다소 혼란 스럽습니다.xcodebuild 작업 영역 및 체계

구성 스키마가 XCode IDE GUI에서 작동하는 방식을 이해합니다. 빌드 조치는 빌드 할 대상을 나열하고 각 조치 (분석, 테스트, 실행, 프로파일, 아카이브)에 대해 빌드 조치를 실행할 대상을 선택합니다.

빌드 액션을 위해 선택한 각 동작 (분석, 테스트, 실행, 프로필, 아카이브)이있는 경우 아래 명령을 실행하면 어떻게됩니까?

xcodebuild clean install -workspace MyWorkspace.xcworkspace -scheme MyScheme 
-configuration AdHoc SYMROOT=PATH DSTROOT=PATH... 

은 엑스 코드에서 구성을 편집 할 때 지정된 모든 구성이 주요 xcodeproj에서 MyScheme.xcscheme를 검색합니다.

xcodebuild가이 파일에서 무엇을 읽어들입니까? AdHoc 구성으로 구성된 대상을 구축하고 다른 모든 것을 무시합니까?

답변

11

거의 다 왔지만 구문이 약간 벗어났습니다. man page에있어서

xcodebuild -workspace workspacename -scheme schemename [배위 configurationname] [-sdk [sdkfullpath | sdkname] [buildaction ...] [설정 값 = ...] [-userdefault 값 = ...]

buildaction 다음 중 하나

:

buildaction .. 대상에서 수행 할 빌드 작업을 지정하십시오. 사용 가능한 빌드 작업은 다음과 같습니다

Xcode의 IDE에서
 build  Build the target in the build root (SYMROOT). This is the default build action. 

     archive  Archive a scheme from the build root (SYMROOT). This requires specifying a scheme. 

     test  Test a scheme from the build root (SYMROOT). This requires specifying a scheme. 

     installsrc Copy the source of the project to the source root (SRCROOT). 

     install  Build the target and install it into the target's installation directory in the dis- 
        tribution root (DSTROOT). 

     clean  Remove build products and intermediate files from the build root (SYMROOT). 

, 당신은 제품 메뉴를 통해, 또는 (실행 = 재생 삼각형을 클릭하고 IDE의 왼쪽 상단에있는 둥근 버튼을 누르고 있으면 실행할 수있는 buildaction을 선택 , Test = 렌치 아이콘 등).

또한xcodebuild가 빌드 계획을 찾고 있음을주의하십시오. 만든 코드에 따라 .xcproj 파일이나 .xcworkspace 파일에있을 수 있습니다. (수동으로 작업 영역을 만들지 않았다면 .xcproj 파일을 갖게됩니다).

또한 Xcode의 '스키마 관리'설정을 통해 어떤 스키마가 있는지 확인할 수 있습니다.

+0

빌드 작업으로 빌드를 지정하면 디버그/릴리스와 같은 빌드 구성을 가져 오기 위해 구성된 스키마가 표시됩니다. –