问题描述
我正在为iOS项目使用 xctool
(v0.1.16),其配置如下:
I'm using xctool
(v0.1.16) for an iOS project, which is configured as follows:
- 工作空间
- 两个目标
项目
和ProjectTests
- 两个方案
项目
和ProjectTests
- a workspace
- two targets
Project
andProjectTests
- two schemes
Project
andProjectTests
我有一个 .xctool-args
文件,包含工作区和项目
已配置方案。
I have a .xctool-args
file with the workspace and Project
scheme configured.
我运行 xctool build
和 xctool -scheme ProjectTests -sdk iphonesimulator测试
成功。
但是,我运行 xctool clean
并发生以下情况:
However, I run xctool clean
and the following happens:
- 第一次运行
xcodebuild清洁项目
成功 - 第二次运行
xcodebuild build clean
失败并显示错误:
- Scheme Tests is目前尚未配置清理操作。
- 1st it runs
xcodebuild clean Project
successfully - 2nd it runs
xcodebuild build clean
which fails with the error:- Scheme Tests is not currently configured for the clean action.
这很奇怪,因为我不喜欢我有一个
测试
计划。It is strange because I don't have a
Tests
scheme at all.我运行
xctool clean -showTasks
并且有有关错误的更多详细信息。它运行并失败I run
xctool clean -showTasks
and have more details about the error. It runs and fails at/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild \ -configuration Debug \ -workspace /var/folders/b7/472b_skj24gf7wmw6c3krp5c0000gn/T/xctool_temp_KMbH0e/Tests.xcworkspace \ -scheme Tests \ OBJROOT=/Users/paristote/Library/Developer/Xcode/DerivedData/Project-fmyqwebczmtplydrfhcmrdzezcft/Build/Intermediates \ SYMROOT=/Users/paristote/Library/Developer/Xcode/DerivedData/Project-fmyqwebczmtplydrfhcmrdzezcft/Build/Products \ SHARED_PRECOMPS_DIR=/Users/paristote/Library/Developer/Xcode/DerivedData/Project-fmyqwebczmtplydrfhcmrdzezcft/Build/Intermediates/PrecompiledHeaders \ -IDECustomDerivedDataLocation=/var/folders/b7/472b_skj24gf7wmw6c3krp5c0000gn/T/xctool_temp_KMbH0e/DerivedData \ clean
但是,单独执行的相同命令也会成功完成。
However, the same command executed separately finishes successfully.
/ var / f处的工作空间olders / b7 / 472b_skj24gf7wmw6c3krp5c0000gn / T / xctool_temp_KMbH0e / Tests.xcworkspace
只引用两个项目,项目
xcodeproj和Pods
xcodeproj。它确实包含一个带有构建操作的测试方案。The workspace at
/var/folders/b7/472b_skj24gf7wmw6c3krp5c0000gn/T/xctool_temp_KMbH0e/Tests.xcworkspace
simply references two projects, theProject
xcodeproj andPods
xcodeproj. It does contain a Tests scheme with a build action.为什么这个命令在第一个位置失败?任何帮助都表示赞赏。
Why does this command fail in the 1st place? Any help is appreciated.
干杯。
推荐答案
我修好了这个通过选中主要方案的共享框来解决问题:
I fixed this issue by checking the "shared" box for the main scheme:
-
选择产品>方案>管理方案。
Choose Product > Scheme > Manage Schemes.
选择要共享的方案的共享选项,然后单击确定。
Select the Shared option for the scheme to share, and click OK.
来源:
这篇关于xctool无法清理我的iOS项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!