{"id":9561,"date":"2015-07-20T07:42:00","date_gmt":"2015-07-20T07:42:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/07\/20\/using-the-visual-studio-emulator-for-android-from-android-studio-or-eclipse-with-adt\/"},"modified":"2022-08-01T06:35:52","modified_gmt":"2022-08-01T14:35:52","slug":"using-the-visual-studio-emulator-for-android-from-android-studio-or-eclipse-with-adt","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/using-the-visual-studio-emulator-for-android-from-android-studio-or-eclipse-with-adt\/","title":{"rendered":"Using the Visual Studio Emulator for Android from Android Studio or Eclipse with ADT"},"content":{"rendered":"<p>Since <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/12\/introducing-visual-studio-s-emulator-for-android.aspx\">announcing our fast, free, Hyper-V compatible Android emulator<\/a>, we\u2019ve heard that some of you are using Android Studio or Eclipse as your primary Android development environment and still want to acquire the best emulator on the planet without necessarily having to also install Visual Studio.<\/p>\n<p>That\u2019s why we\u2019re excited to announce that <strong>we\u2019ve made the Visual Studio Emulator for Android available without needing to also download Visual Studio<\/strong>. Regardless of how you get our emulator, let\u2019s talk about how you can use it with any Android developer tools of your choice.<\/p>\n<h2>Getting started<\/h2>\n<p>You can <a href=\"https:\/\/aka.ms\/blogdownloadvsemu\">download the emulator directly here<\/a> or <a href=\"https:\/\/aka.ms\/vsemu\">from our VisualStudio.com page<\/a>. Once you\u2019ve installed the emulator, an entry will appear in your start menu for the \u201cVisual Studio Emulator for Android.\u201d Clicking this will bring up our emulator manager, which allows you to install and start device profiles. By default, we\u2019ve installed a few KitKat profiles so you can quickly get up and running.<\/p>\n<p>On your first launch, we ask that you activate a free license by signing in to an Azure Active Directory or Microsoft Account. If you\u2019ve used any Microsoft service before (eg. Office 365, Azure, Windows Live, sign in with Windows), that same account will work here. If you\u2019d rather wait to sign in, you can click \u201cNot now, maybe later\u201d underneath the sign-in button to defer activating your free license for 30 days. If you do not have a Microsoft Account, <a href=\"http:\/\/signup.live.com\/?lw=1&amp;fl=easi2&amp;noauthcancel=1\">you can create one first here<\/a>, then return to the sign in dialog and use your newly-created account.<\/p>\n<p>Once you\u2019re in the emulator manager, you can start the emulator by clicking the green \u201cplay\u201d button. To learn about all of the cool features of the emulator, <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/12\/introducing-visual-studio-s-emulator-for-android.aspx\">check out this blog post<\/a>.<\/p>\n<h2>Work in Android Studio or Eclipse with ADT<\/h2>\n<p>The emulator connects to ADB (Android Debug Bridge) as if it were a USB-connected device, but here\u2019s a few tips for a smoother experience using Android Studio or Eclipse with ADT.<\/p>\n<h3>Android Studio<\/h3>\n<p>By default, Android Studio will want to debug to the slow Android SDK emulator. You can configure Android Studio to allow you to select a target by doing the following:<\/p>\n<ol>\n<li>In Android Studio, go to the <em>Run<\/em> menu and click <em>Edit Configurations\u2026<\/em><\/li>\n<li>Under <em>Defaults<\/em> \/ Android Application, set <em>Target Device<\/em> to <em>Show chooser dialog<\/em><\/li>\n<li>Check <em>Use same device for future launches<\/em><\/li>\n<\/ol>\n<p style=\"text-align: left\">\n  \u00a0<a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/8311.standalone-as20run20debug.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/8311.standalone-as20run20debug.png\" alt=\"\" border=\"0\" \/><\/a>\n<\/p>\n<p>This will prompt you to select an ADB-connected device when you debug the first time, then remember that device for subsequent debugging sessions.<\/p>\n<p>Another tip is to create a toolbar item for tasks like quick-launching the emulator manager or starting particular device profile. To do this,<\/p>\n<ol>\n<li>Go to <em>File<\/em> > <em>Settings<\/em> >* External Tools*\n<li style=\"text-align: left\">\nClick <em>Add<\/em><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/1667.standalone-as20add.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/1667.standalone-as20add.png\" alt=\"\" border=\"0\" \/><\/a><\/p>\n<\/li>\n<li style=\"text-align: left\">\nIn the <em>Create Tool<\/em> dialog, enter a name and description for the task, then fill in the <em>Program<\/em> &amp; <em>Parameters<\/em> with the following values (depending on the task): <\/li>\n<\/ol>\n<table style=\"border: 1px solid black\" border=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td>\n          <strong>Task<\/strong>\n        <\/td>\n<td>\n          <strong>Program<\/strong>\n        <\/td>\n<td>\n          <strong>Parameters<\/strong>\n        <\/td>\n<\/tr>\n<tr>\n<td>\n          Quick-launch a particular profile\n        <\/td>\n<td>\n          <span style=\"font-family: 'courier new', courier\">\u00a0C:Program Files (x86)Microsoft Emulator Manager1.0emulatorcmd.exe<\/span>\n        <\/td>\n<td>\n          <span style=\"font-family: 'courier new', courier\">\u00a0\/sku:Androi<span style=\"font-family: 'courier new', courier\">d<\/span> launch \/id:<\/span>[id of profile you want to launch]\n        <\/td>\n<\/tr>\n<tr>\n<td>\n          \u00a0Open emulator manager\n        <\/td>\n<td>\n          <span style=\"font-family: 'courier new', courier\">\u00a0C:Program Files (x86)Microsoft Emulator Manager1.0emulatormgr.exe<\/span>\n        <\/td>\n<td>\n          <span style=\"font-family: 'courier new', courier\">\u00a0\/sku:Android<\/span>\n        <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><em>You can get the id of a profile by running <span style=\"font-family: courier new,courier\">emulatorcmd.exe \/sku:Android list \/type:device<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/0882.standalone-as20filled20out.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/0882.standalone-as20filled20out.png\" alt=\"\" border=\"0\" \/><\/a><\/p>\n<p><\/span>\n<\/li>\n<p>2.  Click *OK<\/em> to finish editing the external tool, and <em>OK<\/em> again once you\u2019ve added all of your tasks to close the Settings dialog.<\/p>\n<li style=\"text-align: left\">\n  Right-click on the Android Studio toolbar and click <em>Customize Menus and Toolbars\u2026<\/em><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/4555.standalone-as20toolbar20dd.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/4555.standalone-as20toolbar20dd.png\" alt=\"\" width=\"281\" height=\"100\" \/><\/a><\/p>\n<\/li>\n<p>3.  Under <em>Main Toolbar<\/em>, identify where you want the new toolbar icon to appear, and click <em>Add After\u2026<\/em><\/p>\n<li style=\"text-align: left\">\n  Pick the external tool you created under <em>External Tools<\/em> and click <em>OK<\/em>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/8738.standalone-as20tb20add.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/8738.standalone-as20tb20add.png\" alt=\"\" border=\"0\" \/><\/a><\/p>\n<\/li>\n<p>4.  Click <em>OK<\/em> again to close the <em>Menus and Toolbars<\/em> dialog<\/p>\n<p>Now you\u2019re all ready to quickly start profiles and use the emulator manager directly from Android Studio!<\/p>\n<p style=\"text-align: left\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/5557.standalone-as20tb20done.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/5557.standalone-as20tb20done.png\" alt=\"\" width=\"241\" height=\"150\" \/><\/a>\u00a0\n<\/p>\n<h3>Eclipse with ADT<\/h3>\n<p>The steps for Eclipse with ADT are very similar to those above, with these modifications:<\/p>\n<ul>\n<li>\n<p>The option for picking a device before debugging is under <em>Run<\/em> > <em>Debug Configurations\u2026<\/em> > Navigate to the <em>Target<\/em> tab and select <em>Always prompt to pick device<\/em><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/5857.standalone-ec20run20debug.png\" alt=\"\" border=\"0\" \/><\/p>\n<\/li>\n<li>\n<p>External tools are configured under <em>Run<\/em> > <em>External Tools<\/em> > <em>External Tools Configurations\u2026<\/em> The terms <em>Location<\/em> and <em>Arguments<\/em> replace <em>Program<\/em> and <em>Parameters<\/em> in Android Studio<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/6740.standalone-ec20filled20out.png\" alt=\"\" border=\"0\" \/><\/p>\n<\/li>\n<li>\n<p>The entry will appear automatically on your Debug toolbar in the <em>External Tools Run<\/em> dropdown<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/07\/6011.standalone-ec20done.png\" alt=\"\" width=\"381\" height=\"135\" \/><\/p>\n<\/li>\n<\/ul>\n<h2>Wrap up<\/h2>\n<p>We at Microsoft are excited to be able to offer you a fast, fully-featured emulator for free and <a href=\"https:\/\/aka.ms\/blogdownloadvsemu\">available as a standalone download here<\/a>. We\u2019d also love to hear your feedback to help us build an even better emulator for Android developers, so drop us a line in the comments, use the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/mt280277.aspx\">Send-a-Smile<\/a> tool in Visual Studio or in the Emulator Manager, and ask us for help <a href=\"http:\/\/stackoverflow.com\/questions\/tagged\/android-emulator\">on StackOverflow using the android-emulator and visual-studio tags<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since announcing our fast, free, Hyper-V compatible Android emulator, we\u2019ve heard that some of you are using Android Studio or Eclipse as your primary Android development environment and still want to acquire the best emulator on the planet without necessarily having to also install Visual Studio. That\u2019s why we\u2019re excited to announce that we\u2019ve made [&hellip;]<\/p>\n","protected":false},"author":164,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-9561","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>Since announcing our fast, free, Hyper-V compatible Android emulator, we\u2019ve heard that some of you are using Android Studio or Eclipse as your primary Android development environment and still want to acquire the best emulator on the planet without necessarily having to also install Visual Studio. That\u2019s why we\u2019re excited to announce that we\u2019ve made [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/9561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/164"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=9561"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/9561\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=9561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=9561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=9561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}