VR系列——Oculus Mobile SDK文档:二、移动SDK安装指南(一)

xiaoxiao2021-02-28  83

移动SDK安装指南

这个指南将引导你设置你的三星设备和准备移动VR应用程序的开发环境。

安装Oculus移动SDK

下载移动SDK的地址:https://developer.oculus.com/downloads/.

移动SDK包是.zip的压缩格式,它包含了源码和媒介文件:ovr_sdk_mobile_<版本号>.zip。

下载之后,解压到你指定的目录(例如:C:\Oculus\Mobile)。

Unity和Unreal开发者手机设置

大多数Unity和Unreal开发者不用安装Android Studio或者NDK。在开发前,开发者使用一个第三方游戏引擎安照我们的Device Setup guide(“设备安装指南说明”),并安装Java开发工具包(JDK)和Android SDK。

注:如果你想使用OVRMonitor,你必须下载Oculus移动SDK。

Unity开发者:查看Unity的开始安卓开发获取更多的信息。

Unreal开发者:查看Unreal的安卓快速开始获取更多的信息

设备安装

这节会提供怎么在你支持的设备和游戏手柄上运行、调试和测试你的GearVR应用的配置的信息。

请重新看一下前面“系统和硬件要求”一节列出的SDK支持的设备列表。

注:这些信息在SDK发布的时候是正确的。不幸的是,我们不能保证这些网页讨论的一致性或第三方应用的可靠性,我们也不能对任何我们所描述的第三方应用程序提供支持。

配置系统来识别安卓设备

为了在安卓设备上运行、调试和测试你的应用,你必须配置你的系统通过USB端口去识别你的安卓设备。

如果设备通过USB端口连接到系统时没有被自动识别,你需要手动更新驱动。在“使用硬件设备”一节中你能发现更多信息:http://developer.android.com/tools/device.html。

Windows

如果你使用Windows开发,你需要为adb安装一个USB驱动程序。对于安装指南和OEM驱动程序的链接,请参见安卓 OEM USB驱动程序文档。

三星的安卓驱动程序可能在他们自己的开发者网站上能找到:http://developer.samsung.com/android/toolssdks/Samsung-Android-USB-Driver-for-Windows

当你在计算机USB端口上连接设备时,Windows可以自动识别正确的驱动并安装相应的驱动。然而,如果Windows无法识别你的设备,你可以通过Windows设备管理更新驱动,即使你的设备是自动识别。

通过Windows控制面板访问设备管理。如果设备被自动识别,在设备管理中它会显示在端口设备下面。另外,在设备管理中查看其它设备下面和选择设备手动更新驱动。

为了验证驱动成功识别设备,打开命令行输入下面的命令:

adb devices

注:你需要成功配置你的安卓开发环境,才能使用这个命令。更多的信息请看下一节:安卓开发环境搭建。

如果设备没有显示出来,检查设备是否有足够的电量,并且驱动程序正确安装。

Mac OS

如果你用Mac OSX开发,你不需要安装USB驱动。

你的三星设备会显示一个通知提示你安装安卓文件转换,一个在OSX和安卓之间转换文件的方便的应用程序。

为调试配置你的安卓设备

为了在你的安卓设备上测试和调试应用程序,你需要启用设备上特定的开发者选项。

开发者选项

开发者选项可能在:Home->All Apps->Setting->System->Developer options路径下。

开发者选项默认情况下,可能是隐藏的。所以,你可以按照下面的步骤打开开发者选项:

去Home->All Apps->Settings->System->About device.向下滚动到Build number。连续按7次Build number。

你应该被通知开发者选项已经可以使用了。

一旦你发现开发者选项,就能启用下面的功能:

USB调试:通过USB将会允许工具安装和启动已部署的应用。你应该看到伴随图所示的界面。

注意:如果上面的画面没有出现,请确保你的系统识别该设备并重新关闭切换USB调试。

检查是否总是允许该电脑连接,点击OK

清除USB调试授权白名单,点击开发者选项菜单上的取消USB调试授权,并点击OK。

允许模拟位置:这将允许你发送模拟位置信息到设备(便于它们使用基于位置服务的应用程序)。

验证应用渠道USB:这将检查通过ADB/ADT安装的应用程序是否存在有害的行为。

显示选项

显示选项的路径为:首页>应用程序 >设置 >声音和显示。

锁屏/屏幕安全/屏幕锁:设置为无,使主屏幕是即时可用,没有滑屏或输入密码。快速进入和退出手机是很有用的。

