git clone https://github.com/viromedia/viro.git
。npm install
从此项目的根目录运行npm start
从此项目的根目录运行。通过我们的 Testbed 应用程序试用了示例,现在想尝试将示例代码作为独立应用程序部署到您的设备吗?以下这些快速步骤应该可以帮助您入门:
$ANDROID_HOME
并将其添加platform-tools
到$PATH
变量中。如果不,
export ANDROID_HOME=/YOUR_PATH_TO/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
react-native run-android --variant=gvrDebug
ViroSample.xcworkspace
目录ios/
。在 Hit play 下选择正确的“团队”ViroSample
和ViroSampleTest
目标,General -> Signing
以在您的 iOS 设备上构建和启动应用程序scene: scenes['360 Photo Tour'],
中定义的场景。scenes
您还可以尝试包含前沿功能和修复的最新主线版本。请记住,主线构建可能不如发布构建稳定。为此,只需:
git clone https://github.com/viromedia/viro.git
。npm install
从此项目的根目录运行。git clone https://github.com/viromedia/viro.git
。ios/dist
。ios/
:
cd ios
pod install
cd test
npm install
ViroExample
:
cd test/ios/ViroExample
pod install
ViroExample.xcworkspace
。(确保您打开的是 .xcworkpace 文件,而不是*.xcodeproj 文件!)React
方案,请点击Manage Schemes...
。在对话框中,添加React
方案。React
,ViroReact
并ViroExample
确保它们都是发布或调试,具体取决于您要构建的内容。Generic iOS Device
,然后为同一目标构建 ViroReact 方案。笔记:
11.a If you want the ability to run on Simulator,
change target to any of the `iOS Simulator` targets instead of `Generic iOS Device`.
11.b If in your own app project setup, you prefer to include Viro React as a static library
rather than relying on `use_frameworks!` - build scheme `ViroReact_static_lib`
instead of `ViroReact` as mentioned above in step #11.
libViroReact.a
您应该在 处看到一个新文件ios/dist/lib/libViroReact.a
。ViroExample
在插入的 iOS 设备上运行方案。./prepareRelease.sh
.$ cd test/android
$ ./gradlew assembleGvrRelease
test/android/app/build/output/gvr/app-gvr-release.apk
插入的 Android 设备上。./prepareRelease.sh
在上面运行的代码构建了 android react bridge 并将 iOS 和 Android bridge 捆绑到一个react-viro-*.tgz
文件中。* 文件中的当前版本package.json
包含完整源代码的存储库,使用 ViroReact 和 React Native 为 Viro Media 获奖的 Figment AR App 构建。在Google Play和App Store上可用。