iOS 9.0, Xamarin Studio, "waiting for debugger to connect..." - xamarin

I have been using Xamarin.iOS platform with iPad with iOS 8.3 simulator successfully until I have updated Xcode 7 with iOS 9.0. When I select the simulator and run it, it keeps showing
waiting for debugger to connect...
nothing comes out at the end. Any solution?
By the way, why I cannot able to see ios 8 simulator options in the Xamarin after I updated the Xcode?

Was having the same issue. Here is what helped me. Open up xcode go to Devices under Window menu. Select the simulator device you are trying to use. Right click and delete it. Then add it again, bottom left + button. Hope this helps.

To solve this issue, follow these steps:
Open XCode and go to Locations options under the Preferences menu
Xcode > Preferences > Locations
Check command line tools is selected. If not, select from the available list and close the window.
Try to debug the iOS app from Visual Studio again.

I am sorry to say that but it is because of trash in debug/obj folders, I think. You can simply clean and rebuild the project.

Make sure that you have added a provisioning profile to you project.
Info.plist -> Signing -> Automatic Provisioning -> Select yours
I had the same problem and it was solved with this.

For anyone not using an emulator but using an iOS physical device, try updating your software on the device to the latest version. Give Visual Studio a restart, clean, and then build.

Related

The selected ios device is not supported for creating an archive

I'm trying to setup new MacBook as a build server remotely for xamarin projects. It is in my office and I connect there with rdp from Windows 10 from home.
On MacBook: installed Xcode, Apple Developer Tools, Transporter. On windows: connected to mac, entered AppleID in visual Studio, enabled Automatic Provisioning.
Then I build my Xamarin.Forms ios project in "AppStore" configuration and it's ok.
Then I click "Archive" on that project and get error message from Visual Studio Archive Manager:
Selected device doesn't support archiving.
The selected ios device is not supported for creating an archive.
Please select a remote device from the drop-down menu before archiving.
Do I have to have iPhone to build my app? Where - in MacBook location or at home?
Archiving of a new default project works in Xcode (the active scheme is set to "Any iOS device (arm64)"). The error is in visual studio.
Visual Studio 2019 - (16.11.2)
XCode 12.5.1
There is a new version that fixes this
It seems that remote device option does not show in drop menu in VS 16.11 .
Check the similar cases : here and here .
Try to downgrade Visual studio to 16.10.x to see if problem persists.
You can download the older version from this link .
You don't need a physical device to archive. Just click the bar on the top-left of your screen, then select the Any iOS Device option. On older versions of Xcode, I think it was called Generic iOS Device. After this, hit Product -> Archive again.
It looks like Microsoft have finally released a fix for this in 16.11.3: The release notes are here:
https://learn.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.11.3
The solution in 2022 is to choose "Remote Device" from the "Debug" dropdown:
This is hinted at in the question, but that error message no longer explains what to do (!?!)

Can't run a Xamarin App in iPhone Simulator from Visual Studio For Mac

