Xcode 9.2 Simulator Debugging Broken; Could not attach to process id - ios

Xcode 9.2 debugging on an iOS Simulator has completely broken for me.
I worked on this for hours and tried a ton of suggestions short of completely wiping my hard drive and starting out with a fresh operating system install. I ended up filing a bug with Apple. Posting here in case anyone has encountered this problem and has any suggestions.
Summary:
When try to build and run in debug mode with a debug executable. The simulator only opens the application to a white screen and then Xcode pops up an error:
Could not attach to pid: "<a process id>"
Ensure "<app>" is not already running, and "<user>" has permission to debug it.
Steps to Reproduce:
Make any project and try to run on any simulator.
Expected Results:
Debugger successfully attaches to debugger.
Actual Results:
Debugger is never able to attach to the iOS simulator process/app for debugging.
Debugger CAN attach and build and run successfully on a physical device.
Version/Build:
- Xcode Version 9.2 (9C40b)
- macOS Sierra 10.12.6
- Any iOS project
- Any iOS simulator
Other notes:
- Xcode 9.2 was working fine until this problem randomly started. The error initially said:
Failed to initiate service connection to simulator
DTServiceHubClient failed to bless service hub for
simulator iPhone 8 Plus <simulator identifier>
- After rebooting computer, the error shifted to "Could not attached to pid..."
I tried dozens of suggested solutions short of completely wiping my computer including:
Resetting device contents and settings on simulators
Create a new device (even different device and OS combinations)
Try different Xcode projects, even simple one-off single view applications
Looking at the etc/hosts file and verifying localhost can be pinged
Restarting computer multiple times
Deleting out derived data (multiple times)
Let it build and run without attaching debugger, then try to attach debugger by "attach to process id"
Completely uninstalling Xcode and all simulators, and reinstalling.
Removing any invalid certificates in keychain

It turns out our security software was blocking the debugger. Running sudo sysdiagnose helped me find a log entry showing that it was being blocked. The software is Cb Defense (Carbon Black Defense). Apparently the only workaround is for your security team to whitelist by a hash, and that hash could change in the future.

There is a bug in Xcode 9.0-9.2 that causes this issue to appear after running for a while. If you log out and back in it should resolve it for you.

Related

Xcode 14 is not getting attached to Simulator in Debug mode

While debugging any iOS application, Xcode builds and run successfully, also launches a simulator but it is not able to attach debugger from Xcode 14 to Simulator iOS app.
It throws an error in Xcode:
Xcode console says:
Could not attach to pid : “75997” Domain: IDEDebugSessionErrorDomain
Code: 3 Failure Reason: attach failed (Not allowed to attach to
process. Look in the console messages (Console.app), near the
debugserver entries, when the attach failed. The subsystem that
denied the attach permission will likely have logged an informative
message about why it was denied.) User Info: {
DVTRadarComponentKey = 855031;
IDERunOperationFailingWorker = DBGLLDBLauncher;
RawUnderlyingErrorMessage = "attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the
debugserver entries, when the attach failed. The subsystem that
denied the attach permission will likely have logged an informative
message about why it was denied.)"; }
Tried with re-installing Xcode and Command line tools, but issue persists.
Steps:
Build and run app with Debug executables true
Simulator gets launched
Error on Xcode and it gets disconnected from simulator
Is there a possibility that it can be blocked by any other app, if so how to identify ?
I solved the issue by doing the steps below:
SOLUTION 1:
Edit the scheme
Select Run
Select Build Configuration "Debug"
Select "Wait for the executable to be launched"
Close
Run the app
see the screenshot here
You will receive an error message when you run the app again.
Close the app.
Edit the scheme again and change "Wait for the executable to be launched" to "Automatically".
Now your simulator will work as expected.
SOLUTION 2:
Delete your app folder in Derived Data
/Users/[your username]/Library/Developer/Xcode/DerivedData/
Search your app name folders and delete them.
SOLUTION 3:
Open the terminal and run:
sudo DevToolsSecurity -enable
This command enables the Developer Mode. After running the command you will receive this message: [Developer mode is now enabled].
Sometimes it's happen, when you are trying to build too fast after a build has started.
First of all, quit your current simulator, delete derived data and clean the project, wait until whole processing is complete. Then do some changes / editing if required (as we clean all data) and try running on a different simulator.
Check certificates in key-chain access, if you found any untrusted certificates in key-chain access remove it.
Also if you are using beta version just make sure it is downloaded from Apple official website.
Came here to share my (strange) solution if anybody crosses the same problem with no answers working. In my case, no solution from this nor other SO answers to similar questions worked (cleaning, rebuilding project, updating, clearing derived data..)
My setup is:
Macbook M1 2022 + Xcode Version 14.2 (14C18)
This Xcode version could not attach to any of my apps (fresh new or previously developed) on different simulators (11, 12, 14) with iOS versions 13.7 - 16.2.
Editing scheme solution from answer above was not working also so I ended up in leaving scheme as:
Build configuration: Release
Debug executable Deselected(!)
Launch Automatically
And magically debugging app in Xcode started working even though it's release version with debug option deselected.. Selecting Debug executable again makes Xcode not possible in attaching to app process
Just to clarify: above steps actually makes app to run as in DEBUG mode - Xcode attaches to pid, I can do console logs and breakpoints. This Xcode version behaves opposite than options selected

