Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Android controller emulator not recognized by Unity 5.4.2f2-GVR13

Discussion in 'Daydream' started by vijaykiran, Feb 1, 2017.

  1. vijaykiran

    vijaykiran

    Joined:
    Mar 4, 2015
    Posts:
    7
    Hi everyone,

    I am trying to use a Nexus 4 phone as a controller emulator via USB within Unity editor, but Unity doesn't recognize/register it. I followed the usual procedure laid out on developers.google.com/vr/daydream/controller-emulator to set it up except that I did not enable Bluetooth connection to my headset. I already have a daydream so I do not need Nexus to talk to the headset phone via bluetooth.

    When I run GVR demo in the Unity editor, I see a message saying 'Controller connecting...' and the controller emulator shows 'Waiting for Connection'. I turned on 'USB debugging' on the Nexus.

    I did see a warning message on the Unity console saying 'VRDevice daydream not supported in Editor Mode. Please run on target device', and I have no clue what to make of it because this is Unity Daydream preview version and it should support daydream by default.

    I am able to build, run and deploy an APK on the Pixel and use it with daydream controller without issues. But not being able to use the emulator is making app development process very painful and frustrating.

    Anyone else have this issue? Am I missing anything?

    Here is the setup I have:
    - Pixel phone for use with Daydream headset and controller
    - Windows 10, 64-bit
    - Unity Daydream preview 5.4.2f2-GVR13 (64-bit)
    - Nexus 4 running Kit-kat with Controller-emulator app installed

    Thanks,
    Vijay.
     
    m4rk0 likes this.
  2. vijaykiran

    vijaykiran

    Joined:
    Mar 4, 2015
    Posts:
    7
    Update: One other warning message I failed to mention earlier was that the console said 'adb command not found' and that I need to include the directory containing adb.exe to the PATH environment variable. I added the path %USERPROFILE%\AppData\Local\Android\sdk\platform-tools to my PATH variable.

    Now when I try to run the app in the editor, I see the following warning message on the console:
    Failed to setup port forwarding. Exit code 1 returned by process: CMD.exe /k adb forward tcp:7003 tcp:7003 & exit
    error: more than one device/emulator

    I only have one device hooked up via USB to my PC, and now I'm scratching my head. Previously, Unity didn't recognize the controller emulator. Now, it complains that it has too many.

    Any suggestions?

    Thanks,
    Vijay.
     
    m4rk0 likes this.
  3. vijaykiran

    vijaykiran

    Joined:
    Mar 4, 2015
    Posts:
    7
    Figured what the problem is - There was a ghost adb.exe process running causing a port forward conflict. I killed the process and I am now able to connect to the Unity editor's player.

    I'm reporting this just so it might be of help to others out there.

    Thanks,
    Vijay.
     
    m4rk0 likes this.
  4. m4rk0

    m4rk0

    Joined:
    Mar 14, 2018
    Posts:
    1
    Did you just delete the "adb.exe" program or you remove the PATH in the environment variables?