In short: I am unable to run my app in the iPhone Simulator. There is no "Play button" (the triangle), only a Debugger button (hammer):
As you can see above I have "Generic Simulator". When I click on it, there is no list of various iPhones/iPads to choose from:
If I choose Android, I am able to run the app:
I have XCode installed. I ran XCode once.
I also installed the Command Line tools.
I created a new Xamarin Forms App:
Here are my iOS build options:
I am able to run the Simulator separately:
Creating an App in XCode and running in the Simulator works:
info.plist:
Prefrences -> SDK Locations -> Apple
Build -> Configurations:
Here is the kicker though. If I run a Xamarin App on my Windows machine using the iPhone Simulator on the Mac, it works!
What do I need to do so I can run my app inside the Simulator vis Visual Studio for Mac?
Few options you can worth to check. #WorldOfBasti suggested options plus following.
Configuration
Right click on the solution -> options -> Configurations -> Configuration manager -> ProjectName.iOS with Debug|iPhoneSimulator should be checked or if configuration "ProjectName.iOS with Debug|iPhoneSimulator" is not available then add this from General tab
Apple SDK path
Check Apple SDK path is set properly (Preference -> SDK Location -> Apple). It should have green tick mark with Xcode version and SDK path location.
Minimum system version (Deployment Target)
Change Deployment Target to minimum version (ie, lower than your simulator version)
Switch debug <-> release
Today I have also faced same issue which you are facing. I have switched debug to release, iOS to Android. Then reverted back to iOS and debug from the top device selection status bar. Then Simulator option was appearing. So, might be UI updated issue in Visual studio for mac. Please give a try.
I assume that you tried the basics things like restarting your Mac, etc. So here are a few things, that might solve your problem:
Check your build configurations, here is a good video
Close VS for Mac, start Xcode and create a test project which you run on a simulator. If it works try again in VS for Mac
Close VS for Mac, goto Xcode -> Preferences -> Accounts and download the manual profiles of your developer account. Try again in VS for Mac
Clean your project: In VS for Mac, goto Build -> Clean All. Then Close VS for Mac, goto your project folder and delete in "yourprojectname" and "yourprojectname".iOS all bin and obj folders. Try again
If all of this doesn't work, I would try to reinstall it (if you have any important projects, make a backup):
Uninstall VS for Mac and Xcode
Install Xcode again from the App Store
Install Visual Studio for Mac
Hopefully it works..
Looking at the Visual Studio for Mac logs, specifically the IDE log, I found this line ... 'The target name of simulated device could not be added because it's already cached'.
You are welcome to read through all of this ... but you may just want to go down to the Addendum 2 (final?) and see if that works for you ... it ends up being simpler and quicker than anything else I have found.
So, at first, I started clearing the cache with a 'xcrun simctl erase all' command from Terminal, and when I started Visual Studio for Mac I could run a Xamarin App, but launching the simulator took quite a bit of time.
So hare's something I found works that you might want to try ...
Close iOS Simulator on Mac (if any).
Close ALL copies of Visual Studio that are connected to the Mac ... either on the Mac itself or on another computer connected to the Mac (if any).
Start Visual Studio for Mac.
If you can't run a Xamarin App, Close Visual Studio for Mac.
Launch the Simulator manually (I have it in the Dock, so I just click it) ... wait for it to fully startup.
Now close the Simulator (from the Simulator menu).
Now restart Visual Studio for Mac.
If you still can't see the simulator devices to run on ... try the above steps one more time (this time you should only have to close Visual Studio for Mac followed by manually starting the Simulator, waiting for it to start, and then quitting the Simulator and finally restarting Visual Studio for Mac).
It still isn't great, but this has (so far) always worked for me. And the Simulator starts up substantially quicker then if I did a 'xcrun simctl erase all' command from Terminal.
Addendum: Most of the time the above works. But occasionally I still have to clear the cache from the Terminal with 'xcrun simctl erase all' command.
Also: I have also found (although maybe it's just my imagination) that clearing out the Visual Studio for Mac temporary .binlog files that are written in the 'T' folder will sometimes fix the problem (if you look at an IDE log from Visual Studio for Mac; right after the 'The target name of simulated device could not be added because it's already cached' message, you should see some .tmp files being created. The directory where they were created is the 'T' folder I'm talking about). I sometimes delete the tmp*.binlog and tmp*.tmp as a last ditch effort before using the 'xcrun simctl erase all' command to try to get back to where Visual Studio for Mac will see the iOS Simulator Devices.
Finally: This is really starting to feel like a bug in Visual Studio for Mac startup (or possibly during a iOS project load). The reason I say that is I can ALWAYS see the iOS Device list from Visual Studio for Windows (as long as I can connect to the Mac). In addition, I can leave Visual Studio for Mac running (even hidden) and test an app on the iOS Simulator from Windows, then, leaving the iOS Simulator Running on the Mac, run an App on Visual Studio for Mac. If there really were a 'caching issue' with the Simulator it seems to me I should have problems running anything on the Mac after using the iOS Simulator from Windows, but it always works. For now, I'm working on a single Xamarin Project on the Mac (and I don't use the Mac for anything else), So I just let Visual Studio for Mac 'open at login' (Dock setting) and automatically 'load previous solution on startup' (Visual Studio for Mac setting), hide Visual Studio for Mac (Dock Setting) and if I need it, Visual Studio for Mac is already loaded and able to see iOS Devices to run Apps on with a quick click on the Dock Icon.
Addendum 2 (final?): I have now found that if I just close a solution that I have open that shows 'Generic Simulator' and re-open it without exiting Visual Studio for Mac (sometimes I have to do it multiple times ... I think I've counted up to 5 times before it finally worked), it will start showing the device list and I can run the iOS app in the Simulator. I don't even have to close the Simulator if it's already running, which saves a bunch of time.
It still feels like a bug to me, I don't see why I would have to close/open a solution multiple times to get the iOS devices listed and be able to run an iOS app. What really gets me is if I reboot the Mac, don't open the Simulator and start Visual Studio for Mac, then open a solution, I still have to go through the close/re-open solution steps... sometimes more than once. The simulator is not set to auto start or anything like that. But, at least, it's getting simpler, and takes less time, to get to a point where I can run an iOS app.

Mac Visual Studio 8.2.6.26 update not showing any iOS simulators, only Generic Simulator

Yesterday I updated my Visual Studio and Xcode. Immediately afterward I lost any listing of available iOS simulators for my Xamarin project in Visual Studio. I can plug my iPhone in however and deploy my project onto it just fine, but I'm used to working with Preview in VS and also running a simulator for quicker response.
I'm currently running the following versions:
• Updated to Xcode 11 (11A420a)
• Visual Studio Mac 8.2.6.26
• Mac OS 10.14.6
• iOS 13.0 on iPhone 7+
Now Visual Studio shows the only available simulator as being the Generic Simulator with a hammer, which doesn't launch anything that I can tell. When I look at the list to choose a simulator I see the message line: "Lower the 'Deployment Target' to see older simulators or check your Apple SDK path"
When I launch a test project directly from within Xcode, it offers iPhone 8, 8+, 11, 11 Pro and others as available simulators and those indeed work. In Visual Studio I have changed each Deployment Target from 6.0 to 12.2 and not one of those makes available any simulators.
I'm not sure what the Apple SDK path is about, how to check it and where it needs to be pointing.
Does anyone have any thoughts about what adjustments need to be made to regain my iOS simulators in Visual Studio Mac again after these updates?
Thanks so much :)
After trying a bunch of suggestions, this simple fix worked for me. First I changed my deployment target in the info.plist from 9.3 to 11. After checking that my Apple SDK path in VS was pointing at Xcode11 and the iOS SDK version on my Mac was 13.0, I simply force quit Visual Studio and Restarted my computer. Then I began to see iPhone8 & iPhone11 simulators. Goodluck.
Updating both XCode and Visual Studio for Mac worked for me.
Just updating XCode did not work.
I also fidgeted with the Deployment Target which I believe refreshed the simulators list.
UPDATE: I confirm again that when I go to info.plist and just click on the deployment target drop down, the simulators list gets update. Little funny.
Ran into this issue many times for the last updates. Nothing really helped, until I came across a Microsoft forum where someone mentioned the Apple SDK path needs a trailing slash, which is not added when using the Browse button to navigate to the Apple SDK Location.
So when using Visual Studio for Mac, navigate to Visual Studio -> Preferences -> Projects -> SDK Locations -> Apple and please note your Apple SDK Location should be something like:
/Applications/Xcode.app/
rather than
/Applications/Xcode.app
Changing the "Minimum System Version" did the trick for me.
Eg. I had 14.4 and I changed it to 14.0 and restart VS the all the simulators appreared.
I resolved the issue as well by going under the Visual Studio --> Check for Updates menu and switching the channel to "Xcode 11 Previews". Finally some updates were available and I updated everything normally. I also updated everything in the "Stable" and "Preview" channels as well. Now I have iPhone 8 and iPhone 11 simulators working, however I no longer have any of the other simulators like iPhone 7, etc. like I did before.
After updating Xcode via the app store, restart your machine. The simulators should reappear.
UPDATE
This didn't work for me after the latest update. However, setting the startup project to Android, then switching back to iOS was enough to repopulate the list for me after restarting my machine.
info.plist has an option called Minimum supported version which says which version of the iOS you are targeting.
in my case it was 10.3 earlier, when i have upgraded xcode (12.4) and vs for mac(8.9.6) to support iOS14. this caused the conflict between the xcode supported iOS version and plist version.
I changed it to 14 in plist for the Minimum supported version and it worked for me.
In summary check the xcode supported version and update the minimum supported version accordingly
Same here, just need to change 'Minimum system version' on your info.plist file in my case was 12.0 and then updated to 12.1 and vualaaaaa the simulator list refresh it.
I had the same problem when the iOS 14 updates were first installed. I had already installed both XCode and VS updates.
What I did is: I restarted the Mac and I had to install the XCode Command-line tools from VS separately. Then the simulators were visible.
What always works for me is connecting an iPhone device. After I connect it, the simulators appear. I guess connecting a physical device also refreshes the simulators list.
This time, nothing was working for me, until I deleted /Library/Caches/Xamarin/XMA and /Library/Caches/Xamarin/mtbs and restarted VS. That helped.
Here's the actual solution if updating everything else still doesn't work. Open terminal, type in "instruments -s devices" to see a list of all the installed simulators.
In your info.plist set "Minimum System Version" to match the lowest simulator version you have installed.
After plugging in my physical phone with the usb cable, the list of simulator devices appeared in like 2 seconds... Before plugging in my phone, only the generic simulator and my phone were shown as deployment options
Just restart of my Mac worked...

