dotnet / dnceng

.NET Engineering Services
MIT License
25 stars 18 forks source link

Disable package verifier on physical Android devices #4253

Open ivanpovazan opened 1 week ago

ivanpovazan commented 1 week ago

Description

As reported in: https://github.com/dotnet/dnceng/issues/3656 we are seeing more and more test failures on physical Android devices due to package installation failure. This problem exists for a while and affects dotnet/arcade and dotnet/xharness CI.

The issue is escalating as we are in the process of repo migration and it requires green CI and full test coverage.

The problem happens as some of the tethered devices are not configured correctly, and have package verifier enabled, which blocks installing debug apks we use in our tests. From our observation, it is possible that the settings got changed as some of the tethered devices got factory reset recently which made them have different defaults than what is expected for testing.

Ask

  1. We would like to ask that all tethered Android devices in the windows.11.amd64.android.open queue get configured by executing the following adb commands which are required to disable package verification during installation:

    adb.exe -s <DEVICE_ID> shell settings put global verifier_verify_adb_installs 0
    adb.exe -s <DEVICE_ID> shell settings put global package_verifier_enable 0
  2. Include the above commands as a requirement for the initial device configuration - that happens after a factory reset or on a fresh device enrolment.

Additional note

Checking if the devices are properly configured can be done by executing:

adb.exe -s <DEVICE_ID> shell settings get global verifier_verify_adb_installs
adb.exe -s <DEVICE_ID> shell settings get global package_verifier_enable

where both commands should return 0 (not null!).

ivanpovazan commented 1 week ago

/cc: @ilyas1974

ilyas1974 commented 1 week ago

ICM created for the DDFUN - https://portal.microsofticm.com/imp/v5/incidents/details/553412565