- Download and install .NET SDK
- Have a game instrumented with AltTester Unity SDK
- Have AltTester Desktop app installed (to be able to inspect game)
- Download and install ADB for Windows
- Enable Developers Options on mobile device more instructions here
This repository is a test project that uses NUnit as the test library. It was generated using following command (as suggested in documentation)
dotnet new nunit
AltTester Unity SDK framework contains AltDriver
class used to connect to the instrumented game developed w/ Unity. AltTester-Driver for C# is available as a nuget package. Install AltTester-Driver nuget package
dotnet add package AltTester-Driver --version 1.8.2
- Make sure mobile device is connected via USB, execute:
adb devices
-
On mobile device: allow USB Debugging access (RSA key fingerprint from computer)
-
Uninstall the app from the device
adb uninstall com.Altom.TrashCat
- Install the app on the device
adb install TrashCat.apk
Run tests manually (with dotnet CLI)
- [Optional to do manually] Setup ADB port forwarding (this can also be done in code in Setup and Teardown)
adb forward --remove-all
adb forward tcp:13000 tcp:13000
- Launch game
adb shell am start -n com.Altom.TrashCat/com.unity3d.player.UnityPlayerActivity
- From
TrashCat.Tests
execute all tests:
dotnet test
- Kill app
adb shell am force-stop com.Altom.TrashCat
! Make sure to have the AltTester Desktop App closed, otherwise the test won't be able to connect to proper port.
dotnet test --filter <test_class_name>
dotnet test --filter <test_class_name>.<test_name>
- get
altwebsocket-sharp.dll
from here and put in project's bin\Debug\net7.0
this was necessary due to currently open issue