Xcode error: failed to launch

别等时光非礼了梦想. 提交于 2019-12-04 10:36:38

问题


I have a Mac app I have written to support iCloud. However, I get this when trying to run the app:

error: failed to launch /Users/padsoftware/Library/Developer/Xcode/DerivedData/Scrawl-heofvoywsunchdhjowxkvkoiqvan/Build/Products/Release/Scrawl.app/Contents/MacOS/Scrawl

The odd thing is that this appears for all of my Mac apps, with or without iCloud, with or without sandboxing, with or without entitlements, or ever with or without code signing. Any idea on how to fix this?


回答1:


I had this problem too. For me, it was a code sign issue. Make sure you're signing with developer, not distribution.




回答2:


I encounter this problem every once in a while. Like the others mentioned, these are the steps I take:

1. Clean (Shift+Cmd+K) ------ Removes all the product files, as well as any object files (.o files) or other intermediate files created during the build process (Apple Doc)

2. Navigate to "~/Library/Developer/Xcode/DerivedData", delete folder for app in question ------ Derived data consists of project indexes, logs, and build products including intermediate files (Apple Doc)

3. Restart Xcode

One or the other usually fixes it. I haven't had to change Code Signing settings, but that would be my next step. Wouldn't re-install Xcode unless absolutely necessary.




回答3:


I had such problem also and restarting Xcode Fixed the issue .

even it happened after renaming the application ....




回答4:


  1. Under Build Settings make sure you are signing with a valid developer profile for debug and release.
  2. Then Build for Testing

That fixed the problem.




回答5:


"Product"->"Scheme"->"New Scheme" fixed my problem




回答6:


Just in case it helps anyone else, my problem was fixed by rebooting my iPhone (4S). Then the app suddenly appeared on the Springboard (it was like it was already installed but somehow hidden).

...I did all the other steps (restart Xcode, clean project, delete derived data) but none of it worked this time.




回答7:


What worked for me... I was already code signed as developer so I cleaned my code menu bar -> Product -> Clean

That still didn't fix it but I noticed that I was getting handshake error, I had a large amount of apps already running on my phone (~15-20) so I exited out of all of them and retried. It worked after exiting out of all other apps.



来源:https://stackoverflow.com/questions/8547201/xcode-error-failed-to-launch

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