Build stops when running for the first time in a day and shows Restore the connection to "iPhone 5" and run "Quiz" again - ios

I am having a problem with my Xcode 6. Sometimes when I run in simulator the build stops after few minutes and shows:
Restore the connection to "iPhone 5" and run "Quiz" again, or if "Quiz" is still running, you can attach to it by selecting Debug > Attach to Process > Quiz.
This problem usually occurs when the app is running for the first time in a day. If I run again, it works perfectly.. I don't know what that problem was :(
Thank you..

As mentioned on my post in the dev forums and in the Xcode 6.1 release notes, this is unfortunately a known issues with the iOS Simulator.
3) "(Domain = FBSOpenApplicationErrorDomain, Code = 4)", "(Domain
NSPOSIXErrorDomain, Code = 3"),
"Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3", "Lost
Connection to ...", "Debugger disconnected", or app getting SIGKILLed
soon after launch
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

Xcode 8 simulator extremely slow

I am running Xcode 8 on macOS Sierra 10.12.2, and there seems to be a problem with running the simulator on my first "Hello World!" app (simulating iPhone 7 Plus). As you can see, I am very new at app development.
The simulator gets stuck at the loading bar with the Apple logo for about 10 to 15 minutes, and then gives me the message of "The operation couldn't be completed. (Mach error -308 - (ipc/mig) server died)".
I dug around the web and found solutions suggesting to go to Product > Clean in Xcode, also Simulator > Reset Content and Settings... in Simulator.
After which, the system gets stuck at the spinning clock for about 20 minutes and gives me the error message "Unable to contact local DTServiceHub to bless simulator connection" (solution I found online tells me to "Reset Content and Settings...")
I'm just really lost here because the error codes seems inconsistent in ways I cannot explain. Maybe it is my laptop? (Early 2011 MacBook Pro 15" 4GB ram, 2.2GHz Corei7)
Thank you in advance for your effort to help me.
On older/slower Macs the first run of an App on a simulator will be slow like this and an error often occurs:
The Apple logo bit is the simulator initialising (just like a real device when you cold start it) - just be patient and let it finish.
The error I suspect is something in XCode timing out due to be excessive delay. If this happens don't clean, just re-run: the simulator should not need to re-initialise so everything should be quicker and on my slow Mac setup the error does not tend to re-occur (unless I shut down or close the simulator - in which case I have to wait for it to re-initialise again!)
Helpfully you can manage without getting a new Mac :o)
I usually do this on Xcode 8.3.3.
Uncheck Debug->Optimize Rendering for Window Scale
Check again Debug->Optimize Rendering for Window Scale
It will work now
No Xcode simulator is not slow, It may be because slow animation is checked
Select Simulator
Debug Option and uncheck slow animation
That's work for me. Hope it works for you

calabash-ios physical device test, app starts but crashes

