Bug 20684 - Does not detect that Android simulator is started
Summary: Does not detect that Android simulator is started
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: 5.1
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Greg Munn
URL:
Depends on:
Blocks:
 
Reported: 2014-06-18 12:11 UTC by John Miller [MSFT]
Modified: 2014-08-06 09:00 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
XS Logs (4.83 KB, application/zip)
2014-06-18 12:11 UTC, John Miller [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description John Miller [MSFT] 2014-06-18 12:11:05 UTC
Created attachment 7105 [details]
XS Logs

## Overview: 

    Xamarin Studio does not consistently detect that a simulator is launched (started). This started happening in 5.1 using the new menu that shows available emulators. 

## Steps to Reproduce: 

    Here is a screencast of the issue: http://screencast.com/t/W7g9YCJe77B8
    
    1. Create an Android application
    2. Select a simulator in the list
    3. Press Play to begin debugging

## Actual Results: 

    An emulator is launched, but Xamarin Studio continues waiting and a status message says: "Starting {Emulator Name}...".
    Pressing the stop button and trying again causes a second emulator to be launched unsuccessfully again.

## Expected Results: 

    An emulator should be launched and when its ready, the app installed, and debugging started. 

## Build Date & Platform: 

    Xamarin Studio 5.1 (build 462)
    XA 4.14.0 

## Additional Information

   Attached are the logs from Xamarin Studio
Comment 1 Ram Chandra 2014-06-19 05:35:43 UTC
I have checked this issue and with the help of bug description I am able to reproduce this issue.

I observed that when I open an "Android Application" and select an emulator from the list and start debugging. I am getting the same behaviour as mentioned in "Bug Description" and when I press the stop button and and restart debugging XS launch new emulator every time.

Screencast : http://www.screencast.com/t/OPZTSsqwV

IDE logs : https://gist.github.com/saurabh360/cc1b997a49bd231b5e1f
Adb logs: https://gist.github.com/saurabh360/1fa3576ac295be2d9673

Environment Info :

Mac OS X 10.9.2
Xamarin Studio : 5.1 (build 462)
Xamarin Android: 4.14.0 (Enterprise Edition)

=== Build Information ===

Release ID: 501000462
Git revision: b10ce21781bf0fcf528343fc5360198532b5e98c
Build date: 2014-06-12 15:34:39-04
Xamarin addins: 328061aea1cc3bbc194d2dde593ddaee613e7b41
Comment 3 Greg Munn 2014-07-21 12:34:34 UTC
I would like to have seen more in the second screencast prior to when the application was started up. It is showing that it is starting up a different emulator to what was selected and I would like to see more about that.

John, for your example, are you able to see if "adb devices" shows the just started emulator in the list of devices?
Comment 4 John Miller [MSFT] 2014-07-22 16:50:29 UTC
@Greg Munn

Here is a screenshot of the adb devices returning a result for my connected emulator. XS still does not show it:

http://screencast.com/t/I7SiyXcO

This is not always the case, but in this particular scenario I would expect it to work.
Comment 5 Greg Munn 2014-07-22 16:59:21 UTC
@John Miller, thanks. I just looked at the logs you added originally. In the AndroidTools log there is a entry stating "ERROR: Adb server launch operation failed:"

I have noticed this happening when I was looking at another bug where devices wouldn't be detected after closing and re-opening the solution. 

What was happening, and it looks like it happened here as well, is that the result of calling "adb start-server" is being mis-reported as a failure and consequently we don't try to get the device list.

I made some changes to handle this better and I think they may also resolve this issue. The fix should be in a build soon.
Comment 6 Greg Munn 2014-07-30 10:45:30 UTC
I'm going to mark it resolved so that it can be tested against 5.3
Comment 7 Sadik Ali 2014-08-06 09:00:59 UTC
I have check this issue with the following builds:

Xamarin Studio: 5.3 (build 413)
Build Information
Release ID: 503000413
Git revision: 0b0a22314801b920383045d46a578c716f55e481
Build date: 2014-08-06 04:53:22-04
Xamarin addins: 57e379e6a9454a1c0d97aa3f770e7ae7cc16c522

To verify this issue, I have selected an emulator from the list ( no emulator is started before ) and press the start button I observed that  an emulator is launched and application is deployed on emulator(first time). When I stop the  debugging and again press the start button it deploy the application on same emulator doesn't open new emulator.

Screencast: http://www.screencast.com/t/5FyEy1xewQK

This issue has been fixed. Hence I am closing this issue.