locked
Connect to genymotion in OS X from VS running in Parallels? RRS feed

  • Question

  • User5524 posted

    I have the following configuration: - Genymotion installed in OS X - Parallels with Visual Studio + Xamarin

    I followed this guide and managed to get it so that I can F5 from VS into a standard emulator, but now I'm trying to get the same thing working with genymotion and I'm stuck. When I run 'adb devices' in Windows, it won't list the genymotion emulator. I think the issue is that the genymotion emulator runs on its own IP address, and I can't figure out how to get the SSH tunneling to point at that address. I also tried to skip the SSH trick and just tell ADB to connect to 192.168.56.101:5555 (genymotion emulator IP) but my Windows VM can't see that IP address (maybe its related to my virtual network adapter settings?).

    Has anyone figure out how to make this work?

    Saturday, December 14, 2013 12:41 AM

All replies

  • User5524 posted

    I figured it out. You need another SSH tunnel from the host to the genymotion emulator. It turned out this was pretty simple. From OS X run:

    ssh -L 5555:192.168.56.101:5555 -N 127.0.0.1

    where 192.168.56.101 is the IP of your genymotion emulator

    Next in Windows kill adb using 'adb kill-server' and then start it again using 'adb connect localhost'. Then if you run 'adb devices' you should see localhost:5555 in the list. Now run VS (restart it if its already running), it should connect to the new adb instance and you should see your genymotion emulator in the dropdown.

    I now get to enjoy the benefits of a super fast Android emulator + VS + Xamarin on my macbook :)

    Saturday, December 14, 2013 1:40 AM
  • User20490 posted

    @PaulBaturn - When I start GenyMotion in OS X, Parallels Desktop crashes claiming incompatible virtualization with VirtualBox. How did you get around this?

    Friday, January 10, 2014 10:05 PM
  • User5524 posted

    Ah, I forgot about this step. I got the relevant info from this thread: https://groups.google.com/forum/#!topic/genymotion-users/bkJQ7bxOxTw

    Specifically, I went into virtualbox and disabled vt-x under settings->system->acceleration.

    Friday, January 10, 2014 11:04 PM
  • User35813 posted

    Paul,

    I have GenyMotion running on my PC.. I executed your commands - adb devices and see List of devices attached 192.168.56.101:5555 device

    How do I get VS to recognize this in VS?? I looked under tools and other menus...

    Saturday, January 25, 2014 6:28 AM
  • User5524 posted

    Just to make sure that the rest of your setup is working, were you able to get VS to recognize a standard (non-genymotion) emulator running on your mac as explained in the linked article above? If that is working then the extra SSH tunnel is all you should really need for it to see the genymotion emulator. I did notice that I had to restart VS after establishing the ADB connection.

    Monday, January 27, 2014 5:15 PM
  • User18034 posted

    Thank you so much for this post! Finally I can run Genymotion and Parallels! On my iMac core i7 it is no problem to run Genymotion without hardware acceleration.

    One important note still: if you disable "VT-X" and your Android device has more than one CPU, the setting will be turned on again silently! Be sure to set the CPU cores to 1 before changing the setting!

    Thursday, January 30, 2014 9:54 AM
  • User18034 posted

    @PaulBatum I got Genymotion running together with Parallels. However I fail to connect to the Emulator from VS. If I check the Wifi setting in the Android Image, its IP is 10.0.3.15 which is a totally different range than my other machines have (192.*). On Mac OS I tried ssh -L 5555:10.0.3.15:5555 -N 127.0.0.1 and it asks me for my password. If I enter it, nothing happens. Is that normal? The terminal window is basically blocked until I press CTRL+C.

    On Windows if I follow your instructions I get:

    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    unable to connect to localhost:5555
    

    Any ideas?

    Thursday, January 30, 2014 11:04 AM
  • User18034 posted

    I figured out an alternative solution: switch Paralells Desktop network connection to "Shared". Then, use the IP that is shown in the toolbar of the running Genymotion device (192.168.56.101 in my case). On Windows you can then directly connect to it without using SSH:

    adb connect 192.168.56.101

    Thursday, January 30, 2014 1:13 PM
  • User18034 posted

    I put together my experiences in a blog post - maybe it will help others: http://krumelur.me/2014/01/30/xamarins-visual-studio-plugin-missing-android-devices-genymotion-and-parallels-desktop-dont-panic/

    Thursday, January 30, 2014 3:15 PM
  • User1236 posted

    Hi

    Following the previous details in this thread I'm able to successfully connect to an API 16 Genymotion emu (running on my MAC host) from Visual Studio running in a WMWare Fusion guest. I can deploy in VS to the emu fine. However, if I try the same with an API 19 emu the 'adb connect IP' command appears to work but the emu always shows as offline with 'adb devices'?

    As of Android v4.2.2 there is a security dialog that needs to be OK'd on the device to enable debugging it seems but this never gets displayed on the emu when I connect

    Has anybody else managed to get API19 v4.2.2 and above GenyMotion emus to work?

    Wednesday, April 23, 2014 2:04 PM
  • User15638 posted

    Gazp this looks like it is just an incompatibility with Xamarin and API 19 in general:

    http://stackoverflow.com/questions/22672355/application-fails-to-deploy-to-android-intel-emulator-on-api-19-platform-4-4-2

    Thursday, May 1, 2014 3:50 PM
  • User2927 posted

    @Krumelur I tried to follow your article, but I wasn´t sucess :/

    This ssh -f -L 5555:192.168.56.101:5555 -N 127.0.0.1 fails and this

        adb kill-server
    

    fails too.

    Any tip for it?

    Thursday, February 19, 2015 11:32 PM
  • User24315 posted

    @Gazp I know this is an old thread, but did you ever manage to find a solution to your 'offline' emulators?

    I am experiencing the same problem and am struggling to find a solution.

    Monday, September 21, 2015 4:22 PM
  • User1236 posted

    @MarkRiley I now use the Xamarin Android Player (instead of the GenyMotion emus) directly on my Mac with XS with no adb connectivity issues as opposed to using VS in a VM so I'm afraid I can't suggest much. Do you get the same behaviour with the Xamarin Android Player emus?

    Thursday, September 24, 2015 12:02 PM
  • User24315 posted

    Thanks @Gazp. I only just found out about the Xamarin Android Player. I have now tried it and it seems to solve the 'offline' problem when connecting via a VM.

    Thursday, September 24, 2015 1:53 PM
  • User122934 posted

    Or you could just open Xamarin Studio on your Mac and point it to your Windows VM solution file... but who wants to make things easy for themselves!

    Tuesday, December 13, 2016 3:36 AM
  • User73404 posted

    Fellows, there's a solution for the problem of Genymotion simulators appearing off-line in ADB after completing all steps (https://forums.xamarin.com/discussion/comment/51209/#Comment_51209). You can find detailed instructions at https://ihamlin.co.uk/2017/01/25/genymotion-adb-connect-device-offline.html . I have added the basics here in case the link dies in the future:

    1. Close all existing Genymotion devices
    2. Kill any existing adb processes on the Mac
    3. Update the Genymotion settings to set a custom SDK path, but leave the path empty.
    4. Relaunch the Genymotion device
    5. When asked if you wish to use the default SDK select No
    Friday, March 24, 2017 11:44 AM
  • User122934 posted

    @"DimitarDobrev.0834" Thank you!!! Very cool, works great.

    Sunday, March 26, 2017 1:53 AM