React Native Expo Managed App doesn't launch/start on iOS simulator

I've been having hard times with my old Windows laptop while developing React Native apps so I moved to MacOS laptop. I installed Android Studio and Xcode (including Xcode command line tools). Then I initialized a blank expo managed project. I started both on Android Emulator and iOS simulator. Android one worked out with an ádb´ error (or maybe warning). But on the other hand, iOS simulator did nothing. There's no Expo Go app installed on iOS device, so it can not launch my app using it. I don't get any error or warning related to this problem, so I can't trace the problem.
I have tried deleting global expo folder located at ´~/.expo/´, I also tried to give 777 (all permissions) on that folder to my current user.
I tried uninstalling and reinstalling expo package globally.
I made sure I have selected Xcode command line tools on ´Xcode -> Preferences -> Locations -> Xcode 13.2.1 (13C100)´
I tried to launch different iOS devices like (iPhone 6, 8, 13, iPod etc.)
I tried clearing cache and starting expo with ´sudo npm start --clear-cache´
I have been trying to solve this for at least 2 hours tried everything possibly related to my problem but none of them did work. There's one thing I don't understand though. Even though I used different iOS device simulators the Expo Metro Bundler showed this ´› Opening exp://10.42.33.15:19000 on iPhone 8´ output. I have tried iPhone 13, iPhone 6, iPod etc. but this was the same output for different devices. Here's some screenshot related to probem:
https://www.youtube.com/watch?v=dvuZn6gX_Q4
This tutorial video on YouTube helped me solve my problems. I think I was missing a few things:
I haven't granted required privacy permissions on my Mac for Xcode, Android Studio and VS Code. Open System Preferences > Security & Privacy > Go Privacy Tab > Give Full Disk Access to Xcode, VS Code, Android Studio, Terminal and Watchman (Watchman is not required, but I have also installed it for solving a problem before)
You should to launch both your Android and iOS simulators before starting your expo application. Simply go to Android Studio and launch your device. To launch iOS device use bash and type open -a simulator.
If you don't have Expo Go app installed on your iOS simulator then you should first install it before starting your expo app. To install it use expo client:install:ios command.
Start your app by using expo start command. Type i and a or click on Run on iOS simulator and Run on Android device/emulator buttons to launch your app on devices.
NOTE: If you app gets stuck at New update available, downloading... stage then you can start your expo app with cleaned cache using expo start -c command. It was helpful for me.
NOTE 2: You may need to use sudo command on some of the commands I've mentioned, I'm not sure which ones are required or not.
I run into the same issue every time when I tried to set it up on a new laptop.
Its fixed after the installation of xCode cli.
Take a look at this - https://docs.expo.dev/workflow/ios-simulator/
I fixed similar issue by hard restarting simulator
Top menu -> Device -> Erase All Content And Settings...

Xcode 9: Could not attach to pid

