iOS Unable to run app in simulator Xcode 6.1(6A1052d) - ios

We are buiding an iOS applicaiton in Swift. The XCode we are using is Xcode 6.1(6A1052d).
Our issue is when we run the app in Simulator (5, 5s, 6) the app is not running in the sumulator.
It is giving an error.
Unable to run app in simulator.
An error was encountered while running(Domain = NSPOSIXErrorDomain, Code = 3)
We tried clean & build, delete caches, restart xcode etc. But not worked. We have one other machine with same XCode version. On that machine it works fine.
Any clues?
Tried the solutions given in Xcode6 can't run any app in simulator ( Domain = NSPOSIXErrorDomain, Code = 3 ). But not worked.

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

Related

iPhone 7 device logs won't show up in the debugger in Xcode

When building and running my app from Xcode on our iPhone 7's, I can't get the logs to show up in the debugging area. I've tested both mine and my wife's iPhone 7's. It's completely blank. They show up for other devices (iPhone 5, iPad, etc.) and for the simulators but not for the 7's.
When I view logs in Window > Devices > (select device), or in the system's Console, I also don't see logs for my app. There's only references to the app from symptomsd, etc. But no process even appears with my apps name.
It seems there is some incompatibility between my app and these specific devices. I've been using and updating the same app since around 2012 so maybe there is some sort of cruft in there that is blocking logs on these very latest devices.
Things I've tried:
Building and running other apps (logs show up)
Testing other devices (logs show)
Re-powering iPhone and restarting Xcode
Setting a breakpoint and running a command in the debugger (I got response from that command)
Any other steps to try would be appreciated.
You can use alsodump to log. You may try this, maybe this one works. What may help you:
1. Create new building scheme.
2. Try running it on simulator. Use many iOS versions. Maybe the latest one have a bug.
3. Remove Derived data in this project.

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

Why does XCode (4.5.1, Lion) require an internet connection to connect to iOS simulator?

I am developing an ios app that doesn't need an internet connection. I'm using phonegap and jquery-mobile. I'd like to develop offline, but XCode gets stuck with a status saying 'Attaching to iosproj' (iosproj is my project name). After that I cannot stop the stuck task, and have to force-quit XCode. With an internet connection however, everything works just fine. Grateful for any clues.
Edit: XCode seems to install the app fine without a network, but it gets stuck before/durimg receiving the deviceready event.
Update 1: The app runs fine on the simulator with or without the n/w. It is purely the XCode-iOS simulator interaction.
Update 2: When using phonegap (Apache cordova), there's an easy work-around to work offline. Once the project has been built and installed (with a n/w), all subsequent updates to html/js/css/img can be made directly to the www directory in the simulator's Library (under your app folder, in ~/Library/Application Support/iPhone Simulator/6.0/Applications).
The Simulator itself attempts to make an Internet connection to Apple as it launches. In particular, the itunesstored process attempts to connect to ax.init.itunes.apple.com and phobos.apple.com.
[That information comes from LittleSnitch. You would be well advised to install LittleSnitch so that you can be sure of exactly what connection is being attempted here. No one - certainly no developer - should be without it.]
If you find this troublesome (that is, if the connection failure is causing you to be unable to run your app in the Simulator at all) you should file a bug report with Apple. However, I've had no difficulty with this, so perhaps this an Xcode bug. I'd suggest first updating to Xcode 4.5.2 in case it is fixed there.

Unable to run app on iPhone simulator suddenly

My app has been running fine on iPhone simulator. I have hit an issue (discussed here: Intermittent error accessing core data model / contacts database) and now all of a sudden, it won't build and run on iPhone simulator. I have the following error:
Couldn't register com.yourcompany.XXX 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.(lldb)
Any thoughts? I have tried totally closing and resetting iPS as well as deleting the app and reinstalling but to no avail.
Very frustrating!!!
Reset your iphone simulator and clean up your xcode project.
Type
apple-alt-shift-k
in xcode.
It happens quite a lot for me, especially during frequent restarts of the simulated app. I tracked it down to (at least sometimes) a race condition or deadlock when the simulated app is shutting down and a new one is starting up.
Quitting the simulator usually work
If that does not help, restart Xcode
Sometimes processes may linger and restarting the Mac is ususally the quickest way to recover (although clever use of the killall command can salvage the situation if it is really inconvenient to restart).
Quit the iPhone simulator and run it again.
Quit the simulator and xcode.Also delete the app from your simulator.... and if it does not work goto target setting and change something like name of app in bundle identifier . and it should work
You are using Core Data. So its possible you changed the dataModel and NSManagedObject class is changed. So it will crash until you delete application from simulator and run your project again..

Why does my app work in the simulator but get stuck on the splash screen when I run it on my iPhone?

My app runs fine on the simulator. However, when I run it on my iPhone, it gets as far as displaying the splash screen and then just stays there. It's an iPhone 3GS and the software version is 5.0.1. That's what happens when Debugger = None. When Debugger = GDB, I get an error message, 'Thread 1: Program received signal: "SIGABRT"', which I have learned can mean almost anything. I'm running Xcode 4.2.1.
I'm coming off a long hard night of battling with this error message, which appeared seemingly out of nowhere in a stable mature app. I tried to roll back with time machine, I deleted the Derived data for my project in Organizer a few times and did some of the other stuff recommended in this thread.
XCode 4 hangs at "Attaching to (app name)"
It got ugly. For a while, I couldn't even reboot my machine. Eventually, I was able to relaunch finder and suddenly the Simulator was working again. Two more pieces of information, I used to have to click allow in two dialog boxes when running on my phone but now it's only one (the one about code signing, I forget what the other one was about). Second, I find all the build architecture target stuff confusing but I set all my Base SDKs to be latest iOS. Lastly, I tried Product --> Clean and then Build but that didn't fix it. As you may have gathered, I'm getting my butt kicked. Any help would be much appreciated.
Dessie
Many times I have experienced Xcode going "crazy" with a physical device connected. At times I saw the behavior you describes; other the app simply refused to start;
In all of those cases, I could fixed it in either of two ways:
disconnect the iphone and connect it again;
reboot the device.
This is a very common problem that is easily fixable.
1) remove the app from the device
2) reboot the device
3) close Xcode and you must restart, logging out will not work

Resources