FBSOpenApplicationErrorDomain code =4 error - ios

When I'm trying to run iOS application in Xcode 6 in iPhone 6 simulator, I'm getting error Unable to run app in Simulator.
And error code is:
An error was encountered while running (Domain =
FBSOpenApplicationErrorDomain, Code = 4)
Can any one suggest how to resolve it?

This worked for me:
iOS Simulator -> Reset Contents and Settings... -> Reset
referenced from Qiita: Unable to run app in Simulator エラーの対応方法.

Just closing the iOS Simulator worked for me.
There is not always the need to reset the iOS Simulator. I did not even had to close Xcode.

This happened to me once when I added some assets as symbolic links (through ln -sf). Even installing to devices was failing.
After I removed the links and made a hard copy, it worked and error was gone.

No need to quit the simulator or reset all content every time .
Just close the app on which you are working if running on background .
it works for me .

As mentioned in the Xcode release notes, this error (along with a couple others) results from a timing bug. The workaround is to just retry.
See https://developer.apple.com/library/prerelease/mac/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc6_release_notes.html#//apple_ref/doc/uid/TP40001051-CH4-SW1
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.
Also see:
https://devforums.apple.com/thread/248879?tstart=0

I just quit the simulator , cleaned up the project and ran again it worked.

Just quit the xcode6.0 beta or else and run project again, it worked for me.

Reseting the Xcode will delete some bad junk which simulator has cached, so reseting is good option to resolve this issue.
iOS Simulator -> Reset Contents and Settings.

Be careful if you skip installs.
I accidentally changed Skip Install on the main target, when i meant to change it on a dependency .
When changing it back I had to do a clean.

This problem probably started after we enabled background mode in our app.My solution :
1) Go to simulator
2) Hold cmd + shift
3) Tap 'H' key two times
4) Slide the application off to stop it running in the background.
5) Run again.
(Very tiring to have to repeat the above step each time I build and run)

Open your app scheme setting and edit it as shown in attached screenshot,
Actually you have to disable the "Launch Due to background fetch". Worked for me.
Steps,
1. Select your target and select "edit scheme"
2. Select "Options" tab on right side of detail window
3. Uncheck "Launch Due to background fetch" checkbox.

Disconnect hardware keyboard.
In ios simulator main menu
Hardware -> Keyboard -> Disconnect Hardware keyboard.

Related

Xcode10 cannot run the iOS12 simulator

Running the iOS12 Simulator on xcode10 failed. but other versions of the Simulator were normal.
It may needs to set you command line tool.
Reset your simulator and install command line tool for Xcode 10.
Reset Simulator:
See Here: Xcode - install Command Line Tools
Its happens some time so, You have to do "Erase Reset Content and Settings" of simulator by below step.
-> Click on simulator
-> Go on "Hardware" in menu bar
-> Select "Erase Reset Content and Settings..."
Give some time after done it. Close Xcode and reopen it.
This symptom usually appears in two cases:
when the system app (eg: SpringBoard) crashes while setting up the debugging session.
because of buggy 3rd party kexts interfering with the normal operation of the system.
If you are seeing any background crashes of the system app around the time of the failure, that's the likely cause. Otherwise, you should check the output of kextstat | grep -v com.apple, remove any listed 3rd party kexts, reboot, and try again.
The problem is solved by moving the xcode file location under the application file, then restarting the xcode and running it.

Simulator in use XCode 7

