title: iOS Xcode 10 How to fix broken "New build system" - build.db: database is locked Possibly there are two concurrent builds
body: <p>I'm having problem with the infamous:</p>
  
  <blockquote>
    <p>"/Users/n/Library/Developer/Xcode/DerivedData/Build/Intermediates/XCBuildData/build.db":
    database is locked Possibly there are two concurrent builds running in
    the same filesystem location</p>
  </blockquote>
  
  <p><strong>How do I fix broken "modern" build system getting stuck with a locked database?</strong> </p>
  
  <p>I tried:</p>
  
  <ul>
  <li>Cleaning the project</li>
  <li>Deleting derived data</li>
  <li>Updating cocoapods (sudo gem...) and pod install</li>
  <li>Full nuking of Xcode folder with a fresh reinstall from App Store</li>
  </ul>
  
  <p>Now I'm with a fresh Xcode installation, the project worked for a dozen builds(real device and simulator) and the problem comes back, making me unable to work on a project. <strong>How I can reset the locks on build.db or delete it?</strong></p>
  
  <p>I see this question asked multiple times, and the answers do not solve my problem. I'm not using build scripts, all I have is a couple cocoapods. Please do not close this question, as I'm asking specifically about lack of:</p>
  
  <ul>
  <li>NO CUSTOM SCRIPTS </li>
  <li>NO CONSOLE BUILDS</li>
  <li>NO COMPOSITE TARGETS</li>
  </ul>
  
  <p>The only thing that lets me continue working is turning to the legacy build system:</p>
  
  <p><a href="https://i.stack.imgur.com/Nm5lx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nm5lx.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/U0VDP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U0VDP.png" alt="enter image description here"></a></p>
  
  <p><a href="https://stackoverflow.com/questions/51205221/how-can-i-use-the-legacy-build-system-with-xcode-10s-xcodebuild">How can I use the legacy build system with Xcode 10&#39;s `xcodebuild`?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/51153525/xcode-10-unable-to-attach-db-error">Xcode 10: unable to attach DB error</a></p>