iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 2
0
Cloud

Xamarin.Forms, ASP.NET Core WEB API搭配AZURE的網站服務與資料庫服務整合應用實例系列 第 2

Day02 - Windows UWP, Windows 8.1與Windows 8.1 Phone 模擬器部署測試

在介紹Windows模擬器部署測試之前, 必須先安裝Hyper-V服務,也順便將ASP.NET 4.6裝上如紅色框框所示
http://ithelp.ithome.com.tw/upload/images/20161203/20103333eUhoFDify6.png

為什麼需要安裝Hyper-V, 因為Windows與Android的模擬器均是跑在Hyper-V裡,

接著在Visual Stduio選擇Blank App(Xamarin.Forms Portable)的專案類型
http://ithelp.ithome.com.tw/upload/images/20161203/20103333AxQ7Yhxvbp.png

接下來因為是OS是Win 10所以需要啟用開發者模式
http://ithelp.ithome.com.tw/upload/images/20161203/20103333NrO6pEBNcg.png

點選如下圖紅色框所示的Developer mode
http://ithelp.ithome.com.tw/upload/images/20161203/20103333GImeUyViMz.png

接著會遇到Mac Agent Remote Login, 這個可以先關閉, 等遇到IOS篇章再做設定
http://ithelp.ithome.com.tw/upload/images/20161203/20103333Gy2eMyor4b.png

接著會選擇Win 10開發部署版本, 直接採默認即可
http://ithelp.ithome.com.tw/upload/images/20161203/20103333kdGDkbryNE.png

接著第一個怪就出現了
http://ithelp.ithome.com.tw/upload/images/20161203/20103333UILqgwjDWQ.png

這個問題的解決方式也很簡單, 請先將App1.UWP設為起始專案, 並且點選Manage NuGet Packages
http://ithelp.ithome.com.tw/upload/images/20161203/20103333BeKqWn2kWH.png

搜尋Microsoft.NETCore.UniversalWindowsPlatform, 並安裝
http://ithelp.ithome.com.tw/upload/images/20161203/20103333ZP1nLWj92C.pnghttp://ithelp.ithome.com.tw/upload/images/20161203/20103333bUW2teHMm7.png

順道一提如遇下列更新, 可以一併安裝
http://ithelp.ithome.com.tw/upload/images/20161203/20103333gO6rHdAKYZ.png
http://ithelp.ithome.com.tw/upload/images/20161203/20103333BmXJP9Mybu.png
http://ithelp.ithome.com.tw/upload/images/20161203/20103333YvJK7oDO3M.png

接著Build UWP專案, 確認沒有任何錯誤
http://ithelp.ithome.com.tw/upload/images/20161203/20103333vOBNcCQgqa.png

再來就是Deploy 專案
http://ithelp.ithome.com.tw/upload/images/20161203/20103333Yvo4EBPxE0.png

若遇底下錯誤, 則須調整編譯設定
http://ithelp.ithome.com.tw/upload/images/20161203/201033334hV7ZFtfGX.png

調整Min version, 再Deploy一次, 確認無任何錯誤
http://ithelp.ithome.com.tw/upload/images/20161203/20103333shmhoC8FqC.png

之後便可以用Simulator做測試
http://ithelp.ithome.com.tw/upload/images/20161203/20103333ODeGViXpWu.png

終於第一個測試畫面終於出來了 ^^/
http://ithelp.ithome.com.tw/upload/images/20161203/20103333pXsRqgXs5u.png

接著使用Mobile Emulator做測試
http://ithelp.ithome.com.tw/upload/images/20161203/20103333QqwX0X87rT.png

使用Mobile Emulator, 就會啟用Hyper-V如下, 由於是跑在Hyper-V, 啟動的時間會等個幾分鐘
http://ithelp.ithome.com.tw/upload/images/20161203/20103333Ik0XO0izAF.png

接著App1.Windows(Windows 8.1), 比照處理先設為啟動專案, 然後先Build再Deploy, 使用Simulator做測試
http://ithelp.ithome.com.tw/upload/images/20161203/20103333a05A0S8U9d.png

測試結果如下
http://ithelp.ithome.com.tw/upload/images/20161203/20103333811FGtnu1Z.png

再來App1.WinPhone (Windows Phone 8.1)也是一樣的方式處理
http://ithelp.ithome.com.tw/upload/images/20161203/201033339vocTdwkBq.png

測試結果如下
http://ithelp.ithome.com.tw/upload/images/20161203/20103333I2WIC0wBVH.png

以上打完收工, 下一篇要用Windows裝置來直接實機部署測試囉


上一篇
Day01 - 動機與Visual Studio安裝環境介紹
下一篇
Day03 - Windows UWP與Windows 8.1實機測試
系列文
Xamarin.Forms, ASP.NET Core WEB API搭配AZURE的網站服務與資料庫服務整合應用實例32
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言