xctool fails to clean my iOS project

假装没事ソ 提交于 2019-12-09 17:55:59

问题


I'm using xctool (v0.1.16) for an iOS project, which is configured as follows:

  • a workspace
  • two targets Project and ProjectTests
  • two schemes Project and ProjectTests

I have a .xctool-args file with the workspace and Project scheme configured.

I run xctool build and xctool -scheme ProjectTests -sdk iphonesimulator test successfully.

However, I run xctool clean and the following happens:

  • 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.

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.

The workspace at /var/folders/b7/472b_skj24gf7wmw6c3krp5c0000gn/T/xctool_temp_KMbH0e/Tests.xcworkspace simply references two projects, the Project xcodeproj and Pods xcodeproj. It does contain a Tests scheme with a build action.

Why does this command fail in the 1st place? Any help is appreciated.

Cheers.


回答1:


I fixed this issue by checking the "shared" box for the main scheme:

  1. Choose Product > Scheme > Manage Schemes.

  2. Select the Shared option for the scheme to share, and click OK.

source: https://developer.apple.com/library/ios/recipes/xcode_help-scheme_editor/Articles/SchemeShare.html




回答2:


I fixed it by

  • Unchecking auto create schemes in XCode scheme management
  • Removing and recreating the scheme(s) I wanted to build (in your case Project and ProjectTests)



回答3:


I ran into this issue in xCode 7. I fixed this issue by doing the following:
- Choose Product > Scheme > Manage Schemes.
- Select the "Shared" option for the scheme, and click OK



来源:https://stackoverflow.com/questions/25970396/xctool-fails-to-clean-my-ios-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!