Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 321. Visual Studio Emulator for Android 소개 [링크 복사], [링크+제목 복사]
조회: 16202
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Visual Studio Emulator for Android 소개

모바일 관련 설치 옵션과 함께 Visual Studio 2017을 설치한 경우 Xamarin 모바일 앱을 빌드하면 기본적으로 에뮬레이터가 "VisualStudio_android-23_x86_phone (Android 6.0 - API 23)"과 같은 항목이 선택됩니다. 이름에서 알 수 있듯이 "x86" 프로세서 용으로 빌드된 것으로 ARM 빌드 버전보다 속도가 빠릅니다. 그런데, Hyper-V가 설치된 환경에서 이를 실행하면 다음과 같은 오류 메시지와 함께 에뮬레이터가 동작하지 않습니다.

1>------ Build started: Project: MyFirstApp.Android, Configuration: Debug Any CPU ------
1>  MyFirstApp.Android -> C:\temp\MyFirstApp\MyFirstApp\MyFirstApp.Android\bin\Debug\MyFirstApp.Android.dll
2>Starting deploy VisualStudio_android-23_x86_phone ...
2>Starting emulator VisualStudio_android-23_x86_phone ...
2>C:\PROGRA~2\Android\ANDROI~1\tools\emulator.EXE -partition-size 512 -no-boot-anim -avd VisualStudio_android-23_x86_phone -prop monodroid.avdname=VisualStudio_android-23_x86_phone
2>emulator: ERROR: x86 emulation currently requires hardware acceleration!
2>Please ensure Intel HAXM is properly installed and usable.
2>CPU acceleration status: Please disable Hyper-V before using the Android Emulator.  Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.
2>Emulator VisualStudio_android-23_x86_phone cannot be started.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

이것 때문에 Hyper-V를 끄자니 여러 가지로 불편하게 되었는데요. 물론, 다음과 같이 설정해서 원하는 모드로 부팅할 수 있지만,

윈도우 8에서 Hyper-V 유무에 따른 듀얼 부트 설정하는 방법
; https://www.sysnet.pe.kr/2/0/1676

역시 부팅 자체가 불편합니다. 그렇다고 ARM 버전의 "VisualStudio_android-23_arm_phone (Android 6.0 - API 23)" 에뮬레이터를 이용하자니, 속도가 10배나 느리다는 말은 둘째치고, 정말 느린 속도에 에뮬 환경을 포기하고 싶어집니다. ^^;

그런데, 이런 불편함을 마이크로소프트가 전용 에뮬레이터를 내놓음으로써 말끔히 해결했습니다. ^^

Visual Studio Emulator for Android
; https://www.visualstudio.com/ko/vs/msft-android-emulator

Visual Studio Android Emulator
; https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/visual-studio-android-emulator/

Visual Studio 2015 사용자는 위의 링크에서 다운로드할 수 있고, 2017 사용자는 설치 파일에서 다음과 같이 "Visual Studio Emulator for Android" 구성 요소를 선택하면 됩니다.

[그림 출처: https://social.msdn.microsoft.com/Forums/vstudio/en-US/34d06dea-0bb4-4c67-a115-d739f7be91c7/visual-studio-2017-emulator-for-android]
and_emul_0.png

그럼 다음과 같이 "Tools" / "Visual Studio Emulator for Android..." 메뉴가 제공되고,

[그림 출처: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/visual-studio-android-emulator/]
and_emul_1.png

동작 속도는, 예전 Windows Phone 에뮬레이터만큼의 쾌적함을 제공합니다. ^^




참고로, Visual Studio에서 Emulator를 시작할 때 다음과 같은 오류가 발생할 수 있습니다.

2>Starting deploy 5" KitKat (4.4) XXHDPI Phone ...
2>Starting emulator 5" KitKat (4.4) XXHDPI Phone ...
2>An error occured. See full exception on logs for more details.
2>Object reference not set to an instance of an object.

이런 경우에는, "Tools" / "Visual Studio Emulator for Android..." 메뉴를 실행해 직접 해당 Emulator를 시작, 다음과 같이 권한 승인을 요구하는 창을 거치기만 하면 됩니다. (한 번만 필요합니다.)

and_emul_2.png




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 7/11/2017]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 



2017-07-14 12시01분
Visual Studio 2017의 경우 설치 파일을 "C:\Program Files (x86)\Microsoft Visual Studio\Installer" 폴더의 vs_installer.exe를 실행시키면 됩니다.
정성태
2018-05-08 11시00분
Android emulator를 아예 hyper-v 호환으로 내놓는군요. ^^

Hyper-V Android emulator support
; https://devblogs.microsoft.com/visualstudio/hyper-v-android-emulator-support/

