- ARCore官网:https://developers.google.cn/ar/
- Github网址:https://github.com/google-ar
1.Android打包
①.首先你要确定你的手机设备满足以下几点:
(1)支持ARCore
(2)能够访问Google Play Store(以便下载最新版ARCore)或者已经安装了最新版的ARCore
以下是ARCore支持的Android设备:
| Manufacturer | Model | Notes |
| Asus | Zenfone AR | |
| Zenfone ARES | |
| Google | Nexus 5X | Requires Android 8.0 or later |
| Nexus 6P | Requires Android 8.0 or later |
| Pixel, Pixel XL | |
| Pixel 2, Pixel 2 XL | |
| HMD Global | Nokia 6 (2018) | Also known as Nokia 6.1 |
| Nokia 8 Sirocco | |
| Huawei | P20, P20 Pro | |
| Mate RS Porsche Design | |
| LG | G6 | Requires Android 8.0 or later |
| G7 ThinQ | |
| V35 ThinQ | |
| Motorola | Moto G5S Plus | |
| Moto G6 Plus | |
| Moto Z2 Force | |
| OnePlus | OnePlus 3T | Requires Android 8.0 or later |
| OnePlus 5 | |
| Samsung | Galaxy A5 (2017) | Samsung devices with a model
number ending in 0 or 8 are
not supported, e.g. SM-G9600. |
| Galaxy A7 (2017) |
| Galaxy A8, Galaxy A8+ (2018) |
| Galaxy Note8 |
| Galaxy S7, Galaxy S7 edge |
| Galaxy S8, Galaxy S8+ |
| Galaxy S9, Galaxy S9+ |
| Sony | Xperia XZ Premium | Requires Android 8.0 or later |
| Xperia XZ1, Xperia XZ1 Compact | Requires Android 8.0 or later |
| Xiaomi | Mi Mix 2S |
②.确定开发环境
确保你的开发环境满足以下需求:
(1)Android SDK版本在7.0 (API Level 24) 或者更高
(2)Unity版本在2017.3.0f2或者更高,推荐 Unity 2017.4 LTS或者之后的
③.下载ARCore for unity并设置Unity打包环境
下载ARCore for unity并导入unity,将示例程序场景增加到Scene in Build
unity打包设置:
(1)File > Build Settings,设置成Android并点击Switch Platform.
(2)Player Settings > Other Settings > Multithreaded Rendering设置成Disable
(3)Player Settings > Other Settings > Package Name(设置成你自己的)
(4)Player Settings > Other Settings > Minimum API Level设置成Android 7.0 or higher
(5)Player Settings > Other Settings > Target API Level设置成Android 7.0 or higher
(6)Player Settings > XR Settings > ARCore Supported设置成Enable
之后等待打包完成安装到手机上运行查看即可
image.png2.iOS打包
①.确保iPhone满足以下要求(暂不支持平板测试):
(1)可以兼容ARKit
(2)iOS版本11或者更高
②.开发环境:
确保你的开发环境满足以下需求:
(1)[ARCore SDK for Unity](https://github.com/google-ar/arcore-unity-sdk/releases) 版本1.2.0或者更高
(2)Unity版本在2017.3.0f2或者更高,推荐 [Unity 2017.4 LTS](https://unity3d.com/unity/qa/lts-releases)或者之后的
(3)[Unity ARKit Plugin](https://bitbucket.org/Unity-Technologies/unity-arkit-plugin) 版本在 1.5 或者更高
(4)[Xcode](https://developer.apple.com/xcode/)版本在 9.3 或者更高
③.下载ARCore for unity,导入unity
并下载最新的ARKit,将UnityARKitPlugin文件夹放入项目的assets文件夹下
④.打包配置设置
(1)File > Build Settings,设置成iOS并点击Switch Platform.
(2)Player Settings > Other Settings > 设置Bundle Identifier
(3)Player Settings > Other Settings > Camera usage description填写你的AR使用的描述
(4)Player Settings > Other Settings > Target minimum iOS version设置成11.0或者更高
(5)Player Settings > Other Settings > Architecture设置成ARM64
(6)Player Settings > Other Settings > Architecture
之后与unity构建iOS应用操作一致,本文不再多描述
3.ARCore的一些设置
image.pngAR要求意味着你的应用在没有AR的情况下是不可用的。Play Store确保了AR所需的应用只对支持ARCore的设备开放。当用户安装一个AR所需的应用程序时,Play Store会在安装应用程序之前自动安装ARCore。
如果不勾选的话,表示你的应用程序是可选的(AR Optional ),意思就是包含一个或多个AR特性,如果设备支持ARCore,它将被激活。不过,这款应用可以在不支持ARCore的设备上安装和运行。当用户安装一个AR可选应用时,Play Store不会自动安装ARCore。
网友评论