I've been facing an issue (frequently) with the recent major release of the iOS application development tool - Xcode 9-beta.
It's showing me the following error frequently while running/debugging app in Simulator (iOS 11).
Could not attach to pid : “2370”
Ensure <project title> is not already running, and <system username> has permission to debug it.
Here is a snapshot for the same issue:
What would be permanent solution of this issue, as it's disturbing frequently?
If issue is on OS Mojave and you are trying, like me to run tests on older Xcode version (lower than 10.0), make sure that in your scheme, when you select Test, Debug executable is disabled
You won't be able to debug tests from this point
Still not a permanent solution, but I had to quit and restart Xcode as the other solutions did not work for me.
This worked for me:
Edit Scheme -> Info -> Executable -> Ask on launch
Credits to #nastya-gorban's answer here
Update
After spending a considerable time with examples on Apple bug report, they basically disregarded the issue as using manual certificates is not "expected".
Long story short, if you don't have a business account and hence multiple developers on the same account, you should be fine with using the automatic signing and should not see the issue.
If you do have a business account with multiple users (which I found it breaks automatic signing), this is their suggestion:
We suggest that you use automatic signing for your debug builds and
manual signing for your distribution builds.
Killing my simulator and then running it again from Xcode.
I had this issue too. There seems to be an issue with having two Xcode version installed at the same time. (9.4.1 and 10.0 Beta)
It works with the beta, but not with the stable version. Everything is set to the tools of the Xcode 9.4.1 stable version. I can only run my unit tests with the beta.
After removing the beta, it worked with the stable version.
delete derived data and clean the project, wait until processing is complete, this may take some time. The idea is to give some processing time. Works fine after that
I have been dealing with this issue for days. I have been able to build but not launch on Simulator, and I get the same "pid:.." error message.
I am using:
- Xcode v9.2
- Swift 3.2
- Building for iOS
The things that I tried that DID NOT WORK were:
restarting the computer; deleting content and settings (of Simulator, I do not have "reset"); uninstalling and reinstalling Xcode; changing "Deployment Target"; changing the device in the simulator's Hardware->Manage Device; deleting Derived Data, Cleaning and Building, or just waiting...forever.
What WORKED was as #Rajasekhar mentioned:
checked out the Keychain certificates.
deleted the exiting ones by right clicking (they'd passed expiration)
and unchecked "automatically manage signing" in Targets->General
After that it successfully launched in Simulator. I don't know if the issue will come back but hopefully this works.
Even on Xcode 11.1/2/3
It is an Authorization issue with Simulator,
When Simulator does not have the necessary access. It raises the issue.
Try following in Terminal
sudo DevToolsSecurity -enable
or
sudo /usr/sbin/DevToolsSecurity -enable
Details can be found here
I hate to add more noise to this, but for me, the answer is to, nonsensically, use sudo.
Run normally, Xcode 9.4.1 (9F2000) and Xcode 10.0 beta 4 (10L213o) both failed to attach to my app after multiple tries, giving the error quoted in the original post.
What worked was to run Xcode (9.4) with sudo,
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
I don't see why sudo is necessary. The Cocoa app to which I am attaching is a Debug build that I just built in Xcode 9.4.1 and dragged into /Applications. It is not codesigned. Posix permissions on the .app, its Contents, its MacOS, and the executable are all octal 755. Owner is me. It works fine if I leave it in the Build folder, build and debug in the normal way.
The problem is apparently with lldb. I also tried using lldb (lldb-902.0.79.7) from the command line. I got the same result. It works only with sudo. Without sudo,
error: attach failed: unable to attach
I had same issue. Check screenshot.
Below are few solutions that should work:
Rerun project
Clean (Shortcut: cmd + shift + K) and Rerun project
Quit Xcode and Simulator. Open project and run again
Reset content of Simulator (Select Simulator -> Goto Hardware tab -> Erase All Content and Settings…) and rerun project.
Solution 4 worked for me.
This seems to be a temporary issue when you are trying to build too fast after a build has started. Try stopping and running the project again.
(most likely solution) 1. Simulator-> Hardware-> Erase all contents and Settings
(less likely solution) 2. keychain-> upper right lock-> unlock and lock again (or the other way around)
I was seeing this in Xcode 10.2 and the cause for me was that lldb-rpc-server was crashing. I worked around it by ensuring either Address Sanitizer or Thread Sanitizer is enabled in the debug options. I also filed a bug report viewable on Open Radar.
I tried all the answers above. The only thing worked to me is changing the build number.
In my case (Xcode 10.1), this was the error in the console:
kernel macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (bin) (pid: 10132): (bin) is hardened, (bin) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
So the solution was to disable the Hardened Runtime, clean the build folder and run again.
This is the issue with the untrusted certificates in key-chain access, please remove such a type of certificates and re-build again.
This happens on my machine, when I set the 'new build system'
Go to menu file=>workspace settings and set Build System to "Standard".
I realise this is not a problem with a single solution, from all the other answers. So, here's what worked for me:
1) Reboot the machine
2) The first run always works for me. The only thing that helps me avoid this error after this first run, is to stop the application from XCode, instead of just clicking the Run button to re-run the application.
Another thing, when I lock my computer the issue re-appears sometimes (probably when I forget to stop the application). So I have to reboot my machine again.
After doing some digging, this worked for me on Xcode 10.3.
sudo /usr/sbin/DevToolsSecurity -enable
In my case the only thing that worked was switching back from the "New Build System" to the "Legacy Build System" in the Workspace Settings. Bummer.
It's an issue with authorization. Try this in the Terminal:
sudo DevToolsSecurity -enable
First, close app completely via sim (not sleep - close app totally)
If not working yet: reboot whole PC, ensure only 1 simulator is active upon reboot.
More than 1 sim can confuse it if it's bugging.

