Problems with my first Visual Studio iOS project - ios

I just tried to start a simple iOS project in Visual Studio, and it's saying that it cannot find a Mac Build Host. Most frustrating of all, the Xamarin site has no information at all on what a Mac Build Host is. I've popped up the command prompt in Windows and perfectly able to ping my Mac machine, so it's definitely viewable from Windows.
I'm guessing it's got to be some kind of a background process that needs to run on the Mac, but nowhere in the Xamarin site tells me where I can get it.
Help!
<vent>
P.S. I'm seriously having second thoughts about "cross platform" and "portability" and "reuse existing C# skills" jargon from Xamarin. It was way, way easier to get my first app started in simple Objective-C. Xamarin's approach feels like "we will ship you a broken product for $999, and you can help us figure out how to make this more marketable".
</vent>
Edit: After reading everyone's posts, I think I will just use the Xamarin Studio rather than take the Visual Studio approach. It seems like the less complicated approach in the long run for someone like me. Thanks to everyone for your post!

The Xamarin docs site has instructions on how to set up your Mac to act as an iOS build host for Visual Studio. I agree this isn't very clear from the "Connect to a Xamarin.iOS Build Host" dialog, so I've filed a bug.
You can also use Xamarin Studio to develop Xamarin.iOS apps on the Mac. It uses the same project/solution format as Visual Studio, so you can share the solution with VS.

The Mac Build Host is a process which runs on the network-hosted mac you need to connect to from your Windows machine, in order to perform the final app compile and build. I have just installed iOS for Visual Studio, and I had to create a Xamarin account that was associated with the VS install. Also, I had to install Xamarin.iOS on the Mac itself, instructions here:
http://docs.xamarin.com/guides/ios/getting_started/installation/mac/
What wasn't explained properly was that I then had to close VS, open it and create a new iOS project. At this point, a wizard was initiated which used the Xamarin Bonjour service to locate our networked mac and use that as the build host. All the bits came installed with the Xamarin installer, I just had to initiate them by opening up a project.
Obviously this will be different for you using Xamarin Studio, but have you tried creating a new a project to see if this initiates a wizard? Or do you need to install the iOS on your mac as well as Windows?

I have to admit, I'm not entirely sure what is meant by "Mac Build Host" either. I would expect to find something like that if you were using Visual Studio to build with, not Xamarin Studio.
My best guess is that perhaps Xamarin Studio doesn't "see" your iOS development tools setup somehow? Can you go into the Add-in Manager and see what version of iOS development you have in there?
Sorry you're having a bad time with it so far. I've been using it for awhile and it's been fantastic for me so far.

Do you have bonjour installed on your windows machine? This is required for Xamarin studio on windows to talk to your mac build host. Also you need to set up the relationship as follows.
Section 3.1

For anyone else who might have spent a few days going around in circles the answer above that states you need to close VS, open it and create a new iOS project holds the key.
Xamarin really needs to make this much clearer!
Andreas

One further thing I've noticed is that despite my setting the Xamarin Bonjour service to start automatically, it somehow gets reset to Manual. The Xamarin plugin opens the services MMC when I launch Visual Studio and open an existing project when this occurs.
During debugging it's all too easy to stop the VS debugger before the iOS Simulator on the Mac machine has been halted. It works fine if you click on the iPhone Simulator bottom button then command-Q to close the simulator. That drops VS out of debug.
If though VS is stopped before the simulator in some cases this kills the connection and it needs VS to be closed down and restarted. Once or twice it has corrupted the iOS simulator and it comes up with an empty iPhone graphic, instead of the default Photos, Contacts Settings etc icons. In that case close and reopen it and as you start the simulator click on the iOS Simulator menu, then Reset Contents and Settings. That purges the corrupt state and it's all ok after that.
Overall it works well enough to not get in the way of development but any improvements by the Xamarin team are welcomed.

Related

Xamarin VS Windows - IPhone does not show up

