iOS Host used remotely, over the public Internet - possible?

EmmanuelHunaEmmanuelHuna USUniversity ✭✭

Soon, I'll be going through some courses on Xamarin University.

I'm a .NET developer mainly interested in Android, Windows Phone 8, and Windows 8 development. Since Xamarin University provides some courses on iOS, I thought I might as well go through them.

To build and deploy iOS apps, my understanding is I'll need a Mac. I have no use for a Mac, and don't want to buy one just for this - but I can access a virtual mac or a friend's Mac remotely.

Has anyone attempted to use an iOS host on a remote machine? By remote I mean the Visual Studio/Windows machine and the Mac not being on the same local network such as 192.168.1.x - but the communications going over the public internet.

What ports on the firewall must be open for this to work on the Mac side?

I found these articles, but none mention what ports and protocols must be allowed -

http://docs.xamarin.com/guides/ios/getting_started/installation/windows/
http://docs.xamarin.com/guides/ios/getting_started/installation/windows/troubleshooting/

Thanks for the help!

Best Answer

  • moljacmoljac HR ✭✭✭
    Accepted Answer

    Hi

    Never tried. Mac Build Host port number is by default 5000

    First try locally from mac and move outward... (first to local network) then outside)

    telnet mac.ip.address.on-local-network 5000

    mtbserver ports change (tcp connection)

    So, this means You'll need to setup routing, or port forwarding on router to get to You Mac.

    hth

    mel

Answers

  • moljacmoljac HRBeta ✭✭✭
    Accepted Answer

    Hi

    Never tried. Mac Build Host port number is by default 5000

    First try locally from mac and move outward... (first to local network) then outside)

    telnet mac.ip.address.on-local-network 5000

    mtbserver ports change (tcp connection)

    So, this means You'll need to setup routing, or port forwarding on router to get to You Mac.

    hth

    mel

  • EmmanuelHunaEmmanuelHuna USUniversity ✭✭

    Thanks, I'll try using port 5000.

    I'll definitely make sure the firewall allows connections on port 5000 and will setup port forwarding accordingly on the router.

    @Miljenko: thanks for the help!

  • moljacmoljac HRBeta ✭✭✭

    If You open diagnostics tool in Xamarin.iOS in Visual Studio You should get enough information to help You out.

    Let say if I shut down Xamarin.iOS build host on Mac (MTBserver):

    Step "Connection to Mac server" returns error (1st one) with Details and further Actions (cannot copy text and will try to find logs).

  • EmmanuelHunaEmmanuelHuna USUniversity ✭✭
    edited February 2014

    Unfortunately, it's not working. On the Mac, I made sure the firewall is off; I am also able to telnet from my windows machine to the Xamarin build host on port 5000:

    telnet 209.1.2.3 5000
    (where 209.1.2.3 is the IP address of the mac, not my real mac ip)

    Telnet works, but when I try to connect from Visual Studio, I get the error below:

    Visual Studio > Tools > Options > Xamarion > iOS Settings
    Find Mac Build Host > Continue > Configure host manually > 209.1.2.3

    Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : Build server control connection failed
    Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : Another instance is using the server at 209.1.2.3

    There is no other instance connected to the build host - why would I be getting this error?

  • EmmanuelHunaEmmanuelHuna USUniversity ✭✭

    Got it working: first you need to click on 'Pair' on the build host on the Mac, then when you see the code, attempt to pair from VS, Visual Studio > Tools > Options > Xamarion > iOS Settings Find Mac Build Host > Continue > Configure host manually > 209.1.2.3 - and it works!

  • JeffGonzalesJeffGonzales USMember ✭✭

    How do you debug on an iOS device? Do you have to use some sort of USB-to-IP connection? Will this new "remote login" system that replaces the build host make this easier?

  • Hi @EmmanuelHuna , I've been looking for the same thing lately. I want an iOS Host used remotely, over the public Internet to reach my own mac at home. Since I'm no expert regarding the networking, is there a way you could provide some steps?

    Thanks.

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    @FredyAlexanderBonilla said:
    Hi @EmmanuelHuna , I've been looking for the same thing lately. I want an iOS Host used remotely, over the public Internet to reach my own mac at home. Since I'm no expert regarding the networking, is there a way you could provide some steps?

    Thanks.

    Xamarin for Visual Studio no longer uses the Xamarin Build Host application. It now connects via remote login. Instructions for setting everything up can be found at https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/

    Caveat #1: All the instructions assume the Mac and Windows machines are on the same network. That used to be a requirement with the old Build Host. I'm not sure if it is required now. If it's not required, then you'll have to do some router work because you're Mac's IP isn't visible to the internet.

    You will have to set up port forwarding on your router so that connections to port 22 are routed to your Mac. On the Windows side, you'll need to use your router's IP address instead of the Mac's.

    Building will be a veeeerrryyyyy slllloooooowwwww process working across the internet, so even if this works, I wouldn't recommend it.

    Caveat #2: Your router's IP address will expire and renew periodically, so it could change at any time. You'll have to be aware when it changes and edit your Visual Studio configuration accordingly. There are sites that host dynamic IP routing by assigning you a domain name and having a process running on your Mac that keeps their site up-to-date with your router's IP address. It's not a perfect solution, but might be worth it.

    Caveat #3: Forwarding port 22 from your router to your Mac is a VERY BAD IDEA from a security standpoint. People who spend their lives messing up other people's computers scan IP addresses for common open ports. Port 22 is a well known port and one of the first an attacker will try.

    Caveat #4: As I said in Caveat #1, I don't know if Xamarin supports connecting to a host that isn't on the same network as your Windows host. So all of this may be moot.

  • GVxGVx USMember ✭✭✭

    Here's a pretty good solution using a VPN. I have not set this up but looks like a nice guide on how to do it.

    http://blog.galasoft.ch/posts/2015/04/setting-up-a-vpn-server-on-a-mac-and-using-it-for-xamarin-ios-development/

  • dev_aritradev_aritra Member ✭✭

    Solved this using https://www.netovernet.com/, it's a simple VPN. Connect this from your mac and your windows machine, and you are on a LAN.
    Limitation is for a free version speed is limited to only 4mbps and 3 clients.

Sign In or Register to comment.