I have facing this issue frequently, and would like to fix permanently. There are a few known solutions I have like reset the simulator or quitting. But is there a proper fix?
You can run only one application on simulator at one time, So you can used below steps for resolve your problem as:-
A. Quit all other application and run simulator.
Or
B. Quit simulator and re-start application.
Or
C. Reset simulator or derived data based on your requirement.
Simple SoLution My friend
First of all quit your simulator.
And then quit and restart Xcode.
And then run your project.
it will work like Smoothly. try once.. its working 100 %
Then after it does't Work then
Try doing a reset content and settings
Another Way,
If you have two projects open in Xcode and one is running on the simulator, you can't run the other. Go through each project window and see if any are running, and if they are, press the "Stop" button on the top left
Another Way
multiple-projects-using-the-simulator then Here is the p[erfect answer, you can use ot. might be helpful to you.

Lost connection to "iOS Simulator" for the first time in Xcode 6.0.1

When I run my iOS application in the Simulator for the first time in Xcode 6.0.1, I got this error message:
Lost connection to "iPad 2".
Restore the connection to "iPad 2" and run "App Name” again, or if "App Name" is still > > running, you can attach to it by selecting Debug > Attach to Process > App Name.
Can any one suggest how I can solve this error message? After I stop running and rebuild, everything works fine.
Follow 2 steps :
1- sudo DevToolsSecurity -enable
2- Edit Scheme -> Run -> Debug excitable , uncheck this checkbox it will be ok !
You will now be able to run on simulator. This worked for me.
Same here. I thinks that is the bug of XCode.
Just stop running and Run Again. This way is working fine for me.
This is a known issue with iOS 8.0 and earlier, but changes in iOS 8.0 make the issue more likely to occur than in past versions.
In addition to the lost connection message, other appearances of this bug will be an ESRCH error message (POSIX domain, 3 code), an FBS* domain with code 4, or your app getting SIGKILL and dropped to debugger. I think there may be one more message for this bug, but those are the main 4 behaviors. Which one you gets depends on exactly what point in the launch you lost the race.
At present, the workaround is just to retry Build&Run or launch the installed app in the sim and attach to the running process with the debugger.
Reseting the simulator content and settings would solve the problem. From iOS Simulator drop down select Reset Content and Settings, after that build and run again. I hope that helps.
This happens less frequently in Xcode 6.2 as compared to Xcode 6 beta version.
Only solution is to Re-run your project. This seems to be bug.

xCode 6 (beta 4) keep getting "The Simulator can't be launched because it is already in use."

I keep getting the "The Simulator can't be launched because it is already in use." when trying to run my app, this only happens about 20% of the time but once so far the only way to get around it is to restart my Mac.
Tried the following but doesn't help:
Cleaning my build folder
Closing and re-opening xCode
Force close of simulator
I'm Using xCode 6 (beta 4)
Any Ideas for a solution that doesn't entail me restarting my Mac?
Thanks
"The Simulator can't be launched because it is already in use.”
This messege will be shown only if there is another xcode project that has launched simulator and hasnt stopped it yet, and u try to run the simulator from another xcode project.
Ideally stopping the simulator from the respective project(PS. not closing the application from the simulator, clicking the STOP button) would do it,
But if it still is working like that, then Closing the simulator, or resetting the simulator contents.
If that still dsnt work, then as a last resort i would ask u to reinstall Xcode, as if this problem keeps going on, then ur downloaded file might be buggy.
P.S if u opt to re-download n install xcode please keep backup.
Hope it solves it. Although i want your problem to be solved by step 2.
This normally just happens when running an app (project) on the simulator and then trying to run another app while the simulator is open (and normally is still within the first app you launched and it can't quit automatically). As long as you keep running the same app you shouldn't get this error and as soon as you run another app just make sure you've closed the simulator before or at least left the previous app with the home button.
Just Restart Your Mac , It Will Fixed
I had the same problem and fixed it without restarting. You just need to reset the content on ios simulator, exit xcode, and then to make sure that you've completely exited, right clicking on the xcode icon on your mac nav bar and click Quit. Open it back up and it should work.

Xcode6 can't run any app in simulator ( Domain = NSPOSIXErrorDomain, Code = 3 )

No app can run in my simulator, although building is good.
Error messsage is below:
Unable to run app in Simulator
An error was encountered while running (Domain = NSPOSIXErrorDomain, Code = 3)
In my case, I tried to run the app on a iPhone 6 simulator when I got this error. Quitted the simulator only and re-ran the app on iPhone 5s (8.1) - it worked fine.
After a while I changed the target back to iPhone 6 (without quitting it), and ran the app against it - no error shown.
As mentioned in the Xcode 6.1 Release Notes and in my sticky post in the Apple Developer Forums for the iOS Simulator, this is a known bug in iOS.
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
By Quitting the Simulator and Run the application worked for me.
For me , just Reset Content and setting in your simulator
Restart Mac can solve the problem for me.
This error is less severe than "Domain = DTiPhoneSimulatorErrorDomain, Code = 2" error that I had when I switched to Xcode 6.
For this one, I just reset and cleared contents on my Simulator...quit. Rebuilt and ran my app...and it works.
Every time this has happened to me (as of this writing, still happening on Xcode 6.1) I do not need to restart my mac to fix it. Instead I only had to restart the simulator. I exit the simulator by right-clicking on its icon in the tray and selecting the option to Quit. The I re-run my app and the simulator starts from scratch and runs my app with no error. Much quicker than re-starting the mac.
Well, I had the same error popping up, but since I force quitted the simulator then ran the project again I got it fixed and running fine. Hope that helps you :)
If this error occurs with ionic framework, make sure you have an app id given in your config.xml
This is a generic error which says that it is unable to launch the app. The real error is in the log file. Go to the Simulator menu, Debug / Open System Log. Then press Reveal button to open the folder with actual Simulator logs. In my case it was CoreSimulator.log.
Here you will find the real error. My error was Could not register service com.apple.gputools.agent.producer.sim .
After a lot to struggle and trying all suggestions for half a day, I just went to simulator menu and chose File / GPU Selection / Use External GPU when available. That's it.
please download new xcode_6 beta 4. your project will work in simulator. As i have tested as well.
Sometimes the beta version of XCode is wrongly configured to use the command line tools from the previous xcode version.
This solution should fix the issue for you : https://stackoverflow.com/a/25415781/512504

Resources