在 Unreal 中部署到设备Deploy to device in Unreal

概述Overview

可通过两种方法将 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. 单击 " 启动 " 按钮旁的下拉箭头。Click the dropdown arrow next to the Launch button. 最初,HoloLens 设备选项将显示为灰色。Initially, the HoloLens device option will be grayed out.

启动下拉选项

  1. 打开 设备管理器Open the Device Manager. 请注意,HoloLens 不会自动显示在设备列表中。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.

    • 如果错误 (例如错误的地址、用户名或密码) ,则会在输出日志中打印一条消息。In the case of an error (such as wrong address, user name or password), a message will be printed to the Output Log.

添加未列出的设备

  1. 再次单击 " 启动 " 按钮旁的下拉箭头,此时应会看到刚刚添加的 HoloLens 设备。Click 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 last section of the Getting Started with Unreal tutorial series.

下一个开发检查点Next Development Checkpoint

如果遵循我们已 Unreal 的开发检查点旅程,就是在部署阶段。If you're following the Unreal development checkpoint journey we've laid out, you're in the midst of the deployment stage. 在这里,你可以继续添加高级服务:From here, you can proceed to adding advanced services:

你可以随时返回到 Unreal 开发检查点You can always go back to the Unreal development checkpoints at any time.