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

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.

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.

When I try to run the Xcode simulator I get the error 'Stop “(null)”?'

I just updated to Xcode 7 and ran an app on a live device. Now for some reason, I get an error when I try to run an app in a simulator.
Stop “(null)”?
An instance of “(null)” is already running. Choose “Stop” to terminate and launch a new instance.
When I press the stop button it grays out, as in the screen shot, but nothing happens. I have tried resetting the content and settings on the simulator, but that didn't help.
Getting this as well with Xcode 7.
I've been following these simple steps to avoid seeing the error:
Build your app.
Run your app.
Annoying, and not a solution, but I think this is a bug within Xcode 7.
Completely quitting Xcode 7 and reloading resolved the simulator is already running it for me.
I got this error too, and building and then running the app (cmd+b ; cmd+r) solved the problem.
TL;DR: This is a recurring error in XCode 7 with no known solution. To get rid of it, disconnect your device, then reconnect and carry about your day. If running the simulator, kill it, then restart it. Hopefully Apple addresses this soon.
When you get like this stop (CMD+.)the stop the project.
->Quit Xcode
->Clean the project (CMD+Shift+K)
->Build the project(CMD+B)
->Run the project(CMD+R)
If you are running on an actual device, I found that by disconnecting the device (iphone) from the computer/laptop and reconnecting eliminates this error/issue.
However, I still see in xcode the following message:
running <app name> on <phone name>
But at least I do not need to quit xcode.
I did not have this when running on a simulator (always testing on a real device...)
I suggest building your app and then cleaning it. For me, this ensured that later on I could just run the application.

Restore the connection to iPhone and run watchkitextension again

I am using Xcode 6.3 and I keep getting the following message even if my phone and watch are both connected (and not locked):
Restore the connection to "mm24’s iPhone" and run
"com.projectname.watchkitextension" again, or if
"com.projectname.watchkitextension" is still running, you can attach
to it by selecting Debug > Attach to Process >
com.projectname.watchkitextension.
Even if I reset Xcode, Watch or phone I still get the above. The app seems to install on the devices but the connection with Xcode is not there.
Any suggestion on how to fix this?
I was running into this issue as well and it seems like I was able to solve it by removing the armv7 attribute of Valid Architectures on the WatchKitApp target And the WatchKit extension target.
See this apple forum post for more info on it.
This was driving me crazy for about a day and half, but seems to consistently let me build onto my watch for the last 2 hours.

FBSOpenApplicationErrorDomain code =4 error

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.

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