How can I attach a virtual device/emulator to Visual Studio Xamarin Android project?

13,558

Awesome that you got it working.

I found that list doesnt always update and a restart of Visual Studio was the quickest way to get the emulator in the list of devices to debug against.

If that doesnt work, try restarting the ADB service.

  • Start the emulator.
  • Open up a command prompt, browse to the location of the Android SDK (default is '%LocalAppData%\Android\android-sdk\platform-tools').
  • Run the command 'adb kill-server'.
  • Run 'adb devices' (this should show the running emulator as an attached device).
  • Restart VS and you should see the emulator in the list.
Share:
13,558
B. Clay Shannon-B. Crow Raven
Author by

B. Clay Shannon-B. Crow Raven

My novel about climate change and social justice featuring talking animals traveling through time and space to prevent disasters is now available on amazon, in three formats: Taterskin & The Eco Defenders Kindle eBook; Taterskin & The Eco Defenders Paperback; Taterskin & The Eco Defenders Hardcover Taterskin & The Eco Defenders, told in “first canine” by the titular character, a Labrador Retriever, is the story of a few humans and several talking animals who travel through time and space to make the past—and thus the future—a better place. The improvements effected by the Eco Defenders benefit not just the earth itself, but also mistreated humans and animals. In Book 1 (“Wonders Never Cease”), The Eco Defenders travel 150 million years into the past, to meet a Pterodactyl and make plans to “nip Nazism in the bud.” After that, it's on to 1787 Australia to protect the indigenous people and the environment there. The Eco Defenders next go to India, where they assemble animals from all over that country to put an end to Thuggee and fights to the death between Cobras and Mongooses. Their final stop is 1885 Africa, where the Eco Defenders band together with the local animals to prevent King Leopold of Belgium from taking control of the Congo, following which they put an end to the poaching of animals throughout the continent. Book 2 (“Tell it to Future Generations”) takes up with the Eco Defenders following up on their earlier adventures by 1) Preventing the American Civil War in 1861, after which a slave they free joins them; 2) Saving the Indians from being massacred at Wounded Knee in 1890, following which Chapawee, a Sioux Indian, joins the Eco Defenders; 3) Putting an end to the practice of vivisection (experimentation on live animals) in 1903; 4) Coming to the aid of exploited workers in 1911 Manhattan, saving hundreds from the Triangle Shirtwaist Fire; and 5) Traveling to the Amazon Basin in 1978 to protect and preserve the Amazon rainforest. @@@@@@@@@@@@@@@@@@@@@@@ I have lived in eight states; besides my native California (where I was born and where I now again reside), in chronological order I have infested: New York (Brooklyn), Montana (Helena), Alaska (Anchorage), Oklahoma (Bethany), Wisconsin (New Berlin and Oconomowoc), Idaho (Coeur d'Alene), and Missouri (Piedmont). I am a writer of both fiction (for which I use the nom de guerre "Blackbird Crow Raven", as a nod to my Native American heritage - I am "½ Cowboy, ½ Indian") and nonfiction, including a two-volume social and cultural history of the U.S. which covers important events from 1620-2006 and can be downloaded gratis here.

Updated on June 11, 2022

Comments

  • B. Clay Shannon-B. Crow Raven
    B. Clay Shannon-B. Crow Raven about 2 years

    I created an Android app for Ice Cream Sandwich and added nothing to the default code (except changing the text of the "Hello World" message - I couldn't - or wouldn't - help myself).

    I mashed F5.

    Nada - no device attached. The dropdown list says "No Devices Attached."

    So, I set one up via the "Open Android Emulator Manager" button that the Xamarin install added:

    enter image description here

    I mashed F5 again; same problem. It said to pick a device from the dropdown list (I had forgotten to explicitly choose the one I just set up). But...there's nothing in the list. Why not?

    UPDATE

    It's working now; I reckon it was not showing me my device for selection because some Android packages were downloading in the background (via the "Android SDK Manager", also added by Xamarin).

    I feel transported back two years, when I was "messing around with" Eclipse/Android/Java.

  • Jer
    Jer about 8 years
    I was looking for exactly this problem. You saved my day!
  • MarzSocks
    MarzSocks over 7 years
    You can restart ADB server directly within visual studio: Tools > Android > Restart Adb Server