Search Unity

Question Is it possible to change the settings for an app built through "Run All Tests (Android)"

Discussion in 'Testing & Automation' started by Droife, Nov 2, 2023.

  1. Droife

    Droife

    Joined:
    Nov 2, 2023
    Posts:
    1
    I am currently trying to develop a set of PlayMode tests for a Meta Quest app. I can run the tests normally on the editor, but when I try to run them on a physical device, they get blocked as the Quest entitlement check blocks the app for not being properly registered to the user:

    Unable to find AppId for package (com.UnityTestRunner.UnityTestRunner)


    Is there any way to change the test runner build settings so that it uses the same app configuration as a "real" build to bypass this issue? Has anyone been able to find a different solution for this?
     
  2. nowsprinting

    nowsprinting

    Joined:
    Nov 3, 2014
    Posts:
    18
    I know two solutions.

    1. Use ITestPlayerBuildModifier
    https://docs.unity3d.com/Packages/c...ditor.TestTools.ITestPlayerBuildModifier.html

    My example: https://github.com/nowsprinting/test-helper/blob/master/Editor/TemporaryBuildScenesUsingInTest.cs

    2. Use IPrebuildSetup
    https://docs.unity3d.com/Packages/c...api/UnityEngine.TestTools.IPrebuildSetup.html

    My example: https://github.com/nowsprinting/tes...Internals/ScreenshotHelperTestSceneBuilder.cs


    ITestPlayerBuildModifier is only called before running tests on Player.

    IPrebuildSetup/IPostBuildTeardown is associated with the test method. It is called both in Editor and on Player.

    However, I have never tried changing the AppId.
    I hope it goes well!