Xcode error: Failed to launch simulated applicatio

2019-01-23 18:00发布

Problem

Unlike people have asked at here and here, I got this error after a brand new installation of Leopard (hackintosh), this problem really driving me crazy and nowhere else to find an clue, I googled and visited every article related with this, still can't get it solved.

After the first time install iPhone SDK 2.2.1, start a new project(any type, Navigate based, OpenGL ES application), then build and go, I got the following problem: sometime it's:

Failed to launch simulated application: Unknown error.

and sometimes it's:

Failed to launch simulated application: iPhone Simulator failed to find the process ID of com.yourcompany.[application name]

It seems that apps in the simulator crashed immediately, so Xcode can find the process ID.

Solution

This link says that this even can't be solved. Some others make a detailed step by step:

  1. Uncheck Info.plist
  2. Quit XCode
  3. Delete directory /Lib/Caches/com.apple.DeveloperTools.###
  4. Open Xcode project
  5. Clean All Targets
  6. Rebuild

and I reset the iPhone Simulator. This also didn't solve the problem…

I've even tried uninstall the SDK and reinstall it, still got the same error…

Is this a problem related with hardwares? or the operating system version? I'm using a hackintosh (iDenebv1.4 10.5.6), all other software works good including iTunes && vmware fusion.

Great thanks for any further tips or clues!

17条回答
老娘就宠你
2楼-- · 2019-01-23 18:33

In my case, I was adding a target to an existing app that had always worked. In my case, I had forgotten to select all the source code, xibs, frameworks, etc. and click their target checkbox. My clue was that the build happened instantaneously, which didn't make any sense. It never built anything. It just failed to install in the simulator. Once I included all the source files, etc., for the new target, then it built and installed fine.

查看更多
\"骚年 ilove
3楼-- · 2019-01-23 18:33

My problem centered around a Product Name the simulator simply wouldn't accept. Picking alternative names got me past the problem. Changing the name back to the original suspect choked the simulator every time.

查看更多
爷的心禁止访问
4楼-- · 2019-01-23 18:36

This ends up being a product name issue:

The fix is to revert back to

${EXECUTABLE_NAME} ${PRODUCT_NAME}

for the executable file and com..${PRODUCT_NAME} in the info.plist.

Clean XCode, Quit, rese and quit simulator and you're good to go.

查看更多
够拽才男人
5楼-- · 2019-01-23 18:37

Is your CPU Intel, and, of a model distributed in Apple hardware?

I doubt the Simulator will work reliably (if at all) on non-Intel CPUs and/or in VMWare. The simulator is very CPU specific in order to reflect the arm hardware of the iPhone.

The SDK ONLY supports Intel hardware from Apple.

There is a significant effort involved in creating the simulator and it's not easy or cheap (read, thousands of man hours) to support every CPU.

查看更多
萌系小妹纸
6楼-- · 2019-01-23 18:39

why anybody didn't tell about restarting simulator.

In my case,

 Resetting the iPhone with Reset Content and Settings

 and 

 **ReStart Simulator** 

works well~

查看更多
登录 后发表回答