2017 — The Complete Guide to Building your First Daydream VR demo on a MacBook

Joe Gabriel
Joe Gabriel
Published in
8 min readJun 22, 2017

--

I’m not gonna lie, it’s complicated, but not as complicated as you’d think

Prepare yourself for some hoop jumping. By the end of this, you’ll will qualify to hold up your Daydream headset and yell out either your favorite expletive or some form of celebratory huzzah.

The best part is you’ll only need to do this setup once, and then you’ll be ready to go to crazy town with your VR creations. Sooo…

What you need

  • MacBook
  • Daydream View headset
  • Daydream ready phone
  • Software: Unity3D, GoogleVR, Android SDK, Java Development Kit (JDK)

Download the Essentials

  1. Download Unity 5.6
  • During the installation, when the ‘Choose Components’ window pops-up, select Android Build Support.

2. Download Google VR

  • https://developers.google.com/vr/unity/download
  • The Google VR SDK for Unity let’s you create VR applications for Google Cardboard and Google Daydream on an Android phone or for Google Cardboard on an iOS device
  • This will download as a Unity Package file, I recommend saving it to an easy to find location like your desktop for this first demo.

3. Download Android SDK

Now let’s configure some Android SDK settings:

  • This lets you be able to implement and send the Unity3D project to your Daydream ready Android phone.
  • Once you’ve downloaded and installed Android Studio, launch the program. From the Android Studio home screen Configure > SDK Manager > Appearance & Behavior > System settings > Android SDK > SDK Platforms then check off Android 7.0 (Nougat) and Android 7.1.1 (Nougat) to access API levels 24 & 25.
  • From within the same tab, copy the Android SDK Location to a sticky note, it will look something like this: /Users/user-name/Library/Android/sdk (we’re going to copy+paste this into Unity3d soon)

4. Download Java Development Kit (JDK)

  • On the new page, click on the download link for your platform. We’re designing on a Mac, so select Mac OS X.
  • Once you have the JDK installed, copy the location of the JDK folder onto the same sticky note as the Android SDK folder location. On Mac, the folder location is something like this: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home

Start your first demo scene:

  1. Open Unity and create a new 3D project, you don’t need to include any custom assets at this time.
  2. Import the Google VR Unity package:

Assets tab > Import Package > Custom Package. Select the GoogleVRForUnity.unitypackage file you downloaded and click Open. Make sure all the boxes are checked, or select ALL in the Importing Package dialog and click Import. Accept any API upgrades if prompted.

Configure Unity build settings

  1. Go to File > Build Settings, then in the new dialogue window, select Android as the platform by highlighting it in the Platform list, then click Switch Platform.

2. Click the Player Settings… button, revealing the PlayerSettings section in the Inspector. Find the Other Settings section and do the following:

  • Enable Virtual Reality Supported. In the Virtual Reality SDKs section that appears below, select the + icon, then select Daydream or Cardboard as appropriate to add it to the list.
  • Enter a package name into the Bundle Identifier field (for example, com.randomname). You must keep the “com.” at the beginning of the Package Name
  • Set the Minimum API Level drop-down menu to “Android 7.0 ‘Nougat’ (API level 24)” or “Android 7.1 ‘Nougat’(API level 25) for [Daydream]. -> This must match the Android version your Daydream ready mobile phone. For my Google Pixel phone, it’s Android 7.1 ‘Nougat’. You can check the Android version in your phone’s Settings > About Phone and you should see something like Android 7.1.2 displayed under ‘About Phone’

Now we need to double check the Android SDK & JDK folder paths are correct:

  • In Unity, select the Unity tab next to ‘File’ > Preferences… > External tools > Look at the Android SDK & JDK folder paths, you can copy + paste the folder path here directly if you copied them earlier, or browse for the root folder. Here are how my folders paths look:
  • Android SDK: /Users/joe-gabriel/Library/Android/sdk
  • JDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
  • You don’t need to enter the NDK folder path

If you can’t find your Android SDK folder location, you probably need to reveal your LIBRARY folder:

This drove me bananas when getting set up. I needed to find the Android SDK folder location but couldn’t find it in my Finder. Well it turns out I couldn’t find it because it was in my Library folder, which Apple conveniently hides by default, so I had to find how to reveal the Library folder first. It’s almost enough to make you go…

After searching for a bit, I finally found a random article (internet ftw!)that includes the solution I used and a few other ways to reveal your Library:

If you’re using OS X Mavericks or later, this is the easiest way to permanently access your hidden Library folder.

  • Click on an empty space on your desktop: This will let you see the Finder menu tabs
  • Go > Home, a dialogue window will pop up that has a house and your user-name at the top
  • View > View Options
  • Near the bottom, place a checkmark in the box labeled ‘Show Library Folder’.

Load and preview the Unity demo scene

  1. In the editor’s project pane, navigate to the Assets > Google VR > Demos > Scenes folder and open the GVRDemo scene.

2. Press the Play button in Unity. In the Game view you should see a stereo rendering with one or more cubes.

3. Press and hold the Alt key and move your mouse to simulate turning your head in VR. Press and hold the Control key and move the mouse to tilt your view as if you were tilting your head to the left or right.

4. Great! The scene is ready, now let’s configure our phone

Configure your Pixel/Daydream compatible phone:

This is to configure your phone so it can download and run your Unity3D scene. (NOTE: You need a Daydream ready phone like Google Pixel, Samsung 8, Moto Z, Mate 9 Pro, Axon 7, Zenfone AR)

  1. Settings > About Phone > tap “Build Number” field 7 times, you’ll see a congratulatory “You are now a developer!” dialogue (boom, never even needed a CS degree) and then a “You have enabled Development Settings” dialogue, now go back one level to Settings > you’ll see that Developer Options is now available > switch USB debugging to “ON”

2. Connect your phone to your Mac through USB

Build and deploy the Unity demo scene

  1. File > Build & Run
  2. There are 2 weird scenarios that frequently mess people up at this point:
  • Android SDK or JDK pathway are not correct: Double check the folder location in Unity > Preferences… > External tools
  • “Unable to list target platforms” error: Here’s the fix! Like his video if it works for you, it totally saved my bacon. https://www.youtube.com/watch?v=xH3IyvtsLuc

3. Click the Build & Run button again

  • If all is well, your phone will ask you to accept a permissions request and you may have to select Build & Run again from Unity.
  • Your phone will load up the Unity3D demo scene and prompt you to put your phone in your Daydream headset
  • Voila! You can now look around your demo scene and use your Daydream controller to point around

Enjoy & Share!

You only need your USB cable to run the demo scene the 1st time. When you disconnect your USB cable, you will now have a Unity3d app icon on your phone that you can run the demo scene from whenever you want.

Now that your power level as a VR designer is charging up (almost over 9000), please share your creations!

Soooo ya! It’s a pretty messy process, it’s no surprise why there’s a content drought in VR when the setup process alone requires an entire Medium post ha!

**Please let me know if this does or doesn’t work for you, or how it can be improved.

--

--