build ios app with visual studio using xamarin, without mac build host - macos

I am a new user to xamarin.
I installed Xamarin.IOS on visual studio. When i create a new project and want to build it, vs says that you should select a "mac build host".
Is it necessary for building ios application?
May I do that in a simulator? because I don't have a Mac machine.
Thank you very much.

You must have a Mac to act either as a build host or your primary development machine in order to build an iOS app. The iOS build process relies on the Apple iOS SDK and tools that are ONLY available from Apple on OS X.

If you are completely refused any idea of buying Mac here the solution. In my case I use next tools:
Windows 8.1 x64
Visual Studio 2015 Update 3 (Xamarin inside)
VMWare Workstation 12
Inside VMWare Workstation:
OS X 10.11 El Capitan
XCode 7.1 (Xamarin's developers recommend 7.3)
Xamarin Community 6.0.1
General advice is to use latest versions and updates of all tools.
Install El Capitan as it described here.
On VM install latest XCode (you probably need Apple ID for it) and iOS part of Xamarin Studio. If Xamarin Installer generates error on downloading JDK 7 then download and install it before Xamarin Studio
Enable Remote Login in MacOS settings and allow access for your user
Configure VM network as NAT and make port forwarding for port 22
Run Visual Studio on Windows and create iOS project.
Connect to Mac using IP 127.0.0.1 and type your Mac's username and password
Select appropriate iOS emulator in Visual Studio and run.
Here the proof pic

Regarding this topic I've tried many approaches. I spent too many hours trying to install hackintosh on a VM on my MS Windows 10 system... I tried a lot of receipts... I could install it free times but I couldn't reboot it none of the tries. ##£%&!!!!
Before this anoying "R&D" I searched for a cheap second hand Mac and I also searched after but without getting good results...
Today I want to share my next step with you all before starting with it because I guess (I hope indeed) is going to be the solution for my next 4-6 months to do iOS developments with xamarin using VS on a Windows machine without owning a Mac, use a Mac hosting already prepared for dev purposes:
https://www.macincloud.com/checkout/managed.html

For setting up Xamarin iOS with Windows and Visual Studio, you'll need to have MAC to run / test the application in the simulator.
Please review the limitation here http://developer.xamarin.com/guides/ios/getting_started/installation/windows/
You can either install MAC OS X in your windows PC using VM Ware and setup MAC OS

Related

How to overcome "Please select a valid device before running the application." on a paired with Mac Visual Studio on Windows 10

I have a Win10 computer paired with Mac. Until today all things were okay, but today I start getting the message:
Please select a valid device before running the application
when I try to debug an iOS Xamarin application on a selected iPhone simulator.
My configurations:
Mac:
OS: Mac OS Catalina, version 10.15.7
XCode Vesion: version 12.2
Visual Studio 2019: version 8.8.4 (build 30)
Win 10:
OS: Win10 version 10.0.19042.685
Visual Studio 2019: version 16.8.3
Simulator names are available on my Win10 computer, but when I select one and try to debug an iOS application I get the message I reported above.
If I launch debug on the Mac directly it runs and starts debugging on the selected iPhone simulator. But when I do the same on the paired Win10 computer in Visual Studio I get this message.
I searched google and SO for this issue and according to advises downgraded XCode to the most possible version 12.2 that is supported by Visual Studio. But it does not change anything.
I want to debug application only on simulator on the paired Win10 computer.
Is there a way to fix this issue?
Looks like the problem was related to the connection between my Win and Mac computers.
My steps to resolve this issue:
I opened Tools - Options - Xamarin - iOS Settings on Visual Studio on my Windows computer. On the Pair to Mac dialog window I selected "Forget this connection" (right click context menu on the connection).
Next, on my Mac, I turned off Sharing (System - Preferences - Sharing).
Then I restarted my Mac computer. And then turned On sharing again, specifying my username as allowed users.
Next on my Windows computer, in the Visual Studio, on the Tools - Options - Xamarin - iOS Settings section I paired my Mac again.
Voila. All things work as expected!
If anyone else runs into this question today, I found this GitHub issue for XCode 13 issues with Xamarin.ios
https://github.com/xamarin/xamarin-macios/issues/12778
I fixed the issue by manually installing xamarin.ios-15.0.0.6.pkg on my mac (linked in the GitHub issue)
When connecting to mac through visual studio it showed the error "The Xamarin.iOS SDK version '15.0.0.6' that is installed on the Mac is not compatible with this version of Visual Studio. Would you like us to install Xamarin.iOS '14.20.0.25' for you? This will overwrite any other existing Xamarin.iOS installation on your Mac."
But, if you hit cancel it should still connect successfully.
Same issue diff version. VS MAC stand-alone also had some issue as VS WIN connected to VS MAC. Started at some early today. Suspected an update somewhere. Traced issues to auto update of XCode to 13. Solution was to download and reinstall XCode 12.5.1 from Apple Dev site. With XCode 12.5.1 things worked. So, something changed with the API in XCode and Xamarin was not prepared for it.
Restarting Visual Studio in Windows worked for me after successfully building.

Does Xamarin IOS Simulator Require XCode?

Well , im new to IOS app development i've heard about Xamarin cross-platform app-development, so my setup is ==>
Visual Studio Enterprise Update 1 Installed.
Xamarin For Visual Studio 2015 Downloaded (Now about to install).
Xamarin IOS simulator downloaded.
Now as i have xamarin simulator i don't need to buy a mac or get a hosted-mac , that's clear now i just wanna confirm do i need XCode ? i mean i have xamarin simulator but still i'm confused about XCODE for windows how can i get that should it be getting installed automatically or do i need to give it another shot.
I'm confused about all this .
I just don't* have the budget to buy a MAC and i want to do APP development just (Debugging ) deployment will be done latter please tell me what should i do or give me the proper instruction thanks.
You need to run Xcode on a mac to build Xamarin apps for iOS. A Windows install of Xamarin on Visual Studio will allow you to connect to a mac to do the build remotely, but you still need a mac available that has Xcode installed on it to do the build.
You can download Xcode from the Mac App Store. You will also need the mac to upload the final package to the iOS App Store if you're going to release it there.
An other option is to use a cloud based Mac server, there are several companies that rent them out on hourly/monthly basis for this purpose (MacinCloud being one that I've heard of).
XCode needs and can only be installed onto a MAC OSX system.
Once you have XCode installed, you can use its iPhone simulator to emulate the iOS apps you make on your windows pc.
You need to connect to the MAC by using the MAC Agent on Visual Studio. This connects remotely to the MAC and allows you to debug the app to be emulated onto the virtual iOS device being simulated on your MAC OSX system.
You can use MAC Cloud based server but also, you can use a real iOS device such as an iPhone to debug apps directly onto the device.

Can we use an Ipad Pro to compile xamarin ios projects with Visual Studio on a windows machine?

The xamarin documentation mention that we need an MacBook connected to the network to be able to compile a xamarin ios project on a windows machine.
However can we use an IPAD Pro for this also ? Otherwise I have to buy a MacBook just to connect to my network ?
https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/
No. You need a Mac running a current version of OS X to act as a build host. An iPad Pro does not run OS X.
As Dylan S mentioned, getting a cloud hosted mac (like macincloud.com) would be the best solution for you. From what i've seen they got pretty reasonable plans and their website seems pretty informative

Not able to find Xamarin.iOS Build Host on Mac

After I installed Xamarin Studio v5.10 (build 871) on my Mac (OS X Yosemite v10.10.5), I can't find the Xamarin.iOS Build Host, even when using Spotlight. I want to pair Visual Studio with my Mac development machine. I found an answer on the Xamarin forums:
I was having the same issue on my Mac and was able to resolve the
issue by deleting the following directories/folders and reinstalling.
/Applications/Xamarin Studio.app /Developer/MonoTouch
/Developer/MonoAndroid /Library/Frameworks/Mono.framework
/Library/Frameworks/Xamarin.Mac.framework
/Library/Frameworks/Xamarin.Android.framework
Hope this helps.
Thx, Leland
I performed these steps and have uninstalled Xamarin on the Mac and then reinstalled, but this hasn't helped. What can the problem be and how can I solve it?
OS-X Build Host has become OS-X Build Agent:
Overview
The Xamarin Mac Agent provides a way for Visual Studio
developers writing Xamarin.iOS apps to connect to a Mac effortlessly
to control the building, deployment, and running of apps. Visual
Studio connects to the Mac over SSH, which provides several benefits,
including:
Ref: http://developer.xamarin.com/guides/ios/getting_started/installation/windows/xamarin-mac-agent/
The Xamarin.iOS Build host has evolved into the Build Agent.
You now don't have to start a separate application to be able to connect to your Mac and compile your iOS apps.
Here's how to do it;
Enable Remote login on you Mac.
With Spotlight search for Remote Login and tick the Remote Login box on the left side.
Select which users or user groups can connect.
Go to your Visual Studio and find the new icon, click it
Find your host, it's probably just one and click connect. Enter your credentials (if you need to) and wait for the chain icon to appear on the right of the selected host.
From now own it should connect automagically. Just wait for the screen in the Visual Studio toolbar icon to turn green.
For more info check the Xamarin documentation.
Also when you're connecting this way for the first time on an existing Xamarin project be sure to do a clean and rebuild to avoid errors.

Visual Studio 2015 + Xamarin > Select a valid device before running the application

I have the latest alpha builds of xamarin recently uninstalled everything on both mac and pc (windows 8). I get the error "select a valid device" when trying to run the ios sample application.
I have set the platform to iphonesimulator, i am connected to the mac. The following is the log when building
Starting Agent IDB 4.0.0.1566...
Connected to the MacBook-Pro.local (192.168.1.120) with Limited support.
An error occured starting the IDB 4.0.0.1566 agent: The operation has timed out.
Starting Agent Build 4.0.0.1566...
Agent IDB 4.0.0.1566 is running
Agent Build 4.0.0.1566 is running
Starting Agent Designer 4.0.0.1566...
An error occured starting the Designer 4.0.0.1566 agent: The operation has timed out.
The Xamarin Mac Agent could not be fully started. Agents not started: Designer 4.0.0.1566. Please check the logs for more details.
Agent Designer 4.0.0.1566 is running
Connected to the Mac MacBook-Pro.local (192.168.1.120) with Full support.
The application works fine when run on the mac and the simulator works fine. I have the latest xcode and can run an application from xcode as well.
Properties of IOS project - i do see this error "failed to obtain profile information from the build server. Please, check the connectivity with the mac build host' > i have done this an everything looks connected.
Ideas??
For those that end up here in April 2018, there is currently an issue with Xamarin and xcode 9.3.
ensure that your mac has xcode 9.2 (I also had to completely remove 9.3), which you can download from the apple developers site.
un-install xcode 9.3 on mac
install xcode 9.2 on mac
restart mac
in visual studio - forget mac connection, re-connect when mac back up.
update*
Apparently this is fixed in Visual studio update 15.6.5, although not personally test myself yet
You should have development certificate installed on your MAC. Also your device should be provisioned for development. For details check here
Sounds like your root issue is that the Xamarin Mac Agent isn't connecting. Without this connection, most all iOS development cannot be run.
I can suggest two things.
1) reboot the mac - sometimes when you uninstall/reinstall or something goes wrong processes can be orphaned which cause problems, simple reboot might resolve your problem.
2) try the troubleshooting steps here: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/
XCode 9.3 was recently released by Apple, that version is not compatible with the current Xamarin SDK. Xamarin has released updates to their SDK that fix the issue on both the Mac and PC. You can get them here: https://releases.xamarin.com/preview-xcode-9-3-beta-2-ios-11-3-macos-10-13-4-support-preview-2/

Resources