title: Script to remove build configurations and schemes from xcodeproj file?
body: <p>Is there a way to remove the build configs and schemes from xcodeproj via a script/commandline without editing (project.pbxproj) in a text editor hoping it won't cross verify and impact the build.</p>
  
  <p>I tried <a href="https://github.com/CocoaPods/Xcodeproj" rel="nofollow noreferrer"><code>xcodeproj</code></a> which lets you read and represent the prj as yaml, I want one where I can edit the yaml and generate xcodeproj from it.</p>
  
  <p>Also I tried removing schemes form <code>xcshareddata</code> still no performance improvement.</p>
  
  <pre><code>shell&gt; xcodebuild -project myproject.xcodeproj -list
  
  # output
  Information about project "myproject":
      Targets:
          myproject
          myprojectTests
          ScreensForManPages
          UITestsCA
          ....
          ....
          UITestsUS
  
      Build Configurations:
          ae-debug
          ae-debug-another-condition
          ae-release
          ae-release-another-condition
          ...
          ...
          250+ build config in between
          ...
          ...
          zw-debug
          zw-debug-another-condition
          zw-release
          zw-release-another-condition
  
      If no build configuration is specified and -scheme is not passed then "ae-release-another-condition" is used.
  
      Schemes:
          myproject-ae-debug
          myproject-ae-debug-another-condition
          myproject-ae-release
          ...
          ...
          250+ schemes in between
          ...
          ...
          myproject-zw-debug
          myproject-zw-debug-another-condition
          myproject-zw-release
          myproject-zw-release-another-condition
  </code></pre>
  
  <p>Reason:</p>
  
  <p>I recently inherited a project where there are 250+ build configurations and 250+ schemes. Unfortunately my work machine is good old mbp with hdd running osx mojave with xcode 10 is not capable of opening the project. (.xcodeproj file is about 10mb)</p>
  
  <p>I can open the proj, but rainbow wheel every click, it takes more than 10 min to list the target, and I'm not aware of option in xcode to delete multiple config/schemes at once.</p>
  
  <p>P.S:</p>
  
  <p><a href="https://stackoverflow.com/questions/3693482/how-do-i-remove-a-build-configuration-from-an-xcode-project-from-a-script">Apple script solution</a> 
  is not helpful xcode doesn't respond in timely fashion</p>