I'm using Visual Studio for Windows and I have a Xamarin Forms app for Android and iOS. I mostly test physically on Android (since that is much easier) and I have tested on an IPhone as well about a year ago, which worked fine (without a mac). Now I plugged it in again and it doesn't work anymore: the IPhone does not show up in the debugging list.
I have:
Apple Developer account and I'm connected with this account from Visual Studio
Identifier for Bundle
Profile (created by VS itself, with Type 'Development')
What am I missing here? I haven't added the provisioning profile in my solution, is that something that needs to be done? Am I missing another step?
I hope someone can help.
For the exact breakdown on how to setup and get started with your iOS solution, follow Microsoft's Xamarin iOS on Windows guide.
The tl;dr though is: you absolutely need a Mac to run a Xamarin iOS project, even on windows. I do not know how you had your project setup last time, however this has been the case since Xamarin's debut. Although, you could also just have access to a Mac through network connection instead of having a physical Mac. Without a physical device, you can use the Mac's ios simulator. If you are planning on using a physical iphone though, said device needs to be plugged into the Mac and not the windows machine. Later MacOS do support wireless connections of trusted devices, but it is still a wireless connection from the iphone to the mac (needing to be on the same network).

How to create IPA package on Windows from Visual Studio 2019 when successfully paired to MAC

I have read the following documentation on setting up and building iOS apps from Visual Studio 2019 on a Windows machine,
Pair to Mac for Xamarin.iOS development
Introduction to Xamarin.iOS for Visual Studio
IPA Support in Xamarin.iOS
Free provisioning for Xamarin.iOS apps
It seems there is tons of critical information missing even after spending days reading and researching on this. When I attempt to build the iOS project is succeeds and shows
Pair to Mac is not connected, so the build will be performed offline. To do a full build please connect and try again.
in the output window. This makes some sense since the documentation clearly states you must have an active connection to a MAC machine. I then open the remote device dialog and click the connect button.
I am now successfully connected to my MAC build machine that has XCode, Mono, etc installed on it. However, this is a modal dialog! No other functionality in Visual Studio is accessible via the UI while this window is open. The fact this is not mentioned anywhere is mind boggling. At this point are you suppose to run the build command from a cmd or powershell? If so, how do I know the command string VS 2019 is running behind the scenes? In general, what is the point of visual studio at all if it allows me to pair to a mac but then prevents you from using the IDE to perform any build functions?
I have figured out the solution for this and its extremely simple. I can't decide if it's stupidity on my part, a terrible and confusing way to present a UI, or a combination of both.
Just select the "X" icon in the upper right-hand corner and close the dialog and you will remain connected.
You can easily confirm that you are still paired to the mac by hovering over this icon in the visual studio toolbar

Flutter/Dart on a IOS device?

How can I run my flutter program on a IOS device?
I'm gonna use a iphone6s.
I'm using a windows 10.
I'm either using visual studio code or android studio.
Last thing, how can I use visual studio code to run my flutter program on any device?
Android-studio you just press run but visual studio code confuses me.
You cannot run on IOS from a Windows machine. Apple doesn't allow building to IOS from anything but MacOS. You can run in Visual Studio Code by opening a terminal and typing flutter run.
While you can develop an application for IOS using Windows, you can't test or deploy it unless you're using a MacOS, which I personally think is a dirty way to force any developer to buy an overpriced hardware just for this sake. But anyway there seems to be some ways around it, i'll give you some articles that are probably worth reading.
Developing and debugging Flutter apps for iOS without a Mac
How to sign Flutter apps for iOS automatically without a Mac

Why cant I build apps on my PC but I can on my mac? Xamarin

