VR Android Device - cannot test unless uploaded to a device

I’m new to Unity and VR development and have built a very basic VR app that can be viewed on an Android Smartphone. Navigation is via a raycasting.

The main issue is that I have to Build and Run to the device every time I want to test an update. Because the app is designed to run without controllers there are no other inputs.

Unity Version: 2019.4.21f1
Device: HUAWEU P10 lite
Android Version: 7.0

Question: Is there a way to simulate the movement of the head (using keyboard or mouse) in the unity player so that I don’t need to upload to the device every time.

Make the code compile and run for windows PC, or whatever PC you have so you can run it with the play button.

To emulate headset rotation I use the following code to use F,G keys, and the mouse, using the new input system (if using the old input system replace with Input.GetAxis(“Mouse X”); Input.GetKey(KeyCode.F); and similar. This is added to my CameraController class which is a gameobject containing the camera.

float fX = 5.0f, fY = 0, fZ = 0;
void LateUpdate()
{
    //emulate headset movement
    Keyboard keyboard = Keyboard.current;
    if (keyboard!=null && (keyboard.fKey.isPressed || GameManager.bNoVR))
    {
        //using mouse smoothing to avoid jerkyness
        float fMouseX, fMouseY;
        GetMouseMovementSmooth(out fMouseX, out fMouseY);
        if (keyboard.gKey.isPressed) fZ += fMouseX * 3.0f;
        else fY += fMouseX * 3.0f;
        fX -= fMouseY * 3.0f;

        if (keyboard.rKey.isPressed) { fX = 5.0f; fY = 0; fZ = 0; }

        transform.eulerAngles = new Vector3(fX, fY, fZ);
    }
}

//mouse movement smoothing to distribute movement every frame when framerate
//is above input rate at the cost of a delay in movement
// frame movement example
// before: 5 0 0 5 0 0
// now: 2 2 1 2 2 1 
float fCurX = 0, fCurY = 0;
float fStepX = 0, fStepY = 0;
public void GetMouseMovementSmooth(out float o_fX, out float o_fY)
{
    Mouse mouse = Mouse.current;
    Vector2 v = mouse.delta.ReadValue();
    fCurX += v.x;
    fCurY += v.y;

    float fStep = Time.deltaTime / 0.050f; //% of movement to distribute each time called
    if (fStep > 1.0f) fStep = 1.0f;  //if frametime too long we must not move faster
    if (fStep <= 0.0f) fStep = 1.0f; //if the timer has to low resolution compared to the framerate

    fStepX = fCurX * fStep;
    fStepY = fCurY * fStep;

    if (Mathf.Abs(fCurX) > Mathf.Abs(fStepX))
    {
        fCurX -= fStepX;
        o_fX = fStepX;
    } else {
        o_fX = fCurX;
        fCurX = 0;
    }

    if (Mathf.Abs(fCurY) > Mathf.Abs(fStepY))
    {
        fCurY -= fStepY;
        o_fY = fStepY;
    } else {
        o_fY = fCurY;
        fCurY = 0;
    }
}

@rh_galaxy thanks for the help, I will see what I can do with this. I’m using the old input system so i need to work out how to adjust the code.