xcode: can not open simulator: Error saving com.apple.lsdidentifiers.plist : (null) - xcode

This is the log in console.
2016-10-19 4:35:30.377 PM com.apple.CoreSimulator.CoreSimulatorService[761]: Error saving /Users/myusername/Library/Developer/CoreSimulator/Devices/14ABD200-69D3-441D-8FAA-731F5F00F678/data/tmp/com.apple.lsdidentifiers.plist : (null)
/Library/Developer/CoreSimulator/Devices/14ABD200-69D3-441D-8FAA-731F5F00F678/data/tmp/ is an empty folder.
Meanwhile, my xcode can not load xib or storyboard properly. "Internal error occurred, Editing functionality maybe limited"
I did clear /Users/myusername/Library/Developer/CoreSimulator/Devices/ folder, doesnt help, re-install xcode doesnt work.
environment: OS: EI 10.11.6, xcode: 8.0 simulator:Version 10.0 (SimulatorApp-700.5.3

The error message is benign and can be ignored. Sorry about the noise in syslog. The issue has since been resolved in the Xcode 8.1 betas.
If you deleted ~/Library/Developer/CoreSimulator/Devices while CoreSimulatorService was running, the service will be in an inconsistent state. You should SIGKILL it to cause it to relaunch in a new state.
Your 'Internal error occurred, Editing functionality maybe limited' error message is likely unrelated to either of those things. Most users see that because they're trying to use multiple copies of Xcode.app at the same time. It's perfectly fine to have multiple Xcodes installed, but you can only use one at a time. If that's not the issue you're seeing, you will need to provide more information about the error.

fixed it by turn off System Integrity Protection in El Capitan.
I totally have no idea when I updated mac os, and got this issue.
Until I noticed that I cant start mysql, which has similar issue 'Could not create unix socket lock file /tmp/mysql.sock.lock'
Then I thought something went wrong with my os settings.
steps:
Restart your Mac.
Before OS X starts up, hold down Command-R and keep it held down until you see an Apple icon and a progress bar. Release. This boots you into Recovery.
From the Utilities menu, select Terminal.
At the prompt type exactly the following and then press Return: csrutil disable
Terminal should display a message that SIP was disabled.
From the  menu, select Restart
for more information https://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really

Related

Failed to boot IBSimDeviceTypeiPad2x

Accessing storyboard hangs xcode, then throws error below.
This happens for newly created project, on newly (re)installed xcode.
I've tried xcrun simctl commands, there is no device with UDID: 9C08E254-108D-49F6-A1FC-CE43B2F30EB9.
Not clear which device IBSimDeviceTypeiPad2x is.
Deleted and recreated all iPad devices in Simulator.
iPad 2 is not possible on iOS 11.4
Have already done complete uninstall and reinstall of xcode (including removing ~/Library/Developer / Cache / Application Support stuff.
Problem persists.
Error:
Encountered an error communicating with Interface Builder Cocoa Touch Tool.
(Failure reason: Interface Builder Cocoa Touch Tool failed to launch):
Failed to boot device IBSimDeviceTypeiPad2x (9C08E254-108D-49F6-A1FC-CE43B2F30EB9, iOS 11.4, Shutdown)
System content for IBCocoaTouchFramework-ElevenAndLater <IBScaleFactorDeviceTypeDescription:
0x7f93a450bec0> scaleFactor=2x (Failure reason: Failed to boot IBSimDeviceTypeiPad2x (9C08E254-108D-49F6-A1FC-CE43B2F30EB9, iOS 11.4, Shutdown)):
Unable to boot the Simulator. (Failure reason: launchd failed to respond.)
launchd_sim log contains:
missing or invalid configuration plist
xcode version:
Version = 9.4.1 (9F2000)
Plugin Version = 14113
Beta Version = 0
OS Version = 10.13.6 (17G65)
In case this helps anyone else with this issue: after weeks of back and forth with Apple Support, we tracked this down to either third party kernel extensions or third-party antivirus. After thoroughly ensuring both were disabled, Storyboard editing became available again. In my case, it was most likely Little Snitch that was interfering (make sure both Network Filter & Network Monitor are set to the "off" position). There could potentially be a Little Snitch rule that's interfering as well, I haven't spent enough time to track it down yet.
I have been struggling with this for some time, filed a bug report with Apple and they claimed I didn't have permission. No reference to what permissions.
Towards the bottom of the log file from the bug report was the following text.
"You don’t have permission to save the file “60ACC3A5-E7E2-4330-869B-15447826C019” in the folder “CoreSimulator”." UserInfo={NSFilePath=/Users/terryburdett/Library/Logs/CoreSimulator/60ACC3A5-E7E2-4330-869B-15447826C019, NSUnderlyingError=0x7fda1871c8b0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}}}}
Follow the path to Logs and getinfo on Logs folder. If your name isn't in the sharing and permissions list, unlock the folder and add it. Change permissions to read/write. Next time you run Xcode it should create an CoreSimulator folder in the Logs folder and compile without bug.