显示/屏幕超时:设定时间为你所需的时间。如果你不主动访问设备,但希望保持屏幕清醒状态长于默认的30s也是有用的。

更多信息请查看Android Debugging


原文如下

Mobile SDK Setup Guide

This guide will walk you through setting up your Samsung device and preparing your environment for mobile VR application development.

Installing the Oculus Mobile SDK

Download the Mobile SDK here: https://developer.oculus.com/downloads/.

The Mobile SDK is composed of a compressed archive in .zip format, which contains both source and media files: ovr_sdk_mobile_.zip.

Once downloaded, extract the .zip file into a directory of your choice (e.g., C:\Oculus\Mobile).

Mobile Setup for Unity and Unreal Developers

Most Unity and Unreal developers do not need to install Android Studio or NDK for development. Developers using a third-party game engine should follow the instructions in our Device Setup guide, and install the Java Development Kit (JDK) and Android SDK before beginning development.

Note: You must download the Oculus Mobile SDK if you wish to use OVRMonitor.

Unity developers: see Unity’s Getting Started with Android Development for more information.

Unreal developers: see Unreal’s Android Quick Start for more information

Device Setup

This section will provide information on how to set up your supported device and gamepad for running, debugging, and testing your Gear VR application.

Please review the System and Hardware Requirements above for the list of supported devices for this SDK release.

Note: This information is accurate at the time of publication. Unfortunately, we cannot guarantee the consistency or reliability of third-party applications discussed in these pages, nor can we offer support for any of the third-party applications we describe.

Setting up your System to Detect your Android Device

You must set up your system to detect your Android device over USB in order to run, debug, and test your application on an Android device.

If the device is not automatically detected by your system when connected over USB, you may need to manually update the drivers. More information can be found in the “Using Hardware Devices” section at http://developer.android.com/tools/device.html.

Windows

If you are developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the Android OEM USB Drivers document.

Samsung Android drivers may be found on their developer site: http://developer.samsung.com/android/toolssdks/Samsung-Android-USB-Driver-for-Windows

Windows may automatically detect the correct device and install the appropriate driver when you connect your device to a USB port on your computer. However, if Windows is unable to detect your device, you may still need to update the drivers through the Windows Device Manager, even if your device was automatically detected.

Access the Device Manager through the Windows Control Panel. If the device was automatically detected, it will show up under Portable Devices in the Device Manager. Otherwise, look under Other Devices in the Device Manager and select the device to manually update the driver.

To verify that the driver successfully recognized the device, open a command prompt and type the command:

adb devices

Note: You will need to successfully setup your Android development environment in order to use this command. For more information, see the next section: Android Development Environment Setup

If the device does not show up, verify that the device is turned on with enough battery power, and that the driver is installed properly.

Mac OS

If you are developing on Mac OS X, you do not need to install USB drivers.

Your Samsung device may display a notification recommending you install Android File Transfer, a handy application for transferring files between OS X and Android.

Configuring your Android Device for Debugging

In order to test and debug applications on your Android device, you will need to enable specific developer options on the device.

Developer Options

Developer options may be found under: Home -> All Apps -> Settings -> System -> Developer options.

Developer options may be hidden by default. If so, you can expose these options with the following steps:

Go to Home -> All Apps -> Settings -> System -> About device.Scroll down to Build number.Press Build number seven times.

You should be informed that Developer options has been enabled.

Once you have found Developer options, enable the following:

USB Debugging: This will allow the tools to install and launch deployed apps over USB.

You should see the screen shown on the accompanying figure.

Note: If the above screen does not appear, ensure that your system recognizes the device and toggle USB Debugging off then back on.

Check Always allow this computer and hit OK.

To purge the authorized whitelist for USB Debugging, press Revoke USB debugging authorizations from the Developer options menu and press OK.

Allow mock locations: This will allow you to send mock location information to the device (convenient for apps which use Location Based Services).

Verify apps via USB: This will check installed apps from ADB/ADT for harmful behavior.

Display Options

The following display options are found in: Home -> Apps -> Settings -> Sound and Display.

Lock screen/Screen Security/Screen lock: Set to None to make the Home screen is instantly available, without swipe or password. Useful to quickly get in and out of the phone.

Display/Screen timeout: Set the time to your desired duration. Useful if you are not actively accessing the device but wish to keep the screen awake longer than the default 30 seconds.

See Android Debugging for more information.

转载请注明原文地址: https://www.6miu.com/read-40590.html

最新回复(0)