Simulator not working and showing the error message "Unable to boot the iOS Simulator" [duplicate]

I recently installed the beta of Xcode Version 6 in OS X Mavericks, with which comes the iOS simulator for iOS 8. I've managed to successfully run from Xcode 6 beta on a device with iOS 8 Beta, but opening the simulator always get the same error I have tried to change the hardware version of iPhone 4s, iPhone 5, ... in the simulator and still gives the same error: "Unable to boot the iOS Simulator".
I'm working with Xcode 5.1 at the same time in Mavericks, any suggestion to solve this? Is a possible problem for run this simulator in Mavericks because is only for OS X 10.10? Thanks.
After I found some solutions on the web, a combination of procedures worked for me:
Close Xcode and iOS Simulator (and all related applications)
Install (or reinstall) Xcode6-Beta to Applications folder (direct from the .dmg file)
Open Xcode6-Beta and go to Xcode -> Preferences -> Locations -> Command Line Tools and select "Xcode 6.0" (be sure that you've selected the one in Applications folder)
Launch the iOS Simulator and go to iOS Simulator -> Reset Content and Settings...
Close all the applications and restart your mac (I unchecked "Reopen windows...")
Open Xcode6-beta and test the iOS Simulator
Good luck
I also had this problem and found the solution by doing following steps:
Initially i downloaded Xcode 6 library in Documentation section under the path Xcode --> Preferences --> Downloads and restart my xcode but didn't solve my problem.
Downloaded and installed the iOS 7.1 Simulator under the path Xcode --> Preferences --> Downloads.
Restart xcode again and the problem solved.
I am facing same issue again next morning.
Unsetting the DYLD_INSERT_LIBRARIES variable solves my problem:-
Open terminal and type "sudo vi /etc/launchd.conf" command and press Enter
Press I "Insert" mode and change this
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
to this
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
and press esc to exit from insert mode.
Save changes by typing ":wq" Press Enter
Reboot your system and problem soloved.
Prior to that I didn't find any iOS version in front of each listed devices
but after installation or by unsetting DYLD_INSERT_LIBRARIES variable I found the same in front of each device.
I solved by removing and re-adding the simulators see screenshots here.
https://stackoverflow.com/a/25387715/1565615
I don't believe your issue is related to running Xcode 6 in Mavericks, as I encountered the same error on OS X 10.10.
After a bit of toying around with XCode and the iOS Simulator, the only fix I found was simply restarting the computer, and the error hasn't appeared since.
Try a reboot and then see if you can get things up and running.
(On a side note, after restarting just XCode (not the OS), I lost the option to run on the simulator at all—the reboot also fixed this problem, if anyone here encounters anything similar).
In Xcode go to the Xcode menu->Open Developer Tool - IOS Simulators. Choose simulator and then go hardware->device->manage device.
If the troubled device shows in the left column, delete it. Then add the device back from the '+' button. If it wasn't there in the first place, simply add it using the '+' button.
I had previously deleted ~/Library/Developer/CoreSimulator/ directory and the only command that worked for me is xcrun simctl erase all. Perhaps you might want to give this a try.
No need to download a new ios version. All you need is to go to About this Mac > Storage > Manage > Delete XCode Cache. And, it works for me
In latest OS version
About this Mac > Storage > Manage > Developer > select Xcode cache > Click delete button
I've faced same issue and solved by below steps:
1) Move xcode6-beta into application folder
2) Restart mac and open xcode6-beta from application folder.
i too had the same issue, but solved by installing the required simulators (Xcode > Preferences> downloads > install simulators)
This happened to me running the simulator on both Xcode 7 and 8 on El Capitan. The only thing that worked was disabling System Integrity Protection (https://apple.stackexchange.com/a/208481/86757).
I tested an awful quantity of solutions and the only one which worked for me was disabling root protection through Recovery Mode. I tested it with XCode 7.3, it's possible that this approach may work for XCode 8.
Reboot and hold the keys cmd + R prior to show the loading view with Apple Logo
When you are on Recovery Mode, go to Menu and choose Terminal
Type csrutil disable
Reboot the machine and run the simulator again.
I am adding this answer as it seems to be slightly different from the others.
Due to working on an older project I needed to download and run Xcode 7.3 and load the project in simulator - this yielded the "Unable to boot the iOS Simulator" error.
I completed all the above suggestions and none of them worked (reset simulator setting, restarted, deleted and reinstalled Xcode, reset the simulator location, restarted again etc)
In the end the issue was that I was trying to load the iPhone 5 (10.0) simulator on Xcode 7.3.
You can see here the Apple release notes for Xcode 7.3
Xcode 7.3 requires a Mac running OS X 10.11 or later.
Xcode 7.3 includes SDKs for iOS 9.3, watchOS 2.2, OS X version 10.11.4, and tvOS
9.2.
As you can see Xcode 7.3 doesn't include an SDK for iOS 10.0
This meant as soon as I loaded the simulator with iPhone 5 (9.3) it worked immediately.
I would therefore recommend when approaching this issue not to get railroaded (as I did) in thinking that something is wrong with the system before checking the basic things.
Note: It is also worth noting that the simulator must be configured to the Xcode version being used. This can be set in
Xcode -> Preferences -> Locations -> Command Line Tools
and also using the command line:
sudo xcode-select --switch /Applications/Xcode_7.3.app/Contents/Developer
*change the Xcode version to the new one you want to use
one of the reasons could be you might deleted /private folder.
you can try with following commands
sudo mkdir /private/tmp
sudo chmod 1777 /private/tmp
Following are the steps for solved above issue:
Search launchd.conf file in your mac
If not found then create from Terminal with help of command
~ user$ sudo touch /etc/launchd.conf
Terminal will ask you machine password
Then Open created file with help of command for EDIT, if terminal give you error as permission failed
~ user$ sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/launchd.conf
Open file manually from /etc/launchd.conf (Shift+cmd+g) and enter /etc/ (TextEdit software)
In file "DYLD_INSERT_LIBRARIES" flag replace with "ZZ" and save it.
Restart your machine.
Xcode will defiantly works.
This error indicates an error starting up launchd_sim when booting the simulated device. In and of itself, it does not indicate the actual cause. You can look in ~/Library/Logs/CoreSimulator/CoreSimulator.log for more information about the error (including the error reason).
Possible causes:
On OSX 10.9 and earlier, DYLD_INSERT_LIBRARIES could be set by 3rd party applications. On later versions, invalid DYLD_INSERT_LIBRARIES are ignored instead of resulting in an error.
Usage of older simulator runtime DLC with Xcode 7 betas. Newer versions of Xcode ignore these older DLC.
If you need additional help, please provide that additional datum.
Just check your simulator's iOS version. I fought with this error for 2 days and tried everything. Once I run the project on the simulator with iOS version that my Xcode supports, it worked sadly... :/
I quit everything and restarted the Mac. That's all. Its worked like charm!!
I don't know why, but this happened to me when I had Charles Proxy's throttling turned on.
I didn't have to run Xcode again or clean anything. Just disabling the throttling allowed the simulator to work again.
I also clicked on details, but this was all that I got:
Details
Unable to boot the Simulator. Domain: NSPOSIXErrorDomain
Code 60
Failure Reason: launchd failed to respond.
This might be related a known Xcode 11.2 issue:
Third party “endpoint security” software may cause slow simulators, system freezes, or prevent debug processes from running in simulators reliably. This sometimes manifests as debugserver disconnections or simulator applications receiving a SIGKILL signal. (55853555)
Workaround: Uninstall the third party software.
Though I was seeing this error on 11.1. Yet Apple may have just not realized this was an issue on 11.1 as well ¯_(ツ)_/¯
I have solved this issue using following steps:
Xcode -> Preferences -> Location -> Derived Data -> Delete your project folder.
I got this error on OS Catalina, Xcode 11.
I solved this by simply quiting simulator and Xcode, and then start Xcode and run your application.
1. Quit Xcode and Simulator if running.
2. Remove customised settings setup
defaults delete com.apple.Xcode
3. remove configuration folders
rm -rf ~/Library/Application\ Support/Xcode
4. Quit the terminal and run Xcode again.
Resetting the simulators fixed the issue for me. Run the below
Fastlane command to reset all simulators,
fastlane snapshot reset_simulators
Please ensure you have closed Xcode & simulator before running the command.
Fastlane is an Android & iOS deployment automation tool.
I just simply follow the below steps and the issue is resolved...
Go to About This Mac > Storage > Manage > Developer >
Select Xcode cache > Delete the cache
Now try to open the simulator again and it will work... In case if above steps did not work just try to do the same with s
Late answer, but it maybe helpful to someone. I tried all the solutions provided in this and related posts and neither of them worked.
I am using OSX(version 10.10.3) and Xcode 6.2. To fix this issue I followed the following steps :
Delete all xcode and simulator related files using AppCleaner.
Restart Mac.
Open Disk Utility app from applications.
In Disk Utility app; click on button Verify Disk Permission for your Macintosh HD (there will be some warnings displayed; I think /private/tmp is cause of this issue).
In Disk Utility app; click on button Repair Disk Permission for your Macintosh HD.
Re-install Xcode; now it should work.
More info : How to fix Xcode error ‘Unable to boot iOS Simulator’.
This may helpful
Open simulator with 4s
Click on menu- iOS simulator
Click on Reset content and settings...
Force close the simulator and run app.

Error opening iOS Simulator with iOS 8 beta version: "Unable to boot the iOS Simulator"

I recently installed the beta of Xcode Version 6 in OS X Mavericks, with which comes the iOS simulator for iOS 8. I've managed to successfully run from Xcode 6 beta on a device with iOS 8 Beta, but opening the simulator always get the same error I have tried to change the hardware version of iPhone 4s, iPhone 5, ... in the simulator and still gives the same error: "Unable to boot the iOS Simulator".
I'm working with Xcode 5.1 at the same time in Mavericks, any suggestion to solve this? Is a possible problem for run this simulator in Mavericks because is only for OS X 10.10? Thanks.
After I found some solutions on the web, a combination of procedures worked for me:
Close Xcode and iOS Simulator (and all related applications)
Install (or reinstall) Xcode6-Beta to Applications folder (direct from the .dmg file)
Open Xcode6-Beta and go to Xcode -> Preferences -> Locations -> Command Line Tools and select "Xcode 6.0" (be sure that you've selected the one in Applications folder)
Launch the iOS Simulator and go to iOS Simulator -> Reset Content and Settings...
Close all the applications and restart your mac (I unchecked "Reopen windows...")
Open Xcode6-beta and test the iOS Simulator
Good luck
I also had this problem and found the solution by doing following steps:
Initially i downloaded Xcode 6 library in Documentation section under the path Xcode --> Preferences --> Downloads and restart my xcode but didn't solve my problem.
Downloaded and installed the iOS 7.1 Simulator under the path Xcode --> Preferences --> Downloads.
Restart xcode again and the problem solved.
I am facing same issue again next morning.
Unsetting the DYLD_INSERT_LIBRARIES variable solves my problem:-
Open terminal and type "sudo vi /etc/launchd.conf" command and press Enter
Press I "Insert" mode and change this
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
to this
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
and press esc to exit from insert mode.
Save changes by typing ":wq" Press Enter
Reboot your system and problem soloved.
Prior to that I didn't find any iOS version in front of each listed devices
but after installation or by unsetting DYLD_INSERT_LIBRARIES variable I found the same in front of each device.
I solved by removing and re-adding the simulators see screenshots here.
https://stackoverflow.com/a/25387715/1565615
I don't believe your issue is related to running Xcode 6 in Mavericks, as I encountered the same error on OS X 10.10.
After a bit of toying around with XCode and the iOS Simulator, the only fix I found was simply restarting the computer, and the error hasn't appeared since.
Try a reboot and then see if you can get things up and running.
(On a side note, after restarting just XCode (not the OS), I lost the option to run on the simulator at all—the reboot also fixed this problem, if anyone here encounters anything similar).
In Xcode go to the Xcode menu->Open Developer Tool - IOS Simulators. Choose simulator and then go hardware->device->manage device.
If the troubled device shows in the left column, delete it. Then add the device back from the '+' button. If it wasn't there in the first place, simply add it using the '+' button.
I had previously deleted ~/Library/Developer/CoreSimulator/ directory and the only command that worked for me is xcrun simctl erase all. Perhaps you might want to give this a try.
No need to download a new ios version. All you need is to go to About this Mac > Storage > Manage > Delete XCode Cache. And, it works for me
In latest OS version
About this Mac > Storage > Manage > Developer > select Xcode cache > Click delete button
I've faced same issue and solved by below steps:
1) Move xcode6-beta into application folder
2) Restart mac and open xcode6-beta from application folder.
i too had the same issue, but solved by installing the required simulators (Xcode > Preferences> downloads > install simulators)
This happened to me running the simulator on both Xcode 7 and 8 on El Capitan. The only thing that worked was disabling System Integrity Protection (https://apple.stackexchange.com/a/208481/86757).
I tested an awful quantity of solutions and the only one which worked for me was disabling root protection through Recovery Mode. I tested it with XCode 7.3, it's possible that this approach may work for XCode 8.
Reboot and hold the keys cmd + R prior to show the loading view with Apple Logo
When you are on Recovery Mode, go to Menu and choose Terminal
Type csrutil disable
Reboot the machine and run the simulator again.
I am adding this answer as it seems to be slightly different from the others.
Due to working on an older project I needed to download and run Xcode 7.3 and load the project in simulator - this yielded the "Unable to boot the iOS Simulator" error.
I completed all the above suggestions and none of them worked (reset simulator setting, restarted, deleted and reinstalled Xcode, reset the simulator location, restarted again etc)
In the end the issue was that I was trying to load the iPhone 5 (10.0) simulator on Xcode 7.3.
You can see here the Apple release notes for Xcode 7.3
Xcode 7.3 requires a Mac running OS X 10.11 or later.
Xcode 7.3 includes SDKs for iOS 9.3, watchOS 2.2, OS X version 10.11.4, and tvOS
9.2.
As you can see Xcode 7.3 doesn't include an SDK for iOS 10.0
This meant as soon as I loaded the simulator with iPhone 5 (9.3) it worked immediately.
I would therefore recommend when approaching this issue not to get railroaded (as I did) in thinking that something is wrong with the system before checking the basic things.
Note: It is also worth noting that the simulator must be configured to the Xcode version being used. This can be set in
Xcode -> Preferences -> Locations -> Command Line Tools
and also using the command line:
sudo xcode-select --switch /Applications/Xcode_7.3.app/Contents/Developer
*change the Xcode version to the new one you want to use
one of the reasons could be you might deleted /private folder.
you can try with following commands
sudo mkdir /private/tmp
sudo chmod 1777 /private/tmp
Following are the steps for solved above issue:
Search launchd.conf file in your mac
If not found then create from Terminal with help of command
~ user$ sudo touch /etc/launchd.conf
Terminal will ask you machine password
Then Open created file with help of command for EDIT, if terminal give you error as permission failed
~ user$ sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/launchd.conf
Open file manually from /etc/launchd.conf (Shift+cmd+g) and enter /etc/ (TextEdit software)
In file "DYLD_INSERT_LIBRARIES" flag replace with "ZZ" and save it.
Restart your machine.
Xcode will defiantly works.
This error indicates an error starting up launchd_sim when booting the simulated device. In and of itself, it does not indicate the actual cause. You can look in ~/Library/Logs/CoreSimulator/CoreSimulator.log for more information about the error (including the error reason).
Possible causes:
On OSX 10.9 and earlier, DYLD_INSERT_LIBRARIES could be set by 3rd party applications. On later versions, invalid DYLD_INSERT_LIBRARIES are ignored instead of resulting in an error.
Usage of older simulator runtime DLC with Xcode 7 betas. Newer versions of Xcode ignore these older DLC.
If you need additional help, please provide that additional datum.
Just check your simulator's iOS version. I fought with this error for 2 days and tried everything. Once I run the project on the simulator with iOS version that my Xcode supports, it worked sadly... :/
I quit everything and restarted the Mac. That's all. Its worked like charm!!
I don't know why, but this happened to me when I had Charles Proxy's throttling turned on.
I didn't have to run Xcode again or clean anything. Just disabling the throttling allowed the simulator to work again.
I also clicked on details, but this was all that I got:
Details
Unable to boot the Simulator. Domain: NSPOSIXErrorDomain
Code 60
Failure Reason: launchd failed to respond.
This might be related a known Xcode 11.2 issue:
Third party “endpoint security” software may cause slow simulators, system freezes, or prevent debug processes from running in simulators reliably. This sometimes manifests as debugserver disconnections or simulator applications receiving a SIGKILL signal. (55853555)
Workaround: Uninstall the third party software.
Though I was seeing this error on 11.1. Yet Apple may have just not realized this was an issue on 11.1 as well ¯_(ツ)_/¯
I have solved this issue using following steps:
Xcode -> Preferences -> Location -> Derived Data -> Delete your project folder.
I got this error on OS Catalina, Xcode 11.
I solved this by simply quiting simulator and Xcode, and then start Xcode and run your application.
1. Quit Xcode and Simulator if running.
2. Remove customised settings setup
defaults delete com.apple.Xcode
3. remove configuration folders
rm -rf ~/Library/Application\ Support/Xcode
4. Quit the terminal and run Xcode again.
Resetting the simulators fixed the issue for me. Run the below
Fastlane command to reset all simulators,
fastlane snapshot reset_simulators
Please ensure you have closed Xcode & simulator before running the command.
Fastlane is an Android & iOS deployment automation tool.
I just simply follow the below steps and the issue is resolved...
Go to About This Mac > Storage > Manage > Developer >
Select Xcode cache > Delete the cache
Now try to open the simulator again and it will work... In case if above steps did not work just try to do the same with s
Late answer, but it maybe helpful to someone. I tried all the solutions provided in this and related posts and neither of them worked.
I am using OSX(version 10.10.3) and Xcode 6.2. To fix this issue I followed the following steps :
Delete all xcode and simulator related files using AppCleaner.
Restart Mac.
Open Disk Utility app from applications.
In Disk Utility app; click on button Verify Disk Permission for your Macintosh HD (there will be some warnings displayed; I think /private/tmp is cause of this issue).
In Disk Utility app; click on button Repair Disk Permission for your Macintosh HD.
Re-install Xcode; now it should work.
More info : How to fix Xcode error ‘Unable to boot iOS Simulator’.
This may helpful
Open simulator with 4s
Click on menu- iOS simulator
Click on Reset content and settings...
Force close the simulator and run app.

Resources