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:15

I had the same problem. I had accidentally added my info.plist file to my target and it was getting copied to the app bundle every time I built the application. So there were 2 .plist files in the bundle - mine and the Info.plist, created by XCode - which confused the simulator.

查看更多
劫难
3楼-- · 2019-01-23 18:15

I fixed this problem by removing the "Icon already includes gloss and bevel effect" property from the Info.plist file in my project.

查看更多
狗以群分
4楼-- · 2019-01-23 18:17

Wow, what a pain. I had to uninstall XCode 4 via the command line and then install XCode 3 again. Make sure that you restart after you reinstall. Working...

查看更多
唯我独甜
5楼-- · 2019-01-23 18:19

I had the same problem, I fixed it by launching the simulator through another app and deleting the app I was trying to run on it. Then try to build and run and worked perfect.

Cheers

Matt

查看更多
走好不送
6楼-- · 2019-01-23 18:20

found some wierd log in /var/log/system.log.

May  8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: MobileInstallationLookup: Generating the install map
May  8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: load_application_info: Could not load signer identity from /Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29/new1.app/new1
May  8 16:17:50 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: error compiling query "SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;": no such table: _SqliteDatabaseProperties
May  8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May  8 16:17:51 th084134 SpringBoard[1170]: Couldn't activate <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated  deactivate: 
May  8 16:17:51 th084134 SpringBoard[1170]: Application <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated  deactivate:  exited abnormally with signal 256: Unknown signal: 256
May  8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May  8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Bug: launchd_core_logic.c:2812 (23714):103: sandbox_init(j->seatbelt_profile, j->seatbelt_flags, &seatbelt_err_buf) != -1
May  8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Sandbox failed to init: Cannot apply builtin profile `/Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29.sb': Policy not found
May  8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Exited with exit code: 1
May  8 16:17:51 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: 2009-05-08 16:17:51.026 SpringBoard[1170:10b] Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure

Here is a discussion about how to run app in simulator via command line, hope it helps to understand how does xcode and simulator works.

But I didn't work it out.

Well, I "solved" it by install another distribution of hackintosh(IPC 10.5.6), works perfect!

查看更多
手持菜刀,她持情操
7楼-- · 2019-01-23 18:23

My fix:

restarted the Mac and it was fixed. (before that tried clearing caches, deleting caches from iPhone Simulator, cleaning, rebuilding, quitting OS, quitting Simulator, nothing worked.) Restarting the OS worked.

查看更多
登录 后发表回答