Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Custom device in using built-in Device Simulator

Discussion in 'Editor & General Support' started by btschumy, May 27, 2021.

  1. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    91
    I have been using the built-in device simulator in 2020.1.2f1. I need to simulate a device that is not in the built-in list. Is it possible to create custom devices for this simulator?

    I have seen some documentation for the 3.0 simulator that talks of creating a .device file and dropping in in your project. This doesn't seem to work for the simulator in 2021.1.2f1.
     
  2. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    91
    No one has any thoughts on how to create custom device for the simulator? Is it just not possible?
     
  3. leofraga-coda

    leofraga-coda

    Joined:
    Oct 22, 2021
    Posts:
    2
  4. Tyrannicus100BC

    Tyrannicus100BC

    Joined:
    Apr 24, 2015
    Posts:
    5
    Here is the docs for doing this in 2021.3 LTS. I just went through the process of doing this for iPhone 14 Pro/Max -- it definitely works. For reference, here are the definitions that are working for me (the overlay pngs are taken from Apple's publicly available press kit).

    https://docs.unity3d.com/Manual/device-simulator-adding-a-device.html
     

    Attached Files:

    Joyixir-dev, JonBFS and mcarriere like this.
  5. JonBFS

    JonBFS

    Joined:
    Feb 25, 2019
    Posts:
    39
    I imported this to my Editor/devices folder and got a deserialization error KeyNotFoundException. Something is missing or has changed in the json device config file? The documentation does not help much
    https://docs.unity3d.com/Packages/com.unity.device-simulator@3.0/manual/DefiningCustomDevices.html

    However, it does work if I scrap the "orientations" part of the json file (I miss the safe area definition doing that though)

    I can't see inside the OrientationData struct to see what's wrong my definition!
     
  6. BlindsidedGames

    BlindsidedGames

    Joined:
    Aug 24, 2020
    Posts:
    9
    Works perfectly, thank you!

    For anyone wondering, all you do is put ths in a folder called Devices, in an Editor folder anywhere in your project.

    so for me Assets>Editor>Devices (the contents of devices folder in the zip, not the zip itself.)