Can't Launch app on iOS Simulator in Xamarin Studio Mac

Been tinkering with Hanselman.Forms on my Mac with Android. Today I decided it was time to try it on the iOS Simulator...
I have serious regrets about this decision.
I'm not sure what I'm doing wrong. I'm able to deploy an app from Xcode to the iOS Simulator just fine. Just won't work from Xamarin Studio.
In all fairness I do get an error:
No installed provisioning profiles match the installed iOS code signing keys.
I do see this "error" in Xcode as well, but it doesn't prevent me from launching the app there.
Thanks.
Removing entries from Entitlements.plist worked. I also had to delete the original device Xamarin Studio was trying to deploy to. After I did, Xamarin Studio created another device and launched the application successfully.
https://forums.xamarin.com/discussion/comment/117465#Comment_117465
To the exact error message:
No installed provisioning profiles match the installed iOS signing identities
control click Xamarin Studio > Solution > Project.iOS
Options > Build > iOS Bundle Signing > Custom Entitlements
Select and delete Entitlements.plist text entry. In other words, do not click on the ... button to select new new file, nor bother editing the entitlements by hand)
OK, Build > Rebuild All.
I ran into the same when I was trying to deploy to the simulator without a physical device configuration. My fix was to:
Close Visual Studio
Open the .csproj in NOTEPAD
Find the line with CodesignElements and delete it
Save the .csproj
Reopen the project in Visual Studio
Right-mouse your IOS project and click "Rebuild
All", you should see "2 Succeeded"
Give it a run, and your app will come up on your Mac
Good discussion of this here -
http://forums.xamarin.com/discussion/39534/cant-build-ios-in-xamarin-studio-5-7-1-through-5-9
Good luck

