Mobile Center UITest exit code 20

1.1k Views Asked by At

I've been trying to run a UI test via Visual Studio Mobile center for a while now, but I'm getting the following error:

Preparing tests... failed. Error: Cannot prepare UI Test artifacts. Returning exit code 20.

I looked on the mobile-center-cli github page and found that error codes 1 until 63 are reserved for TestCloud. There is really no documentation about this error so I hope someone is able to point me into the right direction.

Command used:

mobile-center test run uitest --app "MyAppName" --devices d5c95903 --app-path "pathToApk"  --test-series "master" --locale "en_US" --build-dir "PathToBinRelease"
4

There are 4 best solutions below

1
On BEST ANSWER

It sounds like you may be specifying the wrong folder for your --build-dir.

The --build-dir should be the bin/Debug folder of your Xamarin.UITest project, something like this:

"/Users/User/AppSolution/App.UITests/bin/Debug"

Can you please try the above and let me know if it resolves the issue?

Glenn

2
On
--uitest-tools-dir $APPCENTER_SOURCE_DIRECTORY/packages/Xamarin.UITest.*/tools

https://tomsoderling.github.io/AppCenter-Automated-UI-tests-on-build/

0
On

Another reason for this error is if there is more than one version of Xamarin.UITest present in the packages folder, that is visible in the root of your project.

Remove the unnecessary versions of Xamarin.UITest and give it another go.

0
On

I had this error. I added this param to my script:

--uitest-tools-dir "...your_path\packages\Xamarin.UITest.2.0.10\tools"

This is work for me.