Can't stop Xcode app execution in simulator? - ios

Has anyone seen this before? Ever since I upgraded to Xcode 4.5.2, sometimes when I press Command-R to run an app in the simulator, the status in Xcode says "Running", but the app never starts in the simulator. When I press Command-., it says it is trying to stop, but never stops. Xcode basically is hung, I have to force quit. Hopefully there is a simple solution?

Try opening the simulator and deleting the application. Also try closing and re opening xcode. If this does not try restarting your computer. If you are still having the problem then you will have to uninstall xcode and reinstall it. (I have had that problem multiple times)

Strange, but works. Click on the 'iOS Simulator' icon in the Dock (https://stackoverflow.com/a/10277189/1514970).

This tends to work. I use Serge's find to click the icon in the dock - this then "wakes up" XCode to the fact that it needs to attach to the app in the simulator. Even though the attach never happens, a Command-Period at this point stops XCode without hanging it and having to do a Force Quit. Then, I can close down the Simulator, and do Command-R to run from XCode. This relaunches the simulator and attaches to the app process.

Related

Keyboard gets stuck in ios 13 simulator

I have been trying to make my project work with the new Xcode 11. Everything works smoothly, except on several occasions when I run my app on the simulator (iPhone 11 Pro Max), the app freezes after I click on EditTexts. This happens after a few times I have used the app. If I clear the simulator memory and restart everything works normally.
I created a view controller with just the EditText and am able to replicate the simulator freezing. Sometimes it freezes before launching the soft keypad, sometimes after it has been displayed. I am still able to kill the app and rerun it through Xcode but it freezes every time unless I do hardware reset on simulator.
I am just concerned if this would happen on the device too? Has anyone faced this?
Edit: Just to add. When this happens, I try to use the messaging app and the same thing happens there.
Same problem on Xcode 11.0 and simulator with iOS 13/iPhone 11.
For me, the workaround of disable "automatically paste" don't work.
The only way is to restart simulator.
This thread is open on Apple Forum [https://forums.developer.apple.com/thread/122972]
The only fortunate solutions is to restart the simulator.
I had the same problem. Apparently it's a bug on the Simulator. Hopefully it will be solved soon, but until then, you can fix by unchecking the pasteboard option.
Simulator -> Edit -> Automatically Sync Pasteboard.
From this helpful answer here.
This is happening to me as well. This is a bug with the current release of Simulator.
When i click on textfield, app freeze and stop working. This problem still exists on Xcode 11.1 The solution is:
"Hardware -> Restart"
Then running normally. Try this.
Force quit the simulator and restart again works for me.
Same happens even in built-in apps on iOS 13 Simulator in the moment when you about to start typing :facepalm: Initially I thought that happened because I included new framework and had no clues what's going on but then found this :)
Please do not change your code it's not your code issue, its simulator bug.... So try to restart the simulator or stop the application and run again.
It will work fine on your device.
On Mac Catalina with Xcode 11.4 I tried this:
From simulator, toolbar choose I/O then Keyboard then Toggle Software Keyboard
Or
Simply hit Command + K while cursor placed in text Field.
Also have the same problem. When I restarted the simulator after it got stuck it haven't happened again. Seems like it is a simulator bug and not an app issue - https://forums.developer.apple.com/thread/122972
Its happening when pickerView appears as well, unfortunately have to restart simultor again.
If your are working on the iOS Simulator than simpley Restart your simulator & * Kill the Metro *
and run the react-native run-ios again.

How can I make sure that the iPhone simulator in Xcode will move past the the startup screen every time I use it?

When I run the iPhone simulator, sometimes it doesn't move past the opening screen, and sometimes it does.
What I am calling the opening screen is the screen which has the app tittle on it.
I have tried closing and re-opening it. But it doesn't seem to solve the problem, as it still comes back.
I am using the new Xcode beta but this problem also happens to me often in Xcode 6.
The simulator in my opinion is a little buggy to me. This seems to happen to me a lot the first time I run the simulator. After that it seems a little more stable.
This happens to me too sometimes. Simply stop and directly press the "Run" button again.
You can also try to change the Device or uninstall your app on the selected device.
Also try to close the Simulator and open it again and try to run your app after that
My answer is you cannot make sure about that, since it is just a simulator.
This happen to me to when i use xcode6 sometimes, but when i use xcode 5.1.1 it is working perfectly.
I think xcode6 do not stop the current running app before running the other instead it just override the current "same" running app. here is my theory as i observe it.
Assuming simulator is running.
in XCode 5.1.1:
Stops the currently running app > Compile > Run
but in XCode 6:
Compile > Override the same running app
But you dont want to worry about that so much, as long as it doesn't appear in actual device it is all good.

Hello World causes Iphone 5s to freeze

I recently began going through the official Apple documentation and tutorials to learn iPhone development. I got my Iphone 5s a couple of days ago, but the sample ToDo list app that I'm making causes the device to lock up randomly when I try to test on the device. For example, I if I make a chance to the code and build/run it on the device, it will work. However, as I keep updating the code and testing it, eventually it will just open up my app on the device as a complete black screen, and freezes. The home button then no longer works, no touch events work, the only think I can do is to hold Home+lock button until the device shuts down.
This cannot be normal, can it? I mean, its just a basic app, what could be causing it?
Attached is the error that shows in xcode, and also a screenshot of the Iphone when it its frozen. Surprisingly, I was able to use the screenshot functionality on the phone... :/
Please check whether you are using a distribution provisioning profile/certificate to sign the app. If you plan to debug the app on the device (use breakpoints etc.), you should sign it with a development provisioning profile.
It only happens sometimes, so it's not provisioning related.
It causes a message to popup in XCode itself, so it's not code related.
I had the same problems before (not that often really...). What I did was
Restart the device
Remove the app from the device
Clear the project builds (CMD SHIFT K)
Restart XCode.
Build & Run again
I actually haven't seen this for a while. I always thought that they fixed the bug. Hope this helps!

Xcode 4.3.2, issue with running on simulator

I have been having this weird problem with Xcode 4.3.2, of course after the recent update.
After successfully building and running on the simulator several times, xcode seems to not be able to connect to the simulator and can't even stop the project; it's like the simulator does not exist. I have tried:
Stopping the project – doesn't work.
Quitting the simulator – doesn't work, xcode still shows it's running on the simulator even when I quit the simulator.
Cleaning the project – doesn't work.
I have to force quit xcode to get it communicate with the simulator. Nothing else works. It gets quite frustrating to do it every half an hour. This only started with 4.3.2.
I always stop before building and running, so it is not an issue of simulator/xcode getting thrashed by me.
Any suggestions?
I have found by chance, it is not a solution by any means -
When xcode hangs, saying it is running the app, but nothing is on simulator, opening the simulator from the dock by clicking on the dock icon (not using command+tab) seems to work.
It is very weird,but it works; atelast till xcode fixes it.
I had the same damn issue on XCode 4.5.1, but I resolved it just now.
When the program is running, it gets compiled but doesn't show anything on the simulator. just click on iOS Simulator icon in dock in order to bring it to front. Click iOS Simulator on top left -> Reset content and settings -> then force quit the iOS Simulator and run the program again. !!
Besides a restart, there is one other way I've managed to get around this:
Let's say your app hangs, go to the targets selector in the top of the Xcode window and change your sim target to a new SDK (or if you don't have another SDK, change it to a universal app and run on the opposite device simulator).
Then, when your app loads on the new device/OS completely, quit the sim, change your targets back, et voilà!
Uninstall application from Simulator and again run. Then it will works fine :)
This has frustrated me for -years- now but stumbled across what appears to get things going again for me:
Hide the simulator (iOS Simulator -> Hide iOS Simulator) or Cmd-H, then reopen the simulator.
The problem seems to happen when something CPU intensive is happening in the background (like a Time Machine backup) on my old 2 core MacBook.
Xcode 4.6.3 update (June 13, 2013) resolves the following issue:
Hang when debugging in iOS Simulator on OS X 10.8.4. 13722320
https://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-Xcode/
You can try to update your Xcode to see if that works for you..

IOS simulator problem app only runs when started for the second time..

My app runs fine on my physical device (iphone 4), it also runs fine on the IOS simulator, but only after the second time I ty to run it from Xcode.
So the sequence in which things are happening is:
IOS simulator closed.
I press "ctrl R" in XCode
IOS simulator starts, app starts but gets no further then the splash screen (does
not crash it just sits at the splash screen)
I press the stop Button in Xcode (app stops running in Simulator)
I Press "ctrl R" again
App starts in IOS simulator and runs like a charm..
If I close the IOS simulator reopen open it from finder and run the installed version, it runs without problems.
Two questions,
has anyone had a similar experience?
am I in trouble when submitting my app to the appStore
Thnx, Sebastian
The problem went away when I removed the majority of my logging messages (I had ton's of them). So either there was an issue with one of the messages or it had to do with the amount of them , hope this helps anyone who experiences the same problems.

Resources