Monday, March 30, 2015

Connecting to Android Player using VS and Parallels

This is a short guide for how to connect to Android Player in case you're using Visual Studio in Windows through Parallels. I use to do this in a way more complicated manor before I realized that it's just this simple. Looking ahead, In VS 2015, Microsofts gives us an x86/hyper-V Android emulator that looks great. But for now, this works the best.

Start your engines

Fire up Android Player (or any other emulator of your choice that runs Android) in OS X and get the address to the emulator. Click on the settings cog and note the IP Address.

Connect to the emulator

In Windows, open your project in Visual Studio and hit Tools -> Android -> Android Adb Command Prompt. Write adb connect [the IP address] and you should then be connected to your emulator like in the image below.


Run your project

You should now see your device in Visual Studio!


Troubleshooting

Of course, things can go wrong. The issues I've encountered are these.

1) I had to disable my wireless network while connected to the local wired network. Surely this is a configuration issue that I just haven't bothered with yet.

2) The emulator doesn't show up. Restart Visual Studio.

3) You have to reconnect each time your Mac goes to sleep...

4) Firewalls... Make sure port 5555 is open for TCP from Windows to OS X.

8 comments:

  1. Hopefully this helps other people. I also had to do the following:

    Go into the Parallels' settings and forward ports: Actions -> Configure -> USB & Bluetooth -> USB Connection Preferences -> Advanced (tab) -> Change Settings (under Network) ->Add 2 new Port Forwarding rules ->
    #1 Protocol: TCP, Source Port: 5554, Forward to: (you VM), Destination Port: 5554
    #2 Protocol: TCP, Source Port: 5555, Forward to: (you VM), Destination Port: 5555

    Then I also turned on Remote Login for my user account in my Mac's 'Sharing' settings (not sure if that made a differences or not).

    Finally, I found that I had to:
    1# Open up the ADB Terminal/Console on both my Mac and my Windows VM and type in: adb kill-server on both of them (make sure it works, by not returning any text)

    2# Close Visual Studio in Windows VM

    #3 Open Android Player on my Mac

    #4 Connect to the device from the Mac ADB Terminal (adb connect ) (though sometimes this was unnecessary)

    #5 Connect to the device from my Windows VM's ADB console (same command)

    #6 Open up Visual Studio from my Windows VM

    Even after all of that, I never actually saw the Android device's name is the 'Start' button from Visual Studio like you do with a local emulator, it always just said 'Start', but it would still work when I clicked it.

    ReplyDelete
  2. It can also bring the addresses which have been renamed or renumbered up-to-date by accessing the USPS 'locatable address conversion system'. The correct address saves the Postal Services a lot of time, money and effort.
    crack-serials.com/driver-toolkit-key-crack-get-now

    ReplyDelete
  3. The influence of the end user leaving adverse feedback versus an App can decide no matter whether or not an App is successful or not, its as basic as that. Make money

    ReplyDelete
  4. Android app development company in Gurgaon. We have well knowledge mobile app Development by using java and android game.
    showboxdownloadsapp.com

    ReplyDelete
  5. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas. see this

    ReplyDelete
  6. In this world of ever growing technology, we can easily watch the latest movies or tv shows by streaming on different websites.
    Now we can even watch the movies and TV shows on our Android or Windows smartphones
    ShowBox Download

    ReplyDelete