Running calabash-ios cucumber for simple iPhone app. Simulator is working perfectly. When trying on physical device, app loads, crashes, then loads again, and crashes again, on a loop.
Error message:
Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version
Calabash::Cucumber::Launcher::StartError: Time out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.
Logfile /var/folders/9s/yttj4cz93m98hqs6bfw2x8xr0000gn/T/run_loop20150522-12657-dr3m49/run_loop.out
2015-05-22 19:58:11 +0000 Fail: An error occurred while trying to run the script.
Instruments Trace Complete (Duration : 2.594758s; Output : /var/folders/9s/yttj4cz93m98hqs6bfw2x8xr0000gn/T/run_loop20150522-12657-dr3m49/trace.trace)
to run the script. UIAScriptAgentSignaledException
(Calabash::Cucumber::Launcher::StartError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:766:in `new_run_loop'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:631:in `relaunch'
Steps:
loaded app-cal on device
ran in command-line using:
$ DEVICE_TARGET=udid BUNDLE_ID=com.company.app DEVICE_ENDPOINT=http://ip:37265
Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError
The probably cause of this is that the device is not enabled for UIAutomation. The device must be enabled for development. A device is enabled for development if it appears in Xcode's Device's window (Shift + Command +2) and you must enable on-device testing manually by visiting the device's Settings.app > Developer tab.
If you have recently upgraded the iOS version we recommend that you check the UIAutomation settings again and perform a restart. Often, after an upgrade, Xcode cannot download debugging information from the device. Look at Xcode's Device's window. The device must appear without any warnings.
Sometimes devices get into a bad state and Xcode cannot communicate with it. We recommend trying to interact with the device with Apple's Instruments to clear this bad state.
All this information and more can be found on the Calabash iOS Hot Topics page. https://github.com/calabash/calabash-ios/wiki/Hot-Topics#6-errnoeintr-interrupted-system-call

App crashes before debugger can connect

I've got an app that crashes even before the debugger can connect.
I placed a break point on the first line of main(). (I added an NSLog statement as very first statement in main() and set the break point there.
The app seems to start. The main screen with some ui elements becomes visible on the screen. Then it disappears.
There is no crash log found on the devices.
Xcode message:
Could not launch "appname"
process launch failed: failed to get the task for process xyz
Debugging is enabled of course.
The same for the profiler Instruments.
Code signing works fine so that the app can be deployed to the devices.
(Same for enterprise distribution. And the app validates for store submission.)
It does work on the simulator though.
The app used to work fine. I was just about to build it for the store. For final tests on iOS 8.1 I upgraded to Xcode 6.1 with SDK 8.1. But the problem did not occur directly after the upgrade. It worked just fine.
Then it crashed when building for release for enterprise distribution.
The AppStore build crashed in the same manner (according to Apple, the app was rejected of course.)
But it ran nicely in debug modes.
Now I was trying whether compiler options for optimization may make all the difference and I was trying to build in release mode with debugging enabled etc and end up with a debug build crashing as well. (No optimization in debug).
So it may well be that the migration to Xcode 6.1 did cause it but the problem may have come effective only after Xcode cleaned and rebuild the project in response to changes to compiler settings for code optimization.
Sorry for the long text. I tried to put everything in that may be of importance.
Reason is most likely some incompatibility of Crackify and iOS 8.1.
Therefore it may be of interest for others, altough my problem along with these symptoms may be very special.
Very early within AppDelegate didFinishLaunchingWithOptions we have had the following statement.
if ([Crackify isCracked] || [self isCertificateUnvalid])
exit(173);
That, as such, is not really well designed. The app is just terminated rather than any error message displayed to the user. Thus, it appears as if the app has crashed. But it has not crashed and therefore no crashlog is provided.
For reasons which I don't yet understand and which may not be related to this error, my debugger did not manage to hook up into the executed app. Once that was overcome (suddenly the debugger worked without any changes made to any of the debugging related settings) the error was found rather quickly.
This is Crackify: https://github.com/itruf/crackify
Within Crackify it was this code sniplet that caused the problem:
static NSString *str2 = #"ResourceRules.plist";
BOOL fileExists3 = [manager fileExistsAtPath:([NSString stringWithFormat:#"%#/%#", bundlePath, str2])];
if (!fileExists3) {
return YES;
}
For reasons that I did not further investigate, the file, that is tested here, apparently does not exist in iOS 8.1 any more.

Simulator/device does not sync with iCloud

From time to time I'm getting errors that my iOS 8 device or simulator will sometimes not sync with iCloud (Drive). The following message appears (multiple times) in the output log:
CoreData: iCloud: Error: failed to receive initial sync notification
call back in 90 seconds
Only reinstalling the app helps.
Has anyone experienced the same issue or got some information about this?
I have seen that error (today) on an iPad running iOS 8. I fixed it by performing a reset (hold power and home/sleep buttons until the Apple logo appears). After that when I reran my app it synced immediately.
For the simulator it may be sufficient just to quit the simulator and relaunch. However, I have seen cases where restarting the computer was required.
I'm not sure what the cause of the issue is but hopefully the above help.

iOS app runs in simulator, ad-hoc distribution crash on launch

My iOS app runs correctly in the simulator and debugging device but when running on an ad-hoc allocated device, the app crashes and according to the app called "console" the app crashes with signal 9, killed 9 and also the app is killed with for termination assertion. I'm lost at this point as what to do. Let me know if you need more information.
Here's the link to the code: https://www.dropbox.com/s/ch48v8uiyx7wiqh/Animal.zip
Besides the other answers, which are good suggestions, a common root cause of this problem is that the Debug configuration can sometimes mask dangling pointer memory bugs. Do the following:
Run the app in the simulator with release configuration. If it crashes. . .
Use log statements and reruns to narrow in on the cause (debugger won't be available).

Resources