Xamarin Forms project set Startup Project

I'm building a Xamarin Forms application for Android and iOS.
How can i set iOS as startup project? I've read that your suppose to rightclick and set it as startup project. But i can't find the option?
Please help me.
You need to change your configuration options to something you have connected. This happens if you were originally debugging directly on an iPhone connected to your Mac, and now the iPhone is gone. Xamarin Studio doesn't switch automatically to the iPhone Simulator when a device is not detected, instead removes the option to use that project as a startup project.
To fix, do this:
Right click on the iOS project and go to Options
Under Build->Output, select the "All Configurations" under the drop down
Under the Platform drop down, select "iPhone Simulator"
Click Ok to save
Now on the top left corner of Xamarin Studio where you can set Debug or Releas, make sure you set it to Debug | iPhoneSimulator and NOT to Debug | iPhone
... and only then, you'll be able to select "Set As Startup Project".
So much depends on your operating system and which environment you are using. If you are on Xamarin Studio on a Mac, right clicking should work fine. Can you possibly give us a bit more information?
Do you have XCode and iOS SDKs from Apple installed? Do you have an iOS development account? You need both of these things, then click on the project's options and pick a development account to use for the project.
You may not have the iOS license and may not be able to run the iOS project at all, although in such cases on my machine the project is grayed out and clearly labeled.
Are you on Windows? If so you won't be able to run iOS projects. The shortcut labels indicate Mac, so does the context menu shape.
Have you been able to run any iOS projects? Try creating a new blank solution with just an iOS project in it to see if it runs.
There is a chance this is a bug with Xamarin's localization in your language (Swedish?)
Try switching your locale to US/English and file a bug with Xamarin or at least send them an email

Resources