創建一個Android App項目后,直接啟動調試發現Visual Studio Emulator for Android已成功運行,但應用始終處於Build中(等待時間超過1小時),並未如預期通過adb部署到模擬器中。將應用直接導出apk,拖拽至模擬器直接部署,提示:
File transfer failed. Error: Unable to install the file through Adb. Adb.exe not found. Make sure you have Android SDK Tools installed.
查看進程列表發現adb.exe已經啟動,並且和Visual Studio有通信,但XDE和adb.exe沒有通信。應該是XDE無法定位Android SDK路徑所致。於是運行Process Monitor,再次嘗試拖拽apk,終於發現XDE查找名為"HKCU\Software\Microsoft\VisualStudioEmulator\Android\AdbPath"的注冊表鍵值,添加對應的鍵值問題解決。懷疑和我並沒有通過Visual Studio直接安裝Android SDK有關系,導致一些設置無法生效。