LLDB RPC server freezes app

For the past months I have not been able to debug macOS or iOS apps through Xcode. What happens is the following:
Build and run app from Xcode.
Xcode says app is running, but no app has appeared and no debug output from app either.
Kill the process lldb-rpc-server.
App appears and runs as normal, but Xcode is no longer debugging.
Start a new debugging session by attaching it to the app's process.
App freezes again, until lldb-rpc-server is killed.
This OpenRadar has the same description.
I have tried re-installing Xcode (including command-line tools), but it didn't help. Any ideas?
Xcode: Version 9.3.1 (9E501)
MacOS: 10.13.4 (17E199)
The cause of this was that I had installed a GDB/LLDB-extension called Voltron. I was unaware that the installation also created/modified the .lldbinit in the home folder. Removing this file fixed the issue. See also this issue for Voltron.
Got some very good help from Apple.
I had received this warning msg when device was locked and I was running app on device, so when device is unlocked this warning goes

Xcode 7.3 wont attach to simulator to debug

So I upgraded to Xcode 7.3.1 and now my Xcode will build, and deploy my apps (yes every app, even a brand new blank one) to the simulator but the app never launches on the simulator and the debugger never attaches, Xcode just hangs and has to be force quit. I've completely wiped out Xcode and all simulators and re-installed to no avail. I've scoured Stack Overflow and Google trying every piece of advice and still no luck. Anyone anywhere have any idea how to solve this issue? If I downgrade to 7.2.1 I'm able to debug in the simulator just fine.
Let me know if you need more information.
My Apps run just fine on the simulator, and if I try to attach the debugger to a running app it wont and Xcode hangs in the attempt, when attempting to attach this way at least Xcode doesn't have to be force quit.
FYI, I can debug on a device this is only a simulator issue.
I had this same issue, and tried fixing my projects and reinstalled Xcode twice before I was able to get Simulator to crash and give me an error report that called out Cylance. Luckily I have access to administer our Cylance portal, so I was able to work through the issue to narrow down the problem.
Symptoms:
When running an app from Xcode, the Simulator launches but the application does not launch within the Simulator
Trying to stop the application from within Xcode does not work, and generates no messages
Trying to re-run the application from within Xcode generates the following message: ‘An instance of “APPLICATION NAME” is already running. Choose “Stop” to terminate and launch a new instance.’ But pressing Stop does nothing.
Xcode will not quit, and eventually the user must Force Quit to exit Xcode
Within the OS X console, the following messages are displayed:
6/3/16 7:35:38.000 PM kernel[0]: AMFI: com.apple.dt.ins(pid 2239) - [deny-mmap] main process is a platform binary, but mapped executable file is not: /Library/Application Support/Cylance/Desktop/CyMemDef.dylib
6/3/16 7:35:38.000 PM kernel[0]: AMFI: com.apple.dt.ins(pid 2239) - [deny-mmap] mapped file has team identifier XXXX: /Library/Application Support/Cylance/Desktop/CyMemDef.dylib
Resolution:
The problem is caused by Memory Protection being turned on within the policy assigned to the Mac within the Cylance portal.
To resolve the issue, place the Mac into a zone/policy that does not have Memory Protection turned on. Auto Quarantine and Protection Settings can be left on.
During my testing, I was not able to come up with a list of exclusions that allowed me to leave Memory Protection on, so I ended up disabling it completely.