HAXM v7.8.0 (INTEL CPU)
; https://github.com/intel/haxm/releases

Android Emulator hypervisor driver 2.1 (AMD & INTEL CPU)
; https://github.com/google/android-emulator-hypervisor-driver/releases
정성태

... 31  32  33  34  35  36  37  38  [39]  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
12650정성태5/17/20217943기타: 82. OpenTabletDriver의 버튼에 더블 클릭을 매핑 및 게임에서의 지원 방법
12649정성태5/16/20219292.NET Framework: 1059. 세대 별 GC(Garbage Collection) 방식에서 Card table의 사용 의미 [1]
12648정성태5/16/20217946사물인터넷: 66. PC -> FTDI -> NodeMCU v1 ESP8266 기기를 UART 핀을 연결해 직렬 통신하는 방법파일 다운로드1
12647정성태5/15/20219178.NET Framework: 1058. C# - C++과의 연동을 위한 구조체의 fixed 배열 필드 사용파일 다운로드1
12646정성태5/15/20218303사물인터넷: 65. C# - Arduino IDE의 Serial Monitor 기능 구현파일 다운로드1
12645정성태5/14/20218024사물인터넷: 64. NodeMCU v1 ESP8266 - LittleFS를 이용한 와이파이 접속 정보 업데이트파일 다운로드1
12644정성태5/14/20219166오류 유형: 719. 윈도우 - 제어판의 "프로그램 및 기능" / "Windows 기능 켜기/끄기" 오류 0x800736B3
12643정성태5/14/20218339오류 유형: 718. 서버 유형의 COM+ 사용 시 0x80080005(Server execution failed) 오류 발생
12642정성태5/14/20219263오류 유형: 717. The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
12641정성태5/13/20218967디버깅 기술: 179. 윈도우용 .NET Core 3 이상에서 Windbg의 sos 사용법
12640정성태5/13/202111909오류 유형: 716. RDP 연결 - Because of a protocol error (code: 0x112f), the remote session will be disconnected. [1]
12639정성태5/12/20218795오류 유형: 715. Arduino: Open Serial Monitor - The module '...\detection.node' was compiled against a different Node.js version using NODE_MODULE_VERSION
12638정성태5/12/20219707사물인터넷: 63. NodeMCU v1 ESP8266 - 펌웨어 내 파일 시스템(SPIFFS, LittleFS) 및 EEPROM 활용
12637정성태5/10/20219364사물인터넷: 62. NodeMCU v1 ESP8266 보드의 A0 핀에 다중 아날로그 센서 연결 [1]
12636정성태5/10/20219535사물인터넷: 61. NodeMCU v1 ESP8266 보드의 A0 핀 사용법 - FSR-402 아날로그 압력 센서 연동파일 다운로드1
12635정성태5/9/20218864기타: 81. OpenTabletDriver를 (관리자 권한으로 실행하지 않고도) 관리자 권한의 프로그램에서 동작하게 만드는 방법
12634정성태5/9/20217957개발 환경 구성: 572. .NET에서의 신뢰도 등급 조정 - 외부 Manifest 파일을 두는 방법파일 다운로드1
12633정성태5/7/20219406개발 환경 구성: 571. UAC - 관리자 권한 없이 UIPI 제약을 없애는 방법
12632정성태5/7/20219571기타: 80. (WACOM도 지원하는) Tablet 공통 디바이스 드라이버 - OpenTabletDriver
12631정성태5/5/20219503사물인터넷: 60. ThingSpeak 사물인터넷 플랫폼에 ESP8266 NodeMCU v1 + 조도 센서 장비 연동파일 다운로드1
12630정성태5/5/20219826사물인터넷: 59. NodeMCU v1 ESP8266 보드의 A0 핀 사용법 - CdS Cell(GL3526) 조도 센서 연동파일 다운로드1
12629정성태5/5/202111568.NET Framework: 1057. C# - CoAP 서버 및 클라이언트 제작 (UDP 소켓 통신) [1]파일 다운로드1
12628정성태5/4/20219535Linux: 39. Eclipse 원격 디버깅 - Cannot run program "gdb": Launching failed
12627정성태5/4/202110241Linux: 38. 라즈베리 파이 제로 용 프로그램 개발을 위한 Eclipse C/C++ 윈도우 환경 설정
12626정성태5/3/202110248.NET Framework: 1056. C# - Thread.Suspend 호출 시 응용 프로그램 hang 현상 (2)파일 다운로드1
12625정성태5/3/20219208오류 유형: 714. error CS5001: Program does not contain a static 'Main' method suitable for an entry point
... 31  32  33  34  35  36  37  38  [39]  40  41  42  43  44  45  ...