6

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.

Philippe A
  • 1,252
  • 9
  • 22
  • Edit: temp workspace and scheme now exist – Philippe A Sep 23 '14 at 02:44
  • It may be related to https://github.com/facebook/xctool/issues/311. – Philippe A Sep 23 '14 at 02:58
  • How did you resolve it at the end? – Anel Rojas Hernández Feb 13 '15 at 21:00
  • I didn't, I skip xctool entirely and use `xcodebuild clean` instead – Philippe A Feb 16 '15 at 04:47
  • I now works with xctool v0.2+ (tested on 0.2.2, 0.2.3 and 0.2.5). – Philippe A Sep 14 '15 at 03:12
  • I'm getting the same error: xcodebuild: error: Scheme Transient Testing is not currently configured for the clean action. I'm using fastlane version 2.81.0 to automate tests on the Jenkins CI using scan and then slather for reporting coverage. xcodebuild from Xcode 9.2 Build version 9C40b "Transient Testing" scheme does not exist anywhere I can see in my project / workspace. I've deleted derived data and re-built / tested with no luck. Build, testing and coverage works fine from xCode itself. I've tried everything I've found online so far and no luck... – Litome Feb 21 '18 at 10:40

3 Answers3

3

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

Community
  • 1
  • 1
Jace Browning
  • 11,699
  • 10
  • 66
  • 90
0

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)
Werner Altewischer
  • 10,080
  • 4
  • 53
  • 60
  • Thanks for your answer. I'm pretty sure it was fixed in xctool v0.2.5 cf https://github.com/facebook/xctool/issues/311 but I haven't tested yet. – Philippe A Sep 04 '15 at 03:33
  • Unfortunately not, that was the version I used also. – Werner Altewischer Sep 04 '15 at 08:10
  • OK thanks that's an interesting feedback, I'll check on my side and update this issue asap. – Philippe A Sep 04 '15 at 08:54
  • I now works with xctool v0.2+ (tested on 0.2.2, 0.2.3 and 0.2.5). I'm sure that auto create schemes was unchecked before and I'm pretty sure I didn't recreate all my schemes, so I don't really know how it got fixed though. – Philippe A Sep 14 '15 at 03:14
0

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

Lei Wang
  • 29
  • 6