I cannot get the iPhone Simulator to run the current code. Instead it runs an old build. Does anyone know why?
The simulation starts and stops as usual, but somehow Xcode and Simulator have lost their connection. The Simulator ignores any changes in the code and Xcode ignores any breakpoints.
I have:
Deleted the app in the Simulator.
Reset content and settings in the Simulator.
Cleaned the project in Xcode.
Removed the project from Organizer.
Restarted Xcode and computer.
System info:
Xcode 6.0.1
iOS Simulator 8.0
OS X 10.10
If someone can tell me why this is happening I would be very thankful!
By the way, I can run the code on a device without problems.
Try to reset content and settings of the simulator. Like on the image:
Clean and rebuild the project also may help.
When I upgraded to Xcode 6.1 AND downloaded a new iOS 7.1 Simulator (available at Xcode/Preferences/Downloads) then it just started to work again. So, to upgrade or simply reinstall Xcode seems to solve this problem.
EDIT:
I recently got the same problem again, and I fixed it this time by going to Project Navigator/Targets/Build Settings/Build Locations. Changed the text of Build Products Path to something random, and changed it back again.
Sometimes, if you move your project folder around, it seems that Xcode loses track of its build folder. By doing this Xcode restore its build-path. So try this method first.
Related
While I am try to run an app in the iOS 10 simulator using xcode8 I get these alerts frequently. They randomly appear two at a time and it is not apparent what is triggering them.
Below is Image for Error I got.
I tried Following things.
Clean & Rebuild an app
Restart xcode & Simulator
Clear Derived Data & Rebuild application.
Even I was getting the same error. Issue in my case was I was working on xcode 7.3 and its simulator was open, later on I closed xcode 7 and opened xcode 8 and tried running app and got the above error.
I guess its happening because of both the simulator were open, it got solved when I closed my older simulator. Seem to be some problem while xcode 8 was trying to establish connection with simulator.
You just follow these steps to remove this error it's working fine in my side and i hope these steps work to you also just try it.
i)Remove multiple xcode versions.
ii)Quit all Xcode and simulators.
iii)Only one version you opened.
iv)Go to Xcode -> Preferences
v)Go to Location
vi) Set proper version for command line tools (your Xcode version)
vii)click on Derived Data
viii)Then go to Derived data and delete that folder. see below image
ix) Click on Simulator reset content settings and just quit xcode and simulator and open clear and build the xcode and run it.
Without deleting "Derived data" folder
The same rules as in the past apply to switching between Xcode 8 and
Xcode 9:
Quit Xcode, Instruments, Simulator.app, and Console
xcode-select the version you want to work with
Start the version of Xcode you want to use
If these steps don't resolve the problem for you, you can repeat the steps above > but after #2 add "sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService".
from this https://forums.developer.apple.com/thread/79301
The Same issue I have faced when I have two Xcode version, but the issue was when we are opening the two instances of simulator we will get the same error, the best way to solve this issue is run command
rm -rf ~/Library/Developer/Xcode/DerivedData
to remove the derived data.
None of the above worked for me.
Instead of choosing the simulator and hitting "run" i solved it by opening the simulator form "Open Developer Tool" menu first. After that all worked fine.
I had a similar issue, despite not launching a second instance of the simulator, due to using SimPholders and having the XCode Command Line Tools set to a different version of XCode. To resolve this, open up XCode preferences, and under the Locations tab ensure that the Command Line Tools version matches what version of XCode you're currently working in.
I had the similar issue shown in below screenshot.
Got it solved by closing Xcode 7 and its simulator.
It seems that when you are working on Xcode 8 and its simulator then Xcode 7 simulator should not remain open.
Below is screenshot of simulator state for Xcode 7 when you're working on Xcode 8.
In my case,
I was open a project a Xcode 8, and the emulator for this version, then open this project on Xcode 7.3.1, when I create an emulator it shows the alert.
My Solution: Close all version of Xcode => Clear Derived Data => Quit Xcode => Open Xcode => Choose File => Open Recent.
Force Quit.. Xcode and simulator. This kind of issue happned because maybe you are try to run more than one different version Xcode at same time.
I just had this issue when attempting to debug an iOS application from Xamarin, which uses Xcode to run apps in the simulator. I was initially targeting a 9.7" iPad Pro, attempted to change the simulated device to an iPad Air 2 (still on iOS 10), but the simulator didn't respond. After quitting and relaunching the simulator it appeared to load okay, so I changed back to the previous device - not sure whether changing devices actually did anything but I haven't seen the error message in the few times I've run my app since.
Solved it by closing all xcode and simulator. Don't ask me why. It was happening on the beta version for me
I had similar issue, what I did is I closed the simulator and all the Xcode and I went to the terminal and typed to see any Xcode application running then I killed it. I had one Xcode running in the background.
Command to see if Xcode is running,
ps -e | grep -i xcode
Use kill comment to kill any runing Xcode app, I used
kill -9 <pid>
The Same issue I have faced
in my case i stopped all applications and restarted my mac
and every thing is OK
Simple And fast Remedies..
1.Quit all xCode and reopen the xCode which you need to work...
I had this problem too, but I did below process it's working fine.
You have both Xcode 8.x.x and 9 running on your Mac, which causes the problem. Only run one Xcode at a time (Quit another Xcode, don't let another Xcode runing in background!).
This can occur when you have more than one version of Xcode installed on your computer. Make sure you QUIT (not just close) all versions of Xcode first.
Changing the device seems to have worked for me after doing the other stuff. Didn't have to restart my computer.
I was trying to run my project on Xcode, but I found that when I hit Command-R, Xcode would say the app had built, and was running, but after 3 minutes, it still hadn't appeared on the simulator. I ran it again, and it did the same thing, so I force-quit Xcode, and reloaded it. When I had reloaded Xcode, all the simulators had disappeared, and when I try to run the app on my phone, Xcode starts building, and then just stalls when processing one of the XIB files.
I have tried going to Windows->Devices to reinstall a simulator, but Xcode just freezes when I do this.
It seems I have royally screwed my developer environment by force-quitting while it was building. How can I fix this?
All help app-reciated.
Try to exit the simulator.
If this doesn't work try to restart the computer.
if none of them work you are screwed and should reinstall xcode
I fixes this by downloading the Xcode 7.2 beta. If you're viewing this question at a later date, download the newest beta of Xcode (or if you're using the beta, download the standard code). This version of Xcode is completely separate to the standard Xcode, allowing everything to run on normal settings.
First try and restart Xcode, then your computer. If this does not work, reinstall the newest version of Xcode from https://developer.apple.com/xcode/
I'm still new to Xcode, but I've recently run into an issue that has me stumped. As best as I can tell, right after I updated to 10.10.3, and to Xcode 6.3, any new projects I create don't have an iOS Simulators available. If I change the Deployment Target back to 8.2 (from 8.3), they are once again available. But as long as I leave it set to a deployment target of 8.3, I can only see "iOS Device" and no iOS Simulators are listed.
I've tried deleting and reinstalling Xcode, but I'm still ending up with the same results. Anyone else having this issue, and or know of a fix for this?
I had a similar problem as the original poster (Bill Matthews). On my MacPro (Early 09), but not my MacBookAir - both running 10.10.3 and newly installed Xcode 8.3 (over the beta 3 version) - I could not get any simulators to show up, irrespective of the iOS build target. (The temporary workaround was debugging on a real device, after selecting it from the "Product" menu -> "Destination"->"Ineligible Devices"->{my iPhone}.)
I tried deleting the simulators in ~/Library/Developer, but could not reinstall them; the Preferences->Downloads->Components would show them as installed/checked off, even after reboot, despite being deleted. Same result even after deleting the components folder and ~/Library/Caches/com.apple.dt.Xcode/Downloads and reboot. Same result even after deleting all of ~/Library/Developer, unlike Bill Matthews (Mazel Tov!).
In an abundance of caution, I reinstalled 10.10.3 from the combo updater (not AppStore), then Xcode 8.3 from developer.apple.com (not AppStore).
That did the trick for me. YMMV.
I actually had the same problem. If you are using fastlane the easiest way is to use the following command.
fastlane snapshot reset_simulators
I was able to see the latest simulators afterwards.
Problem: I cannot simulate an Apple watch interface. Whenever I try and test my Apple watch app on the iPhone 6 simulator, Xcode successfully finishes and builds the app, attempts at opening simulator and fails with an error message which reads 'Invalid Device State'.
I believe simulator has a watch simulator that opens along with the compatible iPhone simulator models that can communicate with Apple watch (example: iPhone 6) Although I have yet to see it work. I have built a universal interface for iPad and iPhone and another for the watch, so it's not a matter of the app being for the wrong device. Whenever I test on my actual iPhone I can test the universal interface successfully.
I'm using Xcode 6.2 on iMac OS X 10.10.3
I have tried restarting Xcode/Computer. I can't seem to find any other mention of 'Invalid Device State' anywhere, hopefully due to it being an obvious thing to avoid/fix that I've overlooked. Any help would be appreciated.
Force Quit xCode and restart will resolve problem.
I had come across this issue after updating Xcode 6.4 to 7.1.
Below are fixes for this :
Clean project (cmd+shift+k) as well as clean build folder
(cmd+shift+k+option)
Quit simulator and run again
Quit Xcode and Simulator and run again
Restart your Mac.
Solution 3 worked for me!
I had the same issue. Generally it is because you just update Xcode or change its name in the Applications folder.
If you just restart your computer it will work correctly.
Hope it helps !
I observed this happening when more than one Xcode app installed.
To fix this,
Launch Xcode and click preference..,
Go to "Location" Tab, Select correct options from "Command Line Tools" dropdown
Quit Xcode and relaunch it.
Run your app.
First of all, just clean the project.
Quit your project.
Quit your Xcode.
Restart Xcode.
This happens to me when I have two different Xcode versions running at the same time. Hopefully this helps you.
No need to quit, restart or even re-install. Switch to another iOS Simulator device (6s if you were using 6s plus) and voila!
Nothing worked for me on XCode 7.3.1.
Had to reinstall it to make the simulator work.
Go to applications folder. Drag drop XCode to Dustbin.
Empty dustbin contents.
Go to App Store and install XCode.
Run XCode. The simulator should work now.
I have Xcode 7.3 and Xcode 8.0 Installed.
If a am working with Xcode7.3 and opens Xcode8.0 to get some code from Xcode8.0 project.
When i run my application on Xcode7.3 So it will give me same error.
Solution is simple ForceQuit or Quit all Xcode's and open the required one.
In my case, the simulator would show an indefinite black screen whether attempting to run a project, or running the simulator directly (which should bring you to the simulated home screen). This would happen even on a newly created simulated device.
After the existing suggestions failed, the following worked for me:
Delete the Simulator
Delete XCode
Delete the Developer folder
Reinstall XCode from the app store. This requires attempting to run XCode again so that Mac OS will realize it's no longer installed.
Jus clean the project and restart Xcode. This happens to me when I have two diffent xcode versions running at the same time.
Robust fix is Just Quit your xcode and run again, hope so it will help you. This heck work for me.
On M1 Mac I've found more than 3 open simulators can cause this error. Quit the simulator app to fix this error.
I am pretty sure that in my case the simulator was corrupt after a failed language change.
Following this answer to reset the simulator worked.
How do you correctly use Application Data bundles in Xcode 6? I exported a .xcappdata file from a device, added it to my workspace, and selected it in the Run Options of a scheme.
Whenever I try to run the simulator with iOS 8.0, I get the following error, even on repeated launches, manual launches, etc:
Application data package not copied to the Simulator
It appears you are running 'REDACTED.app' on the iPad Air Simulator for
the first time, and therefore do not yet have a data folder created.
The application data package will be installed the next time you run
your app in the Simulator.
Trying to use the simulator with iOS 7.1 crashes Xcode.
Does this feature just not work anymore with the changes made to the filesystem?
Tried again on Xcode Version 6.1.1 (6A2008a) and it (sometimes) crashes Xcode now, hopefully that means it will be get fixed soon...
I'm using Xcode 8.1 and when I tried to add the .xcappdata file Xcode crashed.
I solved it by cleaning the app and then I tried to add it in another target and it worked. Afterwards I tried to put it again in the target I wanted it in and it worked as well.
Unfortunately I'm not sure about which of these steps fixed it but I hope it to be useful to someone!
You can try to clean the Derived Data which contains all the intermediate build information like debug- and release-built targets. And you probably can select the Simulator, choose the iOS Simulator from the menu. Then, choose Reset Content and Setting.
Sometimes, it's just some bugs in the XCode. And I think Apple is handling that when your issue is marked by duplicate by them.