Unable to run app in Simulator Xcode 6

2020-04-16 02:00发布

Yesterday i was testing my app in the iOS simulator and everything was working fine. I then decided to run the app on my iPhone and i got the error unable to install application, Unknown error occurred this has happened before so I cleaned my build folder (as this has fixed this issue before) however, the same error occurred. I then ran the app in the iOS simulator again and now i get the error Unable to run app in Simulator, An error was encountered while running (Domain = LaunchServicesError, Code = 0). I find this very weird as i didn't change anything besides trying to run the app on my iPhone. I have tried every solution given on this post and still no luck.

I'm sorry if my question doesn't contain much detail but as I said I didn't change anything and it was building and running fine a minute before plugging in my iPhone and trying to run it on there.

Any help would be much appreciated.

edit

I tried running other projects (with and without extensions) and they are working on both simulator and iPhone, therefore the problem must be within my project. (my project does have a today extension)

4条回答
戒情不戒烟
2楼-- · 2020-04-16 02:43

I had the same problem and checking the system log carefully helped me to identify a coliding library that was causing this error. You can also check this answer if you are using extensions.

查看更多
家丑人穷心不美
3楼-- · 2020-04-16 02:49

In that kind of cases I usually :

  • Product > Clean
  • Close xCode
  • Delete the Derived Data (in ~/Library/Developer/Xcode/DerivedData subfolders)
  • Delete the app on the iPhone
  • Reboot the iPhone
  • Restart and rebuild
查看更多
劳资没心,怎么记你
4楼-- · 2020-04-16 02:55

I had this problem. In my case, it was caused by the Build value being blank. After putting a value there, and resetting the simulator once more, the issue went away.

查看更多
贪生不怕死
5楼-- · 2020-04-16 02:58

Generally it means there is a problem with the build, it may be due to old cache (solved by a clean build) or a project definition error (missing library, bad definition in info.plist, etc).

In my case it happened only on iOS 8, turns out that my widget had the wrong bundle ID.

查看更多
登录 后发表回答