Build and Simulate iOS in the Cloud

Visual Studio Tools for Apache Cordova allow you to build cross-platform, multi-device hybrid apps using Apache Cordova. You can use the vs-mda-remote agent with a Mac on your network to build, debug, run, and simulate an iOS version of your app. Many developers start their hybrid app development by testing on Android. Later in the development process, when the focus is mainly on verifying and polishing the UI for a set of core devices, they begin testing on iOS. The need to provide each developer on a team with a Mac for this final step is not cost effective. As an alternative to buying Macs, you can use a cloud hosting provider to build and debug your app in the iOS Simulator from a Windows machine, to debug native problems using Xcode, and to submit your app to iTunes using the Apple Application Loader. Cloud hosting providers charge a range of rates, some of which can be very cost effective (particularly if the majority of your development is done on a different platform). In this tutorial, we will describe how to configure Tools for Apache Cordova for use with one provider—MacInCloud.

Note

We are not recommending MacInCloud as a preferred provider. The steps shown here can be followed with other Mac hosting providers or with Macs in your own datacenter (that is, in situations where you do not have administrator access to install vs-mda-remote). We recommend that you evaluate providers based on your organization's needs.

Install vs-mda-remote

To get started with MacInCloud, first set up either an account or a trial version. Make sure you enable the remote build port feature during checkout. Once you have provided your login information, connect to your Mac using Remote Desktop, and then you can set up vs-mda-remote. If you chose a MacInCloud plan with a dedicated server, you may have sudo (Administrator) access. With sudo access, just follow the same instructions used to install the remote agent on an on-premise Mac.

If you are using a managed server plan, you will not have sudo access. However, it is worth noting that vs-mda-remote is probably already installed on the machine that you have access to. You can validate this by attempting to start up the agent. In the Terminal App, type:

vs-mda-remote

If it is not installed, contact MacInCloud support and ask them to install it on your behalf.

Configure Visual Studio to connect to your cloud hosted Mac

With one exception, you can use the same process to configure Visual Studio for use with MacInCloud as you do with your own Mac. The host name for MacInCloud is not available externally, so you need to use the IP address instead of the host name.

Note

vs-mda-remote is not intended to be used as a traditional cloud-based service and you should make sure that you are in compliance with any Apple licensing terms that apply to your organization.

To get your IP address and configure Visual Studio

  1. In the Terminal App on your Mac, type the following command (make sure you include a space before the final quotation mark, as shown).

    ifconfig | grep "inet "
    

    Two IP addresses are displayed. In the steps that follow, you will need the IP address that is not the loopback address (127.0.0.1). For example, if typing the preceding command resulted in the following output, you will need 192.168.0.100.

    inet 127.0.0.1 netmask 0xff000000
    inet 192.168.0.100 netmask oxffffff00 broadcast 192.168.0.1
    
  2. If it is not already running, start the agent in the Terminal App on your Mac by typing:

    vs-mda-remote
    

    The first time you start the agent, you will see output similar to this.

    Output when your first start the remote agent

  3. In Visual Studio, open Tools, Options, Tools for Apache Cordova, and then Remote Agent Configuration.

  4. Configure remote agent settings.

    Set Enable remote iOS processing to True, and configure the Port and Security PIN using the output from the Terminal App. Instead of using the host name shown in the Terminal App, use the IP address you obtained previously and enter it in the Host field.

    Important

    The Security PIN expires after 10 minutes by default. To generate a new PIN, see our documentation.

    Configuring the remote agent in Visual Studio

    That's it. You are finished configuring the agent!

Handling IP address changes

Generally your IP address should not change, but if it does you can easily generate a new server security certificate and PIN and then update your configuration in Visual Studio. For details, see our documentation. Alternatively, you can choose to update your Windows Hosts file to map the host name that vs-mda-remote reports (when it generates the security PIN) to the IP address, and then use the mapped host name instead of the IP address when you configure Visual Studio. If your IP address changes again, you need to update the Windows Hosts file.

Download the toolsGet the Visual Studio Tools for Apache Cordova or learn more