Search Unity

Question Can Unity Test Framework works in AndroidDevice without PC?

Discussion in 'Testing & Automation' started by UpDaybyDay, Feb 9, 2022.

  1. UpDaybyDay

    UpDaybyDay

    Joined:
    Jan 27, 2022
    Posts:
    3
    I want to do some test on the real android device. Can I use Unity Test Framework to do this?:)
    for example:
    1. use Unity Test Framework in my unity project
    2. then build a test.apk
    3. install test.apk on android phone
    4. launch test.apk and start test runner whenever I want without PC (maybe every time I want to invoke the unit testcase, I click a button to start it)

    If can, any documentation of this?
     
  2. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
  3. UpDaybyDay

    UpDaybyDay

    Joined:
    Jan 27, 2022
    Posts:
    3
    Thanks!!! Really helpful!

    Another question: every time the test app be launched, it enters the InitTestScenexxxx.unity to run test. Can I enter my own scene to play game, after while, I click a button to run all tests?
     
  4. Elapotp

    Elapotp

    Joined:
    May 14, 2014
    Posts:
    98
  5. MHR_171

    MHR_171

    Joined:
    Apr 1, 2015
    Posts:
    7
    Do you able to do that?
    In my case I want to split build the game with Android device
    And it turns out, every time I tried to build it, there's error like this
    Code (CSharp):
    1. Assets\Scripts\Tests\Testing.cs(2,19): error CS0234: The type or namespace name 'TestTools' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
    But this error only appears when I tried to "run All test (android)
    upload_2022-12-19_15-4-57.png
    So when I edit the code, there are no such a problem ._.
     
  6. dev-005

    dev-005

    Joined:
    Aug 8, 2023
    Posts:
    1
    Hi! Have you solved this problem? I want to do this.