轉自:http://blog.csdn.net/neil3d/article/details/50767947
這兩個終於搞了一套Gear VR,開始嘗試了一下使用虛幻4開發Gear VR游戲。這里把開發上手的過程做一個筆記和大家分享。
首先是設置開發環境,整體上跟着官方文檔走就好了:
https://docs.unrealengine.com/latest/INT/Platforms/GearVR/Prerequisites/index.html
其中重點的步驟記錄如下。
設置手機,開啟USB Debug
- 打開手機的“設置”->關於手機:連續點擊“版本號”一欄;
- 上述操作成功之后,系統設置中會出現“開發者選項”;
- 進入“開發者選項”,開啟“USB 調試”。
設置Gear VR Service為開發者模式
這一步非常重要,否則APK上傳之后無法啟動,會提示:請插入Gear VR設備。
具體步驟參見:
首先,要上傳一個帶有osig文件的App,否則你會得到一個報錯:You are not a developer
- Go to Settings > Application Manager
- Select Gear VR Service
- Select Manage Storage
- Click on VR Service Version several times until the Developer Mode toggle shows up
- Toggle Developer Mode

配置Oculus簽名文件(osig)
- 手機使用USB線連接電腦;
- 使用“adb devices”獲取 Device ID,例如:0915f92985160b05
- 打開網址:https://developer.oculus.com/osig/
- 把簽名的Device ID粘貼進輸入框,然后點Download按鈕;
- 將獲取到的文件(例如oculussig_0915f92985160b05)放入:引擎安裝目錄\引擎版本號\Engine\Build\Android\Java\assets,例如:

虛幻4 Project
- 只能使用C++項目模板,不能使用Blueprint項目模板;(官方的視頻里說的,他用的是4.7)
- 設置Project Settings:
- Android
- Minimum SDK Version: 19
- Configure the AndroidManifest for deployment to GearVR [check]
設置好之后,從Unreal Editor中Launch到手機,或者Package Android,都可以正常啟動游戲。
