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.
Related
I'm aware that a Mac or a Mac service e.g. MacInCloud.com is necessary for building and submitting iOS apps.
My question is about the actual workflow of building an app on Windows using Xamarin on Visual Studio 2017.
We need to write code, test and debug throughout development cycle. How does this work with Xamarin running on Windows? How would I actually see what my mobile app looks like or behaves during the actual development cycle?
While developing my web apps in Visual Studio, there are many trips back and forth to the browsers and back to VS in order for me to see the results of my code. How does this work with Xamarin running on Windows? Is Xamarin Live Player the only option for development cycle? Is there a solution through MacInCloud or similar services so that tethering a device to dev machine is not necessary?
I'm just trying to understand how a healthy development cycle is created for Xamarin developers on Windows.
I will answer your question in few section: Coding, Debug, Test
Coding
You will be using Visual Studio to write your codes. iOS and Android code will be written in C#. You will get access to UI Designer for both iOS and Android to edit the layout files and storyboard/xibs. For 3rd party library, there is NuGet to serve your needs.
Debug
You can use Xamarin Live Player without connection to a Mac/MacInCloud for basic preview. However, some features of iOS is not available in Xamarin Live Player (e.g. xibs files not supported...).
If you setup with connection to a Mac, you will be able to see a list of Simulator that available in the Mac you connected to. By default, if you debug it, the simulator will still show up in the Mac. Then you will need to VMWare or remote into the Mac to check the simulator output. If you have Visual Studio Enterprise license, you can get access to a Remote iOS Simulator feature. You will need to turn the option ON. After that, you will able to see a remote iOS Simulator showing in your Windows machine without the needs to remote into Mac machine anymore. For debugging in actual iOS devices, you will still need to plug your device into the Mac. Previously (more than 1 years ago), Xamarin announce that they are working on "iOS USB remoting" to allow you to plug in iOS device into Windows machine and debug on it. But it is not release until now.
For Android, you can get access to Android Emulator Manager to add emulator to debug or you can deploy apps to physical phone just like what you can do with Android Studio.
Test
I will be referring to Xamarin.UITest for this part. You will be able to write UITest code in C# inside Visual Studio. Xamarin have product "Xamarin Test Cloud" to allow you to upload test code and binary and then run your test in cloud periodically. If you want to run the test locally in your machine, you will only able to run Android UITest in windows machine. To run iOS UITest locally, you will only able to run it in Mac machine. Using a Mac, you can also run Android UITest.
You can use a simulator/emulator instead of a device. For iOS, the simulator would run on the Mac Build Host that you are connected to. You can select the option for "Remote iOS simulator" in Visual Studio -> Xamarin.iOS options and you'll be able to interact with the simulator without having to RDP/VNC/look at the mac. For android, you can just run an emulator in Window and interact with it like that. Using your web apps comparison, you would use a simulator/emulator instead of browser but, for the most part, the process would be similar.
I have been developing a Xamarin MVVM app targeted at iOS and Android. I initially did the iOS development on Windows with VS 2022 and an iPhone attached via USB. I knew that I was going to have to eventually move to the Mac for final provisioning but I ended up taking that painful step earlier than planned because certain Xamarin features were just not working on Windows. First I could not get my app icon to be anything other than the Xamarin default and then Xamarin.Essentials.FilePicker would not select a file:
https://github.com/xamarin/Essentials/issues/1710
So after a week of struggling I finally got my project building and deploying on the Mac. However, I am not nearly as comfortable working on the Mac as I am on Windows where I have all my familiar development tools. So then the question was how to share the project files between the PC and the Mac so that I could edit and compile on the PC and then move to the Mac for final testing.
At first I tried iCloud but I could never get the files to sync reliably between the shared folder on the PC and the Mac. I am used to Dropbox and OneDrive, which work as expected. iCloud not so much.
So what I have been doing is committing and pushing the changes to github and then pulling the changes into the project on the Mac. It is quick and has the added benefit of version control using an offsite server. I am happy with this workflow and publishing the app on the Apple Store should be an easy task when that time comes.
Update:
This process is still working for me. I have taken the additional step of doing the release configuration on VS Mac and publishing my app to App Store Connect. That experience was convoluted and frustrating but it now works and I have people testing my app via TestFlight.
One hiccup is that when selecting Automatic iOS Bundle Signing in the project properties on VS Windows, this change gets pushed to the Mac side and causes a build error under Debug until I select the Automatic provisioning profile on the Mac. Somehow it gets set to the Wildcard profile on the Windows side.
Visual Studio is the recommended tool (superseding Xamarin Studio) on both Windows and Mac. However, the VSTS page Build your Xamarin app says to use "Xamarin". Presumably that means Xamarin Studio, even though the the "Install Xamarin" link on the page points to Visual Studio. That ambiguity and the March 6 date on the page indicate that it was overlooked during the rollout of Visual Studio 7 for Mac, leaving us to wonder what is the right approach for setting up an agent.
What is the best way to create an iOS build agent these days? Do you install Visual Studio for Mac or Xamarin Studio?
Sounds like a bit of confusion here in the terminology. The IDE is now Visual Studio for Mac, but the underlying framework is still Xamarin. That is to say, Xamarin.iOS/Xamarin.Android/Xamarin Forms are "integrated" into Visual Studio for Mac; they are the tools that will compile and package your mobile app. This is what the VSTS build task page is saying when it asks you to "Install Xamarin".
As for setting up a VSTS build agent, here's a checklist that will hopefully get you going:
Download and install Visual Studio for Mac on a computer running OS X/macOS. Confirm that Visual Studio for Mac can indeed build and sign the IPA's.
If necessary, install all the certificates and provisioning profiles, and confirm that the IPA is correctly signed.
Create a build project in VSTS.
Install the VSTS build agent for OS X/macOS and connect/register the build agent to the VSTS project. Please be aware that the Xamarin license task/utility is deprecated and no longer needed. If that does appear as a step in your VSTS build project, delete it.
Go back to VSTS, and configure the VSTS project to build the Xamarin.iOS project via the OSX/macOS build agent. Once the build agent is connected to the VSTS project.
I'll admit, there is a lot of moving parts and things to do here. I hope this high level overview is enough to point you in the right direction.
Per starain's advice, I tried installing VS for Mac. It started up, but failed with an 'Unable to parse condition "!(Exists($(SharedVersionOutputDirectory)))"' error. I've encountered several bugs in the Xamarin tool chain, so this may have nothing to do with VS vs. XS, but just be part of the current duct-tape-and-bailing-twine experience. OTOH, there's still a top-level Xamarin page saying VS Mac is still preview, so who knows how baked it really is?
So even though the Mac build agent does find and run the VS Mac build tooling, I gave up and used my Windows build agent instead, and had MSBuild on Windows connect to the Mac for the iOS build.
I'm trying to connect to mac in visual studio.
I did every step and I also connected to the Xamarin account.
In the Xamarin Mac Agent it found the mac which means I did the steps.
So sharing preferences are correctly configured at mac.
But when I try to connect to mac, after entering username and password it shows the following error:
Couldn't connect to MacBook.local. Please try again.
I don't know how I can solve this problem.
The Xamarin.iOS SDK and Xcode both need to be installed on the Mac you're trying to connect to. See Installing Xamarin.iOS on Windows and the step-by-step installation guides.
Once Xamarin is installed on both Mac and PC, you can check the log files for hints about any connectivity issues you may encounter.
Mac – ~/Library/Logs/Xamarin-[MAJOR.MINOR]
Windows – %LOCALAPPDATA%\Xamarin\Logs
You may also find the Connection Troubleshooting and general diagnostic info guides helpful.
i have a mac mini. i am trying to add this to visual studio (version 2015 with update 3). it detects mac, gets the SSH fingerprint, and gives me the login screen. but then i get login failure. i can login through SSH to it without any problem. i can use VNC and connect to it using the same credentials. but i consistently get login failure when trying to connect through xamarin dialog box.
i haven't installed anything on mac, i have only enabled remote login, and enabled all options to connect me to it using SSH and everything seems to be working fine.
i don't understand what i am missing. i'll appreciate any help with this.
You need to install Xamarin.iOS on your Mac as a minimum to be able to connect from Visual Studio - if you don't have the Xamarin tooling installed on your Mac along with Xcode then you cannot build your iOS apps.
You do not need Xamarin Studio installed on the Mac, just Xamarin.iOS, but it is advisable as it makes it easier to update.
Check out our installation guide which walks you through downloading and installing everything you need:
https://developer.xamarin.com/guides/ios/getting_started/installation/mac/
We also have some guides for the Visual Studio side of things which may help if you continue have issues connecting:
https://developer.xamarin.com/guides/ios/getting_started/installation/windows/
I think that you need to install Xamarin Studio for Mac.
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