title: Cant run app on simulator "The operation couldn’t be completed. (LaunchServicesError error 0.)"
body: <p>I have an app on Xcode that was running just fine earlier. but all of the sudden it has stopped working when I try to run it. There was no code changed, and I don't know what happened. The error message is:</p>
  
  <blockquote>
    <p>"The operation couldn’t be completed. (LaunchServicesError error 0.)"</p>
  </blockquote>
  
  <p>When I look into the CoreSimulator log file I get this:</p>
  
  <blockquote>
    <p>Jan  8 11:43:55 C02PG69EG3QD com.apple.dt.Xcode[7083] : Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" <strong>UserInfo=0x7fc597a59240</strong> {Error=PackageExtractionFailed, <strong>ErrorDescription=Failed to copy file:</strong>///Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-eyozcttdojgdpgdstfspqjxsztrb/Build/Products/Debug-iphonesimulator/myApp.app/ <strong>to file:</strong>///Users/myUsername/Library/Developer/CoreSimulator/Devices/DAC0E72A-6F6A-42EA-A8CA-5F41E22F2CCC/data/Library/Caches/com.apple.mobile.installd.staging/temp.qtgx1Q/extracted/myApp.app/}</p>
  </blockquote>
  
  <p><strong>Basically it says that Xcode can't copy the file from one place to other.</strong> So I thought it might be a permissions issue. I did chmod with 777 to both folders, but that didn't work.</p>
  
  <p>I also tried <strong>'Reset content and setting'</strong> for simulator, it gave me permission error to remove certain files, so i did it manually. and this method didnt work either.</p>
  
  <p>I have tried: </p>
  
  <ul>
  <li>restart the simulator and xcode</li>
  <li>clean and rebuild</li>
  <li>clean build folder and rebuild</li>
  <li>delete Xcode and reinstall it</li>
  <li>using a different iPhone simulator, like changing from iPhone 6 to iPhone 6s</li>
  </ul>
  
  <p>None of the above worked for me.</p>
  
  <p>Note: one thing that was working, was if I run it through my iPhone via USB connection.</p>
  
  <p>I guess to solve this problem, I will need to figure out the way for Xcode to be able to copy file to its destination. Does anyone have any clue for this?</p>