ChatGPT解决这个技术问题 Extra ChatGPT

Simulator error FBSSystemServiceDomain code 4

I'm trying to run an app in the simulator but get this error message:

Unable to run app in Simulator
An error was encountered while running (Domain = FBSSystemServiceDomain, Code = 4)

https://i.stack.imgur.com/U5pHD.png

I've not seen any previous references to this from googling around.

Its using XCode 6 Beta, the app is in Swift which links to a Obj-C static library. It runs fine on the device.

Any ideas?


U
Umar Farooq

Go to the iOS Simulator menu and select Reset Content and Settings.

Alternatively, you could quit and reopen the Simulator.

https://i.stack.imgur.com/AnjIX.png


Same solution works for not only for the Beta version but also for the final Xcode 6. thx!
@Marie you save my day. :) Thanks.
Still broken in Xcode 6.0.1, this workaround still works (thankfully) -- Apple testing FTW.
Resetting contents and settings and resetting contents and settings does not help the situation. Just retry and eventually you'll win the race condition. This issue is discussed in the Apple Developer Forums and Xcode Release Notes.
Ran into this problem with xcode 6.1.1, but this fixed the issue.
A
Alex Zavatone

It's enough to quit and re-open the Simulator, this has been verified in the Xcode 6.0.1 release.


I hope you wanted to say "quit"
Re-launching the simulator is not required. Just try again. This is discussed in the Xcode release notes as a known issue.
Just trying again does not work for me, neither re-launching the simulator. When the issue occurs I need to relaunch Xcode such as I'm able to launch again my app on the simulator.
Restarting Simulator worked for me on Xcode 6.1.1. IMO, better than accepted answer, since it's not always desirable to erase all apps from simulator, e.g. where you have a lot of apps and want to keep some in a pre-installed state.
J
Jeremy Huddleston Sequoia

This issue is discussed in the Xcode 6 Release Notes

Testing on iOS Simulator may produce an error indicating that the application could not be installed or launched. Re-run testing or start another integration. (17733855)

And is also discussed in my sticky post in the Apple Developer Forums for iOS Simulator Debugging

"(Domain = FBSOpenApplicationErrorDomain, Code = 4)", "(Domain NSPOSIXErrorDomain, Code = 3"), "Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3", "Lost Connection to ...", "Debugger disconnected", or app getting SIGKILLed soon after launch Upon installation of an app, SpringBoard will SIGKILL that app's process in order to force a relaunch of the app with the new executable. The problem is that there is a race condition whereby SpringBoard may accidentally SIGKILL a new process that we just launched rather than the old process. Which of the various error messages you get depends on exactly when in the launch process the SIGKILL was delivered. Normally, this shouldn't happen, so the advise is to just try again (sorry =/). If you find that this happes to you all the time or more frequently than you can tollerate, we are incredibly sorry. We are aware that systems with slower disk I/O will see this happen more frequently than faster systems, so if you are using an NFS home directory, you may want to create a local directory for your simulator data and setup a simlink to it from ~/Library/Developer/CoreSimulator

Note that the original question is about domain FBSSystemServiceDomain whereas my post on devforums mentions FBSOpenApplicationErrorDomain. FBSSystemServiceDomain was used in earlier versions of iOS 8.0 betas.


u
user1824791

You can either Reset Content and Setting or just close iOS Simulator and relaunch.


S
Steve

None of the solutions worked for me including the accepted answer of "Reset Content and Settings".

The only way I was able to get it to work was by downloading a previous iOS simulator version which let me install the app.


J
Jayprakash Dubey

I suggest you to use stable version of Xcode 6.1.

FBSOpenApplicationErrorDomain, code =4 error suggests it is an error from 
cached data on the simulator.

There are three possible solutions :

Clean simulator. Use (Command + Shift + k) as shortcut key or goto Product -> Clean Quit simulator and relaunch it. Open simulator. Select iOS simulator -> Reset contents and settings...

https://i.stack.imgur.com/XSvHA.png