>> Hi, I'm James Montemagno,
a Program Manager for
our Mobile Developer Tools here at Microsoft.
Today, I want to show you how to get started building
your very first Xamarin iOS application from
Visual Studio on a PC and
deploy it to a Remoted iOS Simulator.
So, let's take a look. Here I am
inside of Visual Studio 2017.
I have the project that we created
in an earlier video which was
a file new project for
Xamarin.Forms where I have iOS and Android.
I've added a button that when I click,
will go ahead and update a counter that
say you click this many times.
Now, we'll want to go ahead and set
this project as the startup for iOS.
So I right click on the iOS project
and say "Set as StartUp Project".
Now, notice here that I have a simulator or a device,
and it also references
the debug solution platform right here.
So I'm saying, I would like to debug to
iPhone Simulator and I like
to go ahead and deploy it to the Simulator.
Now, since we're not connected to our Mac yet,
we'll only see a Simulator option.
When I tap "Debug",
it will bring up this "Pair to Mac"
option because I haven't paired it to my Mac at all.
Optionally, you'll probably see this Window which
will guide you through the installation process.
How to enable remote logins to our Windows machine can
securely communicate with our Mac machine over SSH.
So, we'll enable "Sharing",
enable "Remote Login", and then we're good to go.
So, let's go ahead and do this on our Mac right now,
and then come back and finish
the paring process on our PC.
Here I am on my Mac.
Now, to enable this machine to be able
to connect to my Windows PC and Visual Studio,
we're going to go into the "Settings" and then "Sharing".
All we need to do is enable "Remote Login".
This will enable us to securely log in
over SSH on our local network to
enable Visual Studio to deploy
our iOS application to a Remoted iOS Simulator.
You can configure access for
all users or a specific user,
and we'll be using
the specific username and password to log in over SSH.
Let's head over back to our PC and
deploy our very first iOS Application.
So, now that we've configured our Mac,
we can finish the pairing process.
Here, it will automatically
detect any MACs that are on our network.
We can also additionally say "Add Mac" where we can
manually enter the Mac name or
IP address if for some reason it doesn't show up.
So, I'm just going to go and double
tap on the "MotzBook".
Here, it'll start communicating over
SSH to enable me to log in.
So, I'll enter the username and
password of my Mac machine.
So, I'll go ahead and type this in and hit "Login".
Now, what this will do is it'll automatically
connect over SSH and check
that I have everything installed on my Mac
that's required to build and deploy this application.
So, if you've already installed Visual Studio for Mac,
then you have everything that you need.
If not, Visual Studio will automatically prompt you to
install the necessary bits that
are required to deploy the iOS Application.
After that, it will finish the connection process,
ensure everything is validated and that
we're ready to deploy our application.
There we go. We're connected.
So now, back inside of our "Debug" menu
I see a large list of options.
I no longer just see iOS Simulator or Device.
Note that I'm paired to a Mac to my MotzBook.
So, instead of just to point to a Simulator,
I can select all of the Simulators that are available.
Or if I plug in a device or enable Wi-Fi deployment,
my device will also show up in this list.
So what I'm going to do is simply hit "Debug" on the
iPhone 8 iOS 11.4 Simulator.
This will compile my application
right here on my machine,
and then deploy it to my Remoted iOS Simulator.
Now, our Remoted iOS Simulator has launched and
our application is right here in front of us.
I can come in and see it says,
"Welcome to Xamarin.Forms" and I
can go ahead and click that button.
So, I can go out and clicking it in
and increase it each time.
Now, what's great is that I'm using a touchscreen,
so I can also go ahead and tap on the screen.
Now, I can see it increment.
You can take screenshots, rotate the device,
come into settings to adjust the location or use
Touch ID or reset
the entire simulator. So there we have it.
We've deployed our iOS application
into Remoted iOS Simulator.
If you run into any issues at all getting started,
just come into our great documentation for
installing Xamarin iOS on Windows,
where you can read about setup, installation,
and anything else that I've outlined here today.
There you go. We've just built
our very first iOS Application and
deployed it to a Remoted iOS Simulator.
If you have any questions at all,
feel free to reach out and thanks for watching.