在 Unreal 中部署至裝置Deploy to device in Unreal

有兩種方式可將 Unreal 應用程式部署至 HoloLens 2:There are two ways to deploy an Unreal application to HoloLens 2:

  • 直接從 Unreal 編輯器Directly from the Unreal editor
  • 作為透過裝置入口網站上傳的套件As a package uploaded via the device portal

這兩個選項都需要您設定 HoloLens,才能使用 裝置入口網站 進行開發。Both options require you to set up your HoloLens to use the device portal for development.

從 Unreal 編輯器部署至裝置Deploying to device from the Unreal editor

  1. 選取 [ 啟動 ] 按鈕旁的下拉式箭號。Select the dropdown arrow next to the Launch button. 一開始,HoloLens 裝置選項將會呈現灰色。Initially, the HoloLens device option will be grayed out.

啟動下拉式選項

  1. 開啟 裝置管理員 ,請注意,您的 HoloLens 不會自動出現在裝置清單中。Open the Device Manager and note that your HoloLens won't automatically appear in the device list.

  2. 展開 [ 新增未列出的裝置 ] 區段。Expand the Add An Unlisted Device section.

  3. 選取 [ HoloLens ] 作為您的 平臺Select HoloLens as your Platform.

  4. 輸入裝置的 IP 位址和埠資訊(以冒號分隔)作為裝置識別碼。Enter your devices' IP address and port information separated by a colon as the device identifier. 例如,透過 USB) 連接時 ("127.0.0.1: 10080"。For example, "127.0.0.1:10080" (when connected via USB). 使用您的裝置入口網站使用者名稱和密碼認證。Use your Device Portal username and password credentials.

  5. 點擊 [ 新增 ] 並關閉 [裝置管理員]。Hit Add and close the device manager.

    • 如果發生錯誤(例如錯誤的位址或使用者認證),則會將訊息列印至輸出記錄檔。If there's an error, such as wrong address or user credentials, a message will print to the Output Log.

新增未列出的裝置

  1. 再次選取 [ 啟動 ] 按鈕旁的下拉箭號,這次您應該會看到您剛剛新增的 HoloLens 裝置。Select the dropdown arrow next to the Launch button again - this time you should see the HoloLens device you just added. 選取要建立並部署到 HoloLens 的 HoloLens 裝置。Select the HoloLens device to build and deploy to your HoloLens.

注意

建立裝置可能需要重新編譯著色器 (特別是在第一次執行) 上-這可能需要一些時間。Building for the device may involve recompiling shaders (especially on the first run)- this can take a while. 請勿讓裝置進入睡眠狀態,直到應用程式正在執行 (您可能必須將其磨損) 。Don't let the device go to sleep until the app is running (you may have to wear it). 否則著色器編譯將會失敗!Otherwise shader compilation will fail!

透過裝置入口網站部署至裝置Deploying to device via device portal

您可以在 Unreal 教學課程系列中找到封裝和部署應用程式的詳細指示。You can find detailed instructions on packaging and deploying an app in the Unreal tutorial series.

下一個開發檢查點Next Development Checkpoint

如果您正遵循我們所配置的 Unreal 開發旅程,您就會在部署階段。If you're following the Unreal development journey we've laid out, you're in the midst of the deployment stage. 您可以從這裡繼續新增 advanced services:From here, you can continue to adding advanced services:

您可以隨時回到 Unreal 開發檢查點You can always go back to the Unreal development checkpoints at any time.