ios - 在命令行中清理 IOS xcode 目标

我正在使用以下命令从命令行构建/运行 IOS 应用程序:

xcodebuild  -sdk "${TARGET_SDK}" -xcconfig "${CONFIG_FILE_PATH}"  -configuration Release

/usr/bin/xcrun -sdk "${TARGET_SDK}" PackageApplication -v "${PROJECT_BUILD_DIR}/${APPLICATION_NAME}.app" -o "${OUTPUT_DIR}/${APPLICATION_NAME}.ipa"

是否有任何命令可以清理目标。或者这些命令会自行清理。

最佳答案

来自 xcodebuild 手册页:

xcodebuild [-project projectname] [-target targetname ...] [-configuration configurationname] [-sdk [sdkfullpath | sdkname]] [buildaction ...] [setting=value ...] [-userdefault=value ...]

并且构建操作可以采用以下值(UPD 13.08.2018):

action ...
       Specify one or more actions to perform. Available actions are:

       build                  Build the target in the build root (SYMROOT).  This is the default action, and
                              is used if no action is given.

       build-for-testing      Build the target and associated tests in the build root (SYMROOT).  This will
                              also produce an xctestrun file in the build root. This requires specifying a
                              scheme.

       analyze                Build and analyze a target or scheme from the build root (SYMROOT).  This
                              requires specifying a scheme.

       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 and optionally a destination.

       test-without-building  Test compiled bundles. If a scheme is provided with -scheme then the command
                              finds bundles in the build root (SRCROOT).  If an xctestrun file is provided
                              with -xctestrun then the command finds bundles at paths specified in the
                              xctestrun file.

       install-src            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 distribution root (DSTROOT).

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

你的情况

xcodebuild  -sdk "${TARGET_SDK}" -xcconfig "${CONFIG_FILE_PATH}"  -configuration Release clean build

在此命令行中有两个构建操作:“清理”和“构建”。首先执行“清理”操作,然后执行“构建”。正如文档所述,您可以在一个命令中指定多个构建操作,这样做而不是使用单独的命令可确保所有构建操作的其他选项相同。

https://stackoverflow.com/questions/19091769/

相关文章:

java - 使用 Gradle 的 Application 插件添加类路径条目

ios - asm中的未知寄存器名称 'q0'

ios - 如何使用 watchkit 应用程序从命令行生成 .ipa 文件

c - "make clean"结果 "No rule to make target ` 干净 '"

c++ - 将 CMake 与同一语言的多个编译器一起使用

build - CMake:如何最好地构建多个(可选)子项目?

c - 去 1.5+ : Error - imports runtime: C source fil

gcc - 如何构建 MinGW W64

c++ - 如何强制 clang 默认使用某些库?

c++ - 包括 .cpp 而不是 header(.h)