2015-11-07 101 views
2

我想爲android做一個遊戲,但我不想用java編程。Visual Studio C++和Android模擬器?

Visual Studio中有在C++中的Android應用程序的支持,當我啓動/調試應用它說:

Severity Code Description Project File Line 
Error  Error installing the package. The device '' is invalid or not running. Please switch to another device, or use the Android Virtual Device (AVD) Manager to start a compatible emulator, or connect a compatible Android device. Android1_test.Packaging  0 

我已經安裝了xamarin仿真器,但我不能調試我的項目到這一點,我不噸有安裝「微軟的Visual Studio模擬器爲Android」,當我嘗試安裝它,我得到一個錯誤「設置封殺」,這:

This computer does not support the Visual Studio Emulator for Android, which requires a 64-bit Windows 8/8.1/10 Pro/Enterprise edition or Window Server 2012 or above and a computer that supports Hyper-V. For more information, see System Requirements for Visual Studio Emulator for Android (https://msdn.microsoft.com/en-us/library/mt228280.aspx). 

我是否需要安裝「Hyper-V服務器2012 .. 。「 或者其他的東西?

編輯:我有Windows 10 Home,它不支持Hyper-V。感謝你微軟(Windows 10 Pro(129.99美元)支持Hyper-V)

+1

查看更近:「需要64位Windows 8/8.1/10 Pro/Enterprise版或Window Server 2012或更高版本」「和支持Hyper-V的計算機」 – melak47

+0

您正在使用的是哪個版本的Windows?該錯誤消息特別提到** 64位**和** Windows 8 Pro/Enterprise **或更新版本。 – GreatAndPowerfulOz

+0

我有Windows 10 Home 64位,可以給我Hyper-V的鏈接嗎? – iUuax

回答

-1

Android與API級別9,發佈了一種方法來創建真正的C++應用程序。這種方法稱爲NativeActivity,許多流行的遊戲引擎如Unreal和其他人使用這種機制。 Visual Studio附帶Visual Studio Android Emulator,您可以下載它以獲得OOTB體驗。

希望這會有所幫助,如果您還有其他問題或經驗,請隨時聯繫[email protected]

enter image description here

0

Visual Studio的仿真器Android是非常不錯的使用,但正如你已經發現,這只是上運行的Windows版本支持Hyper-V,這還不包括機器可用家庭版本。你需要一個Pro版本才能獲得該功能。幸運的是,這不是使用Visual Studio開發Android應用程序的唯一選擇。 Android SDK附帶一個基本的模擬器,可以在Windows 7,8.1或10家庭版上運行,雖然它不如性能(閱讀:它使蝸牛看起來很快)。英特爾有一個更可容忍的解決方案稱爲HAXM(硬件加速執行管理器),您可以嘗試。 HAXM是專門爲支持Android開發快速仿真而設計的Hyper-V的替代品(換句話說,您無法同時運行HAXM和Hyper-V)。要使用它,您需要有支持VT-x和XD的64位Intel處理器,這些指令用於啓用VM支持。 Intel provides installation instructions here

另一種選擇是使用USB電纜連接Android設備。大多數設備都允許您在設置中啓用開發人員選項。這裏有一些common instructions on enabling Developer Options,但在某些情況下,您需要查看如何爲您的特定設備執行此操作,因爲它有所不同。使用開發人員選項啓用USB連接將Android設備連接到計算機時,該設備將出現在Visual Studio部署目標的下拉列表中。您可以直接將代碼部署到它並以與模擬器相同的方式遠程調試它。一定要將您的構建配置與您的目標設備的架構相匹配。仿真器使用x86代碼,而大多數(不是全部)Android設備都具有ARM處理器。

相關問題