Failed to Attach to Process ID Xcode

Anyone has experienced this problem?
Yesterday I still can run my app in simulator but now I cannot run my app since Xcode prints this error in console:
error: failed to attach to process ID <ID number>
I have tried to reinstall, do this post and create new project but returns no luck.
Anyone can resolve this issue?
I use Xcode 4.5 Preview 2 and try to run iOS simulator 6
Resetting the content and settings in the simulator worked for me. This is available in the "iOS Simulator" menu.
go to the Product menu and find the Edit Scheme menu there.
While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
I experienced the same problem, and after a while I found out that it was due to the fact that my XCode project included a Folder Reference to a folder named Resources.
It seems that XCode doesn't like that name.
Just removing the folder reference or renaming the folder solved the issue.
TWO METHODS
Method 1 : Inside the folder Application Support -> iPhone Simulator -> In the each simulator version of iOS -> Applications -> Delete all the files present here.
Now go to Products -> Clean
Now run it on any simulator and it will work.
Method 2 :
Step1: ping
$ ping localhost
This should return something like
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.028 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.048 ms
...
If this works, this answer won't fix your problem, try something else.
If ping return something else for example: ping: cannot resolve localhost: Unknown host something is screwed up with your /etc/hosts file, go to Step 2
Step2: Check /etc/hosts
Check that the top of your /etc/hosts file looks like this
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
If it doesn't have these entries in the file, enter them at the top of the file, flush the dns cache using $ dscacheutil -flushcache and go back to Step 1, otherwise continue to Step 3.
Step3: Correct File Format: It should be unix or LF *
$ file /etc/hosts
This should return: /etc/hosts: ASCII English text
If it returns something like /etc/hosts: ASCII English text, with CR line terminators then the file is in the wrong format and is likely being ignored.
Change the file line endings to unix or LF using your favorite text editor.
In Sublime Text 2 this can be done throught the view menue: View > Line Endings > Unix
Flush the dns cache ($ dscacheutil -flushcache) and go back to step 1
Similar to fundtimer's answer, the local hosts file seems to have been the culprit.
I had to change my /etc/hosts permissions back to the default after an inadvertent change:
sudo chmod 644 /etc/hosts
After that, simulator/LLDB worked for me.
This is an old topic, but I believe things have changed a bit for the latest version of macOS.
I've stumbled on the issue while trying to run an UI test suite for an iOS app in the simulator on macOS Mojave Beta and Xcode 9.4.1.
Turns out, on macOS Mojave the codesign tool (which is a part of the OS itself and not a part of the Command Line Tools or Xcode) signs processes into a hardened runtime environment which includes runtime code signing enforcement, library validation, hard, kill, and debugging restrictions. This, together with the System Integrity Protection in macOS Mojave, prevents the lldb debugger from connecting to the running target.
To resolve this, you have to options:
An obvious one, probably, is just to use Xcode 10. It does seem to handle the connection gracefully.
Reboot the OS into the Recovery Mode and turn off the System Integrity Protection from the Terminal with csrutil disable. The debugger then connects happily.
I've spent quite an amount of time banging my head on this and was able to resolve it all after reading the following article: http://www.lapcatsoftware.com/articles/debugging-mojave.html
Just my two cents. Hope this helps someone.
I had somehow removed or deleted records from my /etc/hosts file and I got the same error.
You should check whether you have in your /etc/hosts file the line "127.0.0.1 localhost".
This helped me!
I know this is an old question, but it came up first for me when I did a google search for "failed to attach to process ID". I'm using Xcode 7. Happened after iOS9 was released and I had updated my swift app for swift 2.
Deleting my app in the simulator and doing a new build and run cleared it up.
I've had the same problem when debugging on the device. The app crashed on start but didn't appear as a running process.
My solution is to use some process viewer app (e.g. System Status or similar). Find your stale app and then find the parent process id which usually is debugserver.
Go on Xcode, Product -> Attach to Process -> By process id and attach to the debugserver process PID. Wait a second and then press the Stop button.
The stale debugserver and app processes disappear.
(When using the simulator, the equivalent would be to use the terminal, ps, and kill the App process. Haven't tried that, though).
I just removed the application from the simulator (just like you would on an actual device), and when I re-ran it everything worked fine.
I have also same problem and for me the solution is :-
Just delete the app from the Simulator and then clear and Run the project.
May it help also to someone else.
I fixed this problem by removing Xcode Derived data contents.
In finder press SHIFT+CMD+G and type below path and remove all data inside DerivedData:
~/Library/Developer/Xcode/DerivedData
Also reset simulator builds
~/Library/Application Support/iPhone Simulator/6.0/Applications
I just posted this on the Developer Forum. It was a simple solution and may help someone here:
I had exactly the same problem: when using any current version of Xcode 4.xx and the LLDB debugger, plus any version of the Simulator, XCode consistently crashed with 'failed to attach to process ...' My only resolution was to switch to the GDB debugger. This was disappointing since I really wanted to try the new, robust LLDB in XCode 4.6-DP.
And then I remembered; I had changed my network/server host file at ...etc/hosts some time ago to accomodate several Apache2 server virtual hosts, i.e., I removed the line:
127.0.0.1 locahost
That was it. Removing that line, XCode crashed on attaching to the Simulator with LLDB.
Restoring that line, XCode worked just fine with LLDB and the Simulator.
Anyway, this may not be your problem but it's worth exploring. As far as I'm concerned, it's a serious undocumented bug.
In my case the solution was different: the run mode was "Release". Changing to "Debug" fixed it. Xcode 4.5.x had no problem with it.
The issue for me was caused by a pretty stupid mistake: I created a new target for my project by duplicating an existing target and forgot to change the Bundle Identifier in the target's info.plist file.
Above answer really helped me.
https://stackoverflow.com/a/12819757/1752988
Because in my XCode I used story board and custom view controller. and in its warning list that I saw some of the nib files are missing. I was miss leaded by seeing that. However, I saw this answer,
and even though I didn't like to reset my App simulator content, I did it and it really worked for me.
And also Changing the Debugger from Product -> Scheme -> Edit Scheme (Run) from LLDB to GDB didn't work for me either.
P.s.:- Pardon me,I added this answer as a support comment to above, as I don't have 15 reputation upvote the above answer or 50 points of reputation to comment on above.
I solved this problem by quitting XCode and Simulator. Reopen the Project. Done.
The following worked for me on iOS 9.1 :
Just uninstall the app from the simulator
Quit the simulator (Cmd+Q)
Clean your Xcode project
Run on simulator
Note: No need to reset the simulator.
I am working on Ionic 2 application, I am new to this and even Xcode and simulator.
Initially my app was working on simulator but after some time it start generating error like-
xcode error: failed to attach to process id
I searched for, tried all above answers but my issue was not resolved.
Then I updated (Ionic, npm, cordova) my machine setup-
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Install ios-deploy to deploy iOS applications to devices. `npm install -g ios-deploy` (may require sudo)
******************************************************
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: OS X Yosemite
Node Version: v6.2.2
Xcode version: Xcode 7.2 Build version 7C68
******************************************************
After this I just run a command from my application home directory
ionic run -l
ionic build ios.
imported xcode changes to xcode.
Reset content and setting as-
clear product from xcode,
Run Xcode and now it is working on simulator.
Happy to see this!!!
So many answers to this and I didn't see what I believe is the correct one. It's an issue with authorization. Type this in the Terminal:
sudo DevToolsSecurity -enable
On Xcode 9+ do the following:
Go to the Xcode menu: Product-Scheme - Edit Scheme and under Run tab be sure that the Debug Executable checkbox is checked! That's it!
Just reset content and settings of iOS simulator and then clean code by pressing command+shift+k keys to clean code.This worked for me
As lame as it is, restarting my computer was the only solution that worked. I tried switching from LLDB to GDB, resetting the contents of the Simulator, and restarting Xcode. The only thing that worked was restarting my computer, reopening Xcode, and re-running the app.
I had the same problem. I did some combinations of answers given to make it work. :)
clean the Build Folder by clicking "Product" in the MenuBar. while pressing the Alt-key click on "Clean Build Folder". Now restart your xcode and simulator.
Now it should work. if not, also try changing bundle identifier and Simulator "Content Reset" and then restart xcode and simulator.
Ran across this today. I accidentally removed my Launch images from my Target Settings.
try to do next steps:
Go to Product/Scheme/Edit Scheme then select Run section.
Select Info Tan and set Debugger None.
Run project. It must be working (without debugger)
Go back to Edit Scheme and selecet debugger LLDB
Run project. It is working.
Maybe additionally you need to delete derived data and do Product/Clean
Do you have multiple users logged in to your machine? I have "personal" and "work" accounts on my laptop. I got this error when I was trying to debug from my personal account, but I had left the simulator running in my work account. Quitting the simulator in the other account fixed my problem.
and another one for the record: (none of the suggestions worked for me)
Mountain Lion: XCode 4.6.3
I moved the whole Application to Trash and deleted following other folders
/Users/[USERNAME]/Library/Developer
/Users/[USERNAME]/Library/Caches/com.apple.dt.XCode
/Users/[USERNAME]/Library/Application Support/iPhone Simulator
reboot System and reinstall XCode
Also had same problem today. i was using Xcode 4.6.3. i closed my project and open it in Xcode 5 and it is running perfect.
Strange but True

