I have an issue when building for iOS in Xamarin Studio:
I open Xamarin Studio and create a Single Project View App for IOS, I then run the project, but the project does not load onto the simulator all I get is the message
"Waiting for the debugger to connect to the iOS Simulator".
I have xcode installed on the machine.
Does anyone know how to solve this issue?
Try launching XCode directly - often after an update XCode will require you to accept a new EULA before it will launch, which can prevent other apps from launching XCode (or its components) automatically.
Other options to fix this issue:
You could also try to Reset Content and Settings... on the actual simulator menu, then build again.
Re adding the simulator: Open Xcode > ⌘⇧2 to open Devices > Select the simulator device you are trying to use > Right click and delete it > Then add it again, bottom left + button.
If this doesnt work try checking for any errors in Console.app when building to the simulator.
I always ran into issues when there're different Xamarin versions on the MAC and the Windows PC. Also cleaning the solution, re-connecting the MAC and rebuild the project is always worth a try.
First of all open iOS Simulator after that clean your project solution and project, then run your project it works for me.
Related
Xcode 12.5 playgrounds don't seem to run any code at all, or display line by line outputs when ran. When I make a new playground, and click on any line of code to run, or try to run all the lines of code with the button at the bottom of the screen, I am shown in the top bar: "Build test (Playground): Succeeded" but there is no output in the command prompt, even when print statements are added, and there is no information in the side bar.
I've tried:
Restarting Xcode and rebooting my macbook
Stopping the simulator via the Activity monitor and restarting it
Opening up new tabs in an attempt to refresh
Uninstalling and reinstalling Xcode via the app store
Switching the playground settings for Platform from iOS to macOS
All to no avail.
I've tried opening other playgrounds from downloaded files (e.g. the swift tutorial from apple's website) and they all give me the same results, which is opening the code but not displaying any results in the side bar or running the code.
I'm currently on an M1 Macbook Pro 2020, with 8gb of RAM, as well as MacOS version 11.4
Here is a picture of what I see
Edit:
Changing whether the playground runs automatically does not affect the output of Xcode. Both automatic and manual result in not running any portion of the playground.
Swift Playgounds don't work for me if Xcode 12 was launched in the "Open using Rosetta" mode.
Solution:
Go to "Applications" folder -> Right click on the Xcode -> "Get Info" menu item
Unselect "Open using Rosetta" checkbox.
Close (Cmd+Q) Xcode and open it again. Next time it will be opened without Rosseta and playgrounds should work fine.
I was having this issue, changing in the Playground Setting in File inspector from iOS to macOS and you will have to use Foundation module instead of UIKit. I am using Xcode 12.5.1
Running Xcode 14.1 and macOS Ventura 13.0.1
Was struggling with this as well, fixed it:
Go to playground settings on the right side
Select macOS under platform
It's not perfect solution, but it works for now.
It seems like Xcode playgrounds seem to be completely broken (at least for my setup). For anyone else trying to learn swift that's experiencing this problem, instead of using playgrounds I created a new command line project in Xcode in order to run the Swift files. How to do this is outlined here: https://www.aidanf.net/learn-swift/running_code
Two causes to this that I have seen.
Xcode is opened with Rosetta checked.
The build tools are not selected in Preferences > Locations > Command Line Tools:.
I've had the build tools magically deselect themselves for some reason. Rosetta was selected to allow certain pod files to build when the Simulator is targeted on an M1 Mac.
Xcode should fire off an error if there are no dev tools selected, but for some reason it doesn't do that and just displays nothing in the console and no error message at the top of the screen as it does for other errors.
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.
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.
I am pulling my hair on this Issue . Actually I am developing first time IOS Application with the help of xamarin. I am creating this Application on MAC. The Hello world Application has been Created. I have take Referenced from Xamarin Hello World Tutorial . But I have not getting the IOS Simulator Option in devices drop down. It have only two option ,Ios Device and Default.For the simulator ,Is There need any Installation or something else.Please help me and any help will be Appreciated.
Does it find XCode in the right location? Check by clicking Xamarin Studio>Preferences>SDK Locations>Apple. If the Apple SDK was not found, you can manually specify XCode location path.
I had this problem because I was trying to create and use an iOS project using the "Unified API." I suggest not using this and sticking with the "Classic API." The former does not work (it won't build) if you want to use the simulator rather than a real device.
Are you not getting screen like below.???
go through below link , it may help you my friend..
http://docs.xamarin.com/guides/ios/getting_started/installation/mac/
I think you don't have iOS SDKs for your Xcode, usually it comes with the Xcode but if for some reasons you don't find it, simply follow the steps listed below:
Go to Finder > Applications > XCode (Right Click) > Show Package Content
A new finder window will open with Contents folder
Content > Developer > Platforms > iPhoneSimulator.platform > Developer > SDKs > Here you should get the list of *.sdk files
If there are no files then download the SDK file and paste it here, close the Xcode, Monotouch, and again Open it, you should find the iOS simulators in the dropdown.
You should be able to get the Xcode and SDk here
Please verify if you have installed Xcode correctly because it usually contains atleast 1 SDK
It was the Issue of xcode version.I have updated the version Now ots working fine.Thanks JAL.
select Debug-iPhoneSimulator option Image1
Right click on the project in your solution pane
select Run with iPhoneSimulator Image2
When I debug my Xamarin.iOS project from Visual Studio, it builds, installs on the simulator, and launches the app without issue. But on launching, I'm seeing a bunch of Debug tracing from a method that doesn't even exist in my C# code anymore. I can also set breakpoints on the class from which I removed the method at the same line numbers where this method used to be, and I will see the removed method in the call stack when the debugger stops.
I've closed and reopened Visual Studio, reset the connection to the Mac build server, cleaned and rebuilt my solution, and manually deleted the solution output. On the Mac, I've closed and reopened the simulator, and tried Reset Content and Settings, which does clear out the app. But the situation still persists, even after all that. Is there something else can I try on the Mac to make sure that all cached copies of old code have been deleted?
In your project folder delete the bin and obj folders. This works for me but is still annoying.
Check your Configuration Manager (the drop down with Debug, Release etc) and check that all the projects are being built. It usually unchecks all the projects you are working with for some unknown reason.
This means that it isn't rebuilding all the projects and it hence shows an old version.
As per your comment of rebuilding each project, this is a classic sign of the projects not being checked to be built on run and why you have to do it manually.
In the iOS Simulator (on the Mac) click the "Reset Contents and Settings" entry the main menu.
Well this worked with my Android project suffering from the same issue:
Right click on Android project then select "Properties".
Select "Android Options" then "Packaging".
Un-check the "Use Shared Runtime" options.
then it worked normally
I had a similar problem (though on an Android emulator).
What didn't work for me:
restarting the computer
restarting Visual Studio
deleting bin / obj folders
going into Configuration Manager (Debug / Release / Configuration Manager) and ticking everything there - everything was ticked
changing the version of the app in the manifest
What worked for me?
Uninstalling the app from the emulator and then running Debug again.
It was an Android emulator, so I uninstalled by clicking on the app icon and holidng for long, and then dragging it to "Uninstall App". On an iOS simulator it should be similar.
In my case I had to enable all architectures:
Android project properties
Andrid Oprions
Section Anvanced Tab
Select all architectures and rebuild
I still have this problem with iOS simulators. My solution:
Unload the iOS project
Reload the iOS project
Build as usual
I do the above when I change simulator device.