So I got my MacBook pro yesterday in hopes of developing some local apps to build on my phone.
And after setting everything up, Visual studio on my mac and XCode, and I already had Visual Studio on my PC things started messing up.
I tried debugging my app on my phone from my PC, with the phone connected to my PC ofcourse, didnt work, so I read around on the internet for a good 4 hours and it said that I should create a blank project in XCode, and for the Signing in preferences I had to choose Team, so I did and it debugged the application on my iphone when my iphone was connected to my Mac,
However I DONT want to code on Mac computers, I want to use my PC.
But everytime I try to debug the application from my PC it keeps saying
Could not find any available provisioning profiles for iOS.
I am running a iPhone 7 with the version 10.1.1 because I dont want to update due to various reasons.
I tried changing the Deployment target to something really low but that didnt fix it.
Why is this happening?
Visual representation of what the error looks like
Not sure if this picture helps, this is the project properties > iOS Bundle Signing
And my device log is empty aswell.. Why?
ANother error message saying it doesnt support
EDIT
I plugged it into the mac and now its visible in the Device log and I can see stuff happening in the device log but I still cant boot the project on my iPhone
Apple doesn't allow developing for iphone on a non IOS device. This simply means that you can't build apps on a Linux or Windows computer/laptop the normal way. You are stuck on building your project on an IOS device.
There are 2 options to fully develop on a Windows laptop though.
One way of doing so is by using your mac as a gateway to send your app from Windows to IOS to your phone. More info about this can be found here:
https://learn.microsoft.com/en-gb/xamarin/ios/get-started/installation/windows/
The second option is a newer one called Xamarin Live Player. You don't need to use a mac at all for developing, but you still need a mac if you want to publish the app. This option also works differently from normal development as you need to download an extra program on your phone.
https://www.xamarin.com/live
You could try to do manual provisioning. Create a development provisioning profile at the Apple Developer site, and have XCode download it for you. Then it should show on your PC for you to select.
See the Xamarin documentation on manual provisioning for some more details:
https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/manual-provisioning?tabs=vsmac#creating-a-development-provisioning-profile

Possible to simulate iOS app with Visual Studio using Windows PC only

I apologize if this has been covered elsewhere. I have researched this topic to the best of my ability but I am still unsure of the answers I have found. I am a senior in college and I am developing an app to essentially act as a remote control for a device that my team is building for our senior capstone project. Everything is progressing fine for the Android app etc., but we are interested in developing an iOS app as well. We were steered toward Visual Studio 2015 or later for this since none of us own a Mac. We do not have an iPhone and we are not interested in trying to actually sell or deploy the app officially. All we really need is a means to simulate the iOS app on a PC and demonstrate that the functionality is still there to control our device.
I have seen several posts stating the requirement of a Mac regardless to, at the least, handle conversions for any app development on a Windows machine. I have also found a couple posts with a potential work around that involved installing a Mac VM, though I am not sure if these are "legal" solutions or not? We do not have it in our project budget to purchase any Mac systems, OS, or cloud services to develop the app. I have only done light work on Macs unrelated to programming so I know very little about what is possible regarding VMs etc.
At this point I am looking for some clarity on whether there is an actual legitimate and legal means to simulate an iOS app using Visual Studio and a Windows PC only? In our case, we would need the simulation to be able to connect to our device wirelessly and control it. It is OK that the physical device would actually be a Windows laptop, the CS department just wants to see that we have developed software that could in theory work on an iOS device. We would be presenting our work in detail during weekly updates so the solution would need to be above the table in all regards.
I apologize if this is answered elsewhere. The options in Visual Studio and most of the guides online are pretty unclear about what you can and can't do specifically under the various project types. We didn't want to get too deep into development with C# only to hit an impassable wall and lose all that time. It seems Apple keeps everything under close guard so I was suspicious about the VM alternatives to having a Mac. Thanks in advance for you time!
You must have a Mac to develop iOS apps, either to act as a build server, or as your primary development machine. Even when using Xamarin, the build tools and iOS Simulator are provided by Apple and will only run on Apple's OS. You can only legally run Mac OS on Apple hardware.
Just to add to the previous (and correct answer imo) which states that you need a mac to legally build IOS apps.
You don't need a powerful mac in order to do the building. I've been using a mac mini as a build server for a year now with no major problems. I wouldn't want to do any actual development on this machine, but it's great for sitting in the corner and doing builds sent via visual studio.
You can still do all IOS Dev on windows with visual studio (connected to the mac for building). Additionally with the enterprise version of VS you can run the IOS simulator on the PC, but again it requires a connected Mac. Although I'm hoping that they will eventually bring this functionality back to community users.
In your specific (academic) case whether or not you do manage to get a mac for building, I would suggest looking at Xamarin Test Cloud for providing evidence that your software will work on a large number of devices.

Resources