cancel
Showing results for 
Search instead for 
Did you mean: 

Unity + Gear VR + Debugging Workflow

marchansenj
Honored Guest
UPDATE:
Thanks to the replies below my workflow has been simplified to:
    Plug phone in via USB
    Build and Run
    When done plug into GearVR


If I only want to test it using my Android controller without gearVR on the note the Unity Remote app works well.

To fix the issue with the upside down camera, I needed to check Flip Y on the OVRCameraController.

The issue with the Unity editor crashing upon pressing stop has to do with the OnDestroy method in the OVRDevice script if you have the DK2 config installed (see other thread for more details).

Thanks Again,
Marc

---------------------------------------------------------------------------------------------------------------------------------------------
ORIGINAL

Hi All,
I am having a couple of issues with my installation of Unity + Mobile SDK Prefabs and Blocksplosion example.

After pressing Play in Unity to start game testing my copy of Unity crashes, I can typically play test but if I try to Stop debugging or click in the inspector Unity crashes.

This seems to only happen if I have included the mobile OVRCamerController or OVRCharacterController prefab in my scene. My other DK2 projects work fine with no crash.

This has caused me to reload my project over and over again or after every-time I want to debug.

I am using Unity Pro 4.6.3p1

Another issue I am having is the Camera seems to be upside down when viewing output with the DK2 or on my Note 4 (using the Unity Remote 4 app).

If anyone has a link to a good workflow for debugging Gear VR apps using Unity I would love to see it.

Thanks,
10 REPLIES 10

marchansenj
Honored Guest
Crash after pressing Play:
Problem signature:
Problem Event Name: APPCRASH
Application Name: Unity.exe
Application Version: 4.6.3.26870
Application Timestamp: 54ecca02
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7601.18247
Fault Module Timestamp: 521ea8e7
Exception Code: c0000005
Exception Offset: 00033ac3
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: b219
Additional Information 2: b2198920fa7cfb92c7781a1c44b6e74f
Additional Information 3: 3e73
Additional Information 4: 3e7329b6aceee2a6364809e3ac3ad229

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt


See the attachments for the Camera weirdness

marchansenj
Honored Guest
Well I figured out how to test my APP once installed without putting it into the GearVR thanks to twistedunbrella as xda.

Running any app as vr_dual (without GearVR Headset):

    1.) Install any Gear VR app with your device signature (app can downloaded, compiled, or backed up from an official install)
    2.) Go to your device Settings -> Application manager -> Gear VR Service (usually in the "Downloaded" section but could also be in the "All" section).
    3.) Tap on "Manage storage"
    4.) Tap the "VR Service Version" number six times.
    5.) Wait for scan process to complete and you should now see the Developer Mode toggle on this screen.
    6.) You should now be able to launch your app without the headset and also dock the headset at any time without having Home launch.

anastasia_devan
Honored Guest
Awesome, thanks for sharing! 🙂

By the way, if you're using Unity you should be able to build directly to the device. I just hit cmd+B on a Mac and it builds and installs directly to the phone - no need to copy over the apk and then go through the install process.
Composer | Programmer | Unicorn Music & sound for video games & VR anastasiadevana.com Latest Project: Google Shop at Currys VR Tour (spacial audio, UX sound design)

marchansenj
Honored Guest
By the way, if you're using Unity you should be able to build directly to the device. I just hit cmd+B on a Mac and it builds and installs directly to the phone - no need to copy over the apk and then go through the install process.


Thanks Anastasia, if anyone else is wondering how to do this make sure:
    You have it plugged in via USB
    You have Unkown Sources checked under security
    You have USB debugging turned on under development
    and then make sure to click Build and RUN not just Build.

rosebud_the_sle
Expert Protege
Hi folks,

Just so you know, vr_dual shouldn't be used. It has very subtle side-effects (including performance!) and you don't need it to run an app outside of Home. Simplify your life and build your workflow around vr_only.

Cheers,
Chris

rjmig88
Honored Guest
Besides performance, what other side effects is there for vr_dual? I'm looking into a method of doing automated on device performance testing of builds and using vr_dual for that has been great as you don't need to load it into a headset to start the app for this specific purpose.

marchansenj
Honored Guest
Hi Chris,

Just so you know, vr_dual shouldn't be used. It has very subtle side-effects (including performance!) and you don't need it to run an app outside of Home. Simplify your life and build your workflow around vr_only.


I think I know the confusion, in my post I stated without Oculus Home. What I really meant is without the GearVR headset. I have yet to use Oculus Home.

From the Device_and_Environment_Setup_Guide.pdf this is what it says:

V.1.4 I need to run my app outside of the Gear VR headset
Running a VR application with the vr_only manifest tag currently requires placing the phone
into the Gear VR headset. This can be a time consuming process for making iterative changes
to applications. We are working to resolve this in order to streamline the development process.
As a workaround, the vr_only tag can be changed to vr_dual in order to view your app
outside of Gear VR. Unfortunately, this requires a recompile.
Be sure to set this back to vr_only when analyzing app performance:
<metadata
android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
Thanks,
Marc

jboss
Protege
I know this is an old thread, but for some reason the 'Start new thread' option disappeared when I logged in.

When I try to debug apps on my phone outside the Gear VR the gyroscope is not working. So I can not look around and I can not gaze at items in a canvas (which is what I want to debug).

Can anybody tell me how to solve this?

leftler
Protege
"jboss" wrote:
I know this is an old thread, but for some reason the 'Start new thread' option disappeared when I logged in.


You should read viewtopic.php?f=26&t=3412