Couldn't register "Application" with the bootstrap server [duplicate]

I keep getting this error when launching my app on the iOS Simulator:
Couldn't register com.mycompany.MyApp with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.
I've read other reports of this error and it seems there is no obvious fix for it (restarting the iOS Simulator, restarting Xcode etc..)
At this point here's a list of things I've tried:
Restarting the Simulator
Restarting Xcode
Rebooting my machine
Deleting my app's Derived Data, and Cleaning
Deleting the iOS Simulator App Support directory
Reverting to a 2 weeks old version of the app (which was working 2 weeks ago)
Deleting the application in the Simulator (by clicking-holding on it and hitting the X button)
Upgrading Xcode form 4.1 to 4.2, and running the app both in iOS Simulator 4.3 and 5.0
Nothing worked, I still get the same bootstrap error.. Any (and at this point I really do mean ANY) suggestion would be appreciated.
Edit: Just wanted to add that the app runs fine on a device. I only get this error on the simulator...
As the GDB said:
This generally means that another instance of this process was already running or is hung in the debugger
So find out it and kill it. ;)
I restarted the mac, and it run successfully.
Tip: Well, this may be not work sometimes, so I strongly suggest that you press cmd+. to make sure that you do have stopped the simulator (or device). I find that in most cases the simulator (or device) will not stop exactly when it crashes. I rarely met this issue again with pressing the cmd+. every time it crashes or even just normal exit. Hope this will be helpful. :)
I just closed my xcode & restart my device(ipad2) and it works for me :)
You can try this :: Couldn't register with the bootstrap Server
Another solution, go to clear the memory of the iphone simulator
Simulator > recovery content and setting
then run the program again.
i just change the identifier and the app can work again.
I had to change my bundle identifier finally
No matter you reboot all devices and cleanup all , it gets stuck hard in the debugger..
don't know how to clear it..
As I experienced, device (or simulator) restart does solve the issue,
BUT it would be better not to couse it.
Also my experience is that:
You can find the place of crash by cousing it. In such time developers usually press "STOP the running scheme" this could cause zombie process stuck in device.
BUT
if you press "COUNTINUE program execution", debugger will terminate the process, it will not become a zombie.
I had this error too and I noticed that it works for me if you close the simulator and stop the program and then change your company name.
I don't know why but it works for me.
I opened Activity Monitor and searched for my app name, and found another instance of it listed. I used Activity Monitor to quit that instance, and the problem went away for me.

Resources