dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

How to create Device Tests for Maui projects #2879

Closed realZhangChi closed 3 years ago

realZhangChi commented 3 years ago

Hi, I want to create Device Tests for my Maui project, how should I do it? Can I use TestUtils to create Device Tests? There doesn't seem to be a Nuget package related to TestUtils, so I don't know how to do it. Any help is appreciated. Thanks.

realZhangChi commented 3 years ago

Hi @jsuarezruiz , I am developing an out-of-the-box toolkit for Maui, it is important to create a test project. I see that Maui used XHarness for testing, and I tried to create my Device Test project by referring to Essentials.DeviceTests.

  1. adding maui to my project as a git submodule.
  2. creating a .NET MAUI App project as a Device Test project.
  3. add a reference to the TestUtils project in the Device Test project.
    <ItemGroup>
    <ProjectReference Include="..\..\..\maui\src\TestUtils\src\DeviceTests\TestUtils.DeviceTests.csproj" />
    <ProjectReference Include="..\..\..\maui\src\TestUtils\src\DeviceTests.Runners\TestUtils.DeviceTests.Runners.csproj" />
    <ProjectReference Include="..\..\..\maui\src\TestUtils\src\DeviceTests.Runners.SourceGen\TestUtils.DeviceTests.Runners.SourceGen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
    </ItemGroup>
  4. delete the App.xaml, App.xaml.cs, MainPage.xaml, MainPage.xaml.cs, Platforms\Android\MainActivity.cs, Platforms\Android\MainApplication.cs from the Device Test project and modify the MauiProgram.cs

    public static class MauiProgram
    {
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .ConfigureLifecycleEvents(life =>
            {
    #if __ANDROID__
                    life.AddAndroid(android =>
                    {
                        android.OnCreate((activity, bundle) =>
                            Platform.Init(activity, bundle));
                        android.OnRequestPermissionsResult((activity, requestCode, permissions, grantResults) =>
                            Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults));
                    });
    #endif
                })
            .ConfigureTests(new TestOptions
            {
                Assemblies =
                {
                        typeof(MauiProgram).Assembly
                }
            })
            .UseHeadlessRunner(new HeadlessRunnerOptions
            {
                RequiresUIContext = true,
            })
            .UseVisualRunner();
    
        return builder.Build();
    }
    }
  5. run dotnet build -f net6.0-android to compile.
  6. run the command xharness android test --output-directory=out --package-name=com.companyname.Maui.Toolkit.WeChat.DeviceTest --app=bin\Debug\net6.0-android\com.companyname.Maui.Toolkit.WeChat.DeviceTest-Signed.apk for testing

I followed the above steps to test and got TESTS_FAILED.

XHarness command issued: android test --output-directory=out --package-name=com.companyname.Maui.Toolkit.WeChat.DeviceTest --app=bin\Debug\net6.0-android\com.companyname.Maui.Toolkit.WeChat.DeviceTest-Signed.apk
info: Will attempt to run device on detected architecture: 'x86'
info: Active Android device set to serial 'emulator-5554'
info: Waiting for device to be available (max 5 minutes)
info: Attempting to remove apk 'com.companyname.Maui.Toolkit.WeChat.DeviceTest':
info: Successfully uninstalled com.companyname.Maui.Toolkit.WeChat.DeviceTest.
info: Attempting to install C:\Users\Chi\source\repos\Maui.Toolkit\test\Maui.Toolkit.WeChat\Maui.Toolkit.WeChat.DeviceTest\bin\Debug\net6.0-android\com.companyname.Maui.Toolkit.WeChat.DeviceTest-Signed.apk:
info: Successfully installed C:\Users\Chi\source\repos\Maui.Toolkit\test\Maui.Toolkit.WeChat\Maui.Toolkit.WeChat.DeviceTest\bin\Debug\net6.0-android\com.companyname.Maui.Toolkit.WeChat.DeviceTest-Signed.apk.
info: Killing all running processes for 'com.companyname.Maui.Toolkit.WeChat.DeviceTest':
info: Starting default instrumentation class on com.companyname.Maui.Toolkit.WeChat.DeviceTest (exit code 0 == success)
info: Running instrumentation class {default} took 1.2414055 seconds
fail: No value for 'return-code' provided in instrumentation result.  This may indicate a crashed test (see log)
info: Wrote current ADB log to C:\Users\Chi\source\repos\Maui.Toolkit\test\Maui.Toolkit.WeChat\Maui.Toolkit.WeChat.DeviceTest\out\adb-logcat-com.companyname.Maui.Toolkit.WeChat.DeviceTest-default.log
fail: Non-success instrumentation exit code: 82, expected: 0
info: Attempting to remove apk 'com.companyname.Maui.Toolkit.WeChat.DeviceTest':
info: Successfully uninstalled com.companyname.Maui.Toolkit.WeChat.DeviceTest.
XHarness exit code: 1 (TESTS_FAILED)

Not sure if my test steps are correct? I'll appreciate it very much if you could help me!

realZhangChi commented 3 years ago

After changing the package name to lowercase and adding permissions to AndroidManifest, I ran the command xharness android test --output-directory=out --package-name=com.companyname.maui.toolkit.wechat.devicetest --app=bin\Debug\net6.0-android\com.companyname.maui.toolkit.wechat.devicetest-Signed.apk --instrumentation=com.companyname.maui.toolkit.wechat.devicetest.TestInstrumentation --verbosity=Debug and got the result Process crashed.

......
info: Starting instrumentation class 'com.companyname.maui.toolkit.wechat.devicetest.TestInstrumentation' on com.companyname.maui.toolkit.wechat.devicetest
dbug: Raw command: 'shell am instrument  -w com.companyname.maui.toolkit.wechat.devicetest/com.companyname.maui.toolkit.wechat.devicetest.TestInstrumentation'
dbug: Executing command: 'C:\Users\Chi\.dotnet\tools\.store\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\runtimes\any\native\adb\windows\adb.exe -s emulator-5554 shell am instrument  -w com.companyname.maui.toolkit.wechat.devicetest/com.companyname.maui.toolkit.wechat.devicetest.TestInstrumentation'
info: Running instrumentation class com.companyname.maui.toolkit.wechat.devicetest.TestInstrumentation took 0.7255557 seconds
dbug: Exit code: 0
      Standard Output:
      INSTRUMENTATION_RESULT: shortMsg=Process crashed.
      INSTRUMENTATION_CODE: 0

info: Short Message:
      Process crashed.
fail: No value for 'return-code' provided in instrumentation result.  This may indicate a crashed test (see log)
dbug: Executing command: 'C:\Users\Chi\.dotnet\tools\.store\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\runtimes\any\native\adb\windows\adb.exe -s emulator-5554 logcat -d '
info: Wrote current ADB log to C:\Users\Chi\source\repos\Maui.Toolkit\test\Maui.Toolkit.WeChat\Maui.Toolkit.WeChat.DeviceTest\out\adb-logcat-com.companyname.maui.toolkit.wechat.devicetest-com.companyname.maui.toolkit.wechat.devicetest.TestInstrumentation.log
dbug: Executing command: 'C:\Users\Chi\.dotnet\tools\.store\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\runtimes\any\native\adb\windows\adb.exe -s emulator-5554 bugreport C:\Users\Chi\source\repos\Maui.Toolkit\test\Maui.Toolkit.WeChat\Maui.Toolkit.WeChat.DeviceTest\out\adb-bugreport-com.companyname.maui.toolkit.wechat.devicetest.zip'
info: Wrote ADB bugreport to C:\Users\Chi\source\repos\Maui.Toolkit\test\Maui.Toolkit.WeChat\Maui.Toolkit.WeChat.DeviceTest\out\adb-bugreport-com.companyname.maui.toolkit.wechat.devicetest.zip
fail: Non-success instrumentation exit code: 82, expected: 0
info: Attempting to remove apk 'com.companyname.maui.toolkit.wechat.devicetest':
dbug: Executing command: 'C:\Users\Chi\.dotnet\tools\.store\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\microsoft.dotnet.xharness.cli\1.0.0-prerelease.21511.3\runtimes\any\native\adb\windows\adb.exe -s emulator-5554 uninstall com.companyname.maui.toolkit.wechat.devicetest'
info: Successfully uninstalled com.companyname.maui.toolkit.wechat.devicetest.
XHarness exit code: 1 (TESTS_FAILED)

This is the log.

--------- beginning of system
10-18 06:19:10.480   529   581 W PackageManager: Not removing non-existent package com.companyname.maui.toolkit.wechat.devicetest
--------- beginning of main
10-18 06:19:10.523  3176  3176 I abb     : StartCommandInProcess(7061636b61676500696e7374616c6c00 package.install. [truncated])
10-18 06:19:10.568   529   529 W Binder:529_10: type=1400 audit(0.0:351): avc: denied { getopt } for scontext=u:r:system_server:s0 tcontext=u:r:shell:s0 tclass=unix_stream_socket permissive=0
10-18 06:19:10.642   529   640 W RuleEvaluation: Integrity rule files are not available.
10-18 06:19:10.643   529   581 I PackageManager: Integrity check passed for file:///data/app/vmdl492600847.tmp
10-18 06:19:10.659   529   581 D CompatibilityChangeReporter: Compat change id reported: 135549675; UID 10128; state: ENABLED
10-18 06:19:10.684   529   581 D PackageManager: Instant App installer not found with android.intent.action.INSTALL_INSTANT_APP_PACKAGE
10-18 06:19:10.684   529   581 D PackageManager: Clear ephemeral installer activity
10-18 06:19:10.685   529   549 V StorageManagerService: Package null does not have legacy storage
10-18 06:19:10.686  1340 12208 I MediaProvider: Invalidating LocalCallingIdentity cache for package com.companyname.maui.toolkit.wechat.devicetest. Reason: op android:read_external_storage
10-18 06:19:10.691   529   581 V BackupManagerService: [UserID:0] restoreAtInstall pkg=com.companyname.maui.toolkit.wechat.devicetest token=8 restoreSet=0
10-18 06:19:10.691   529   581 V BackupManagerService: [UserID:0] Finishing install immediately
10-18 06:19:10.686  1340 12208 I chatty  : uid=10114(com.android.providers.media.module) Binder:1340_4 identical 1 line
10-18 06:19:10.687  1340 12208 I MediaProvider: Invalidating LocalCallingIdentity cache for package com.companyname.maui.toolkit.wechat.devicetest. Reason: op android:read_external_storage
10-18 06:19:10.693   427   427 E installd: Couldn't opendir /data/app/vmdl492600847.tmp: No such file or directory
10-18 06:19:10.693   427   427 E installd: Failed to delete /data/app/vmdl492600847.tmp: No such file or directory
10-18 06:19:10.695  3176  3180 I abb     : oneway function results will be dropped but finished with status OK and parcel size 4
10-18 06:19:10.692   529   529 W Binder:529_10: type=1400 audit(0.0:352): avc: denied { getopt } for scontext=u:r:system_server:s0 tcontext=u:r:shell:s0 tclass=unix_stream_socket permissive=0
10-18 06:19:10.701  1340  1340 I MediaProvider: Invalidating LocalCallingIdentity cache for package com.companyname.maui.toolkit.wechat.devicetest. Reason: package android.intent.action.PACKAGE_ADDED
10-18 06:19:10.692   529   529 W Binder:529_10: type=1400 audit(0.0:353): avc: denied { getopt } for scontext=u:r:system_server:s0 tcontext=u:r:shell:s0 tclass=unix_stream_socket permissive=0
10-18 06:19:10.703   529   549 I RoleManagerService: Granting default roles...
10-18 06:19:10.692   529   529 W Binder:529_10: type=1400 audit(0.0:354): avc: denied { getopt } for scontext=u:r:system_server:s0 tcontext=u:r:shell:s0 tclass=unix_stream_socket permissive=0
10-18 06:19:10.711   529   631 I InputReader: Reconfiguring input devices, changes=KEYBOARD_LAYOUTS | 
10-18 06:19:10.717   705   705 V AvrcpMediaPlayerList: mPackageChangedBroadcastReceiver: action: android.intent.action.PACKAGE_ADDED
10-18 06:19:10.717   705   705 D AvrcpMediaPlayerList: Name of package changed: com.companyname.maui.toolkit.wechat.devicetest
10-18 06:19:10.717   529  2858 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 (has extras) } to com.android.packageinstaller/.PackageInstalledReceiver
10-18 06:19:10.731   529   558 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 (has extras) } to com.android.gallery3d/.app.PackagesMonitor
10-18 06:19:10.732   529   558 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 (has extras) } to com.google.android.gms/.games.chimera.GamesSystemBroadcastReceiverProxy
10-18 06:19:10.733   529   558 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 (has extras) } to com.google.android.gms/.gass.chimera.PackageChangeBroadcastReceiver
10-18 06:19:10.733   529   558 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
10-18 06:19:10.747  2123  2142 I PermissionControllerServiceImpl: Updating user sensitive for uid 10128
10-18 06:19:10.749   529   529 I Telecom : DefaultDialerCache: Refreshing default dialer for user 0: now com.android.dialer: DDC.oR@AJg
10-18 06:19:10.755   529   529 V BackupManagerConstants: getFullBackupIntervalMilliseconds(...) returns 86400000
10-18 06:19:10.755   529   529 V BackupManagerConstants: getFullBackupRequiredNetworkType(...) returns 2
10-18 06:19:10.756   529   529 V BackupManagerConstants: getFullBackupRequireCharging(...) returns true
10-18 06:19:10.765   529   557 W VoiceInteractionManager: no available voice recognition services found for user 0
10-18 06:19:10.782  1218 16394 W GCM     : Unexpected forwarded intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 cmp=com.google.android.gms/.chimera.PersistentIntentOperationService (has extras) }
10-18 06:19:10.784  1218 16394 W GCM     : Unexpected forwarded intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 cmp=com.google.android.gms/.chimera.PersistentIntentOperationService (has extras) }
10-18 06:19:10.786   933   933 D CarrierSvcBindHelper: No carrier app for: 0
10-18 06:19:10.787   529  3070 W ActivityManager: Unable to start service Intent { act=com.google.android.gms.auth.key.retrieval.service.START pkg=com.google.android.gms } U=0: not found
10-18 06:19:10.787  1567 16402 I Auth    : [SupervisedAccountIntentOperation] onHandleIntent(): android.intent.action.PACKAGE_ADDED
10-18 06:19:10.788  1567 16404 I ChromeSync: [Sync,SyncIntentOperation] Handling the intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.companyname.maui.toolkit.wechat.devicetest flg=0x4000010 cmp=com.google.android.gms/.chimera.GmsIntentOperationService (has extras) }.
10-18 06:19:10.789   529  2173 W ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@5e2fe50
10-18 06:19:10.794  1567 16402 I FontsPackageChangeOp: Package com.companyname.maui.toolkit.wechat.devicetest has no metadata
10-18 06:19:10.796  1567  1697 E GmsClient: unable to connect to service: com.google.android.gms.auth.key.retrieval.service.START on com.google.android.gms
10-18 06:19:10.808   933   933 D CarrierConfigLoader: mHandler: 9 phoneId: 0
10-18 06:19:10.846  1567 16404 I ChromeSync: [Persistence,AffiliationManager] One of affiliation or grouping data for android://QUvgElob_ONWnJO2f8enD_XM-Nz0-4-b2fN1TuIyU_5yu9h32I2IGRzJ7s9a2P-t-wnx7dJzjdONJv0vLXjYXg==@com.companyname.maui.toolkit.wechat.devicetest/ was not found. Marking affiliation data as stale...
10-18 06:19:10.874  1567 16391 E ConfigFileUtils: Failed to read config file: /data/user_de/0/com.google.android.gms/app_chimera/next_container.pb: open failed: ENOENT (No such file or directory)
10-18 06:19:10.886   529   539 I system_server: Background concurrent copying GC freed 70705(3647KB) AllocSpace objects, 23(1524KB) LOS objects, 49% free, 12MB/25MB, paused 692us total 192.917ms
10-18 06:19:10.897  1567  2013 I Icing   : IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=36 [CONTEXT service_id=21 ]
10-18 06:19:10.906  1567 16391 I ChmraDebugLogger: [73] 1801
10-18 06:19:10.909  1567 16391 I ChmraDebugLogger: [30] [Pay.optional:201817020000] permitMetered=true,
10-18 06:19:10.915  1567 16391 W ChimeraConfigService: Retry attempt was throttled.
10-18 06:19:10.925  1567  7798 W Icing   : No valid account for uploading user actions [CONTEXT service_id=21 ]
10-18 06:19:10.959  1567  7798 I Icing   : Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0 [CONTEXT service_id=21 ]
10-18 06:19:10.963  1567  2013 I Icing   : IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=null serviceId=30 [CONTEXT service_id=21 ]
10-18 06:19:10.971  1567  1892 I Icing   : IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=null serviceId=36 [CONTEXT service_id=21 ]
10-18 06:19:10.971  1567  7798 I Icing   : Indexing com.google.android.gms-apps from com.google.android.gms [CONTEXT service_id=21 ]
10-18 06:19:10.995  1567  7798 W Icing   : No valid account for uploading user actions [CONTEXT service_id=21 ]
10-18 06:19:11.004  1567  7798 I Icing   : Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0 [CONTEXT service_id=21 ]
10-18 06:19:11.009  1567  7798 W Icing   : No valid account for uploading user actions [CONTEXT service_id=21 ]
10-18 06:19:11.018  1567  7798 I Icing   : Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0 [CONTEXT service_id=21 ]
10-18 06:19:11.020  1567  7798 I Icing   : Indexing done com.google.android.gms-apps [CONTEXT service_id=21 ]
10-18 06:19:11.020  1567  7798 I Icing   : Indexing com.google.android.gms-internal.3p:MobileApplication from com.google.android.gms [CONTEXT service_id=21 ]
10-18 06:19:11.029  1567  7798 I Icing   : Indexing done com.google.android.gms-internal.3p:MobileApplication [CONTEXT service_id=21 ]
10-18 06:19:11.047 16420 16420 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
10-18 06:19:11.048 16420 16420 W app_process: type=1400 audit(0.0:355): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=1224 scontext=u:r:shell:s0 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0
10-18 06:19:11.049 16420 16420 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.profilebootclasspath"
10-18 06:19:11.049 16420 16420 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.enable_apex_image"
10-18 06:19:11.049 16420 16420 I AndroidRuntime: Using default boot image
10-18 06:19:11.049 16420 16420 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.disable_lock_profiling"
10-18 06:19:11.049 16420 16420 I AndroidRuntime: Leaving lock profiling enabled
10-18 06:19:11.053 16420 16420 E libc    : Access denied finding property "persist.device_config.runtime_native_boot.enable_generational_cc"
10-18 06:19:11.055 16420 16420 I app_process: Core platform API reporting enabled, enforcing=false
--------- beginning of kernel
10-18 06:19:11.031     0     0 W audit   : audit_lost=8 audit_rate_limit=5 audit_backlog_limit=64
10-18 06:19:11.031     0     0 E audit   : rate limit exceeded
10-18 06:19:11.048 16420 16420 W app_process: type=1400 audit(0.0:356): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=1224 scontext=u:r:shell:s0 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0
10-18 06:19:11.048 16420 16420 W app_process: type=1400 audit(0.0:357): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=1224 scontext=u:r:shell:s0 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0
10-18 06:19:11.098 16420 16420 D app_process: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
10-18 06:19:11.099 16420 16420 D app_process: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt66l.dat
10-18 06:19:11.102 16420 16420 W app_process: Unexpected CPU variant for X86 using defaults: x86
10-18 06:19:11.104 16420 16420 I app_process: The ClassLoaderContext is a special shared library.
10-18 06:19:11.115 16420 16420 W app_process: JNI RegisterNativeMethods: attempt to register 0 native methods for android.media.AudioAttributes
10-18 06:19:11.118 16420 16420 D AndroidRuntime: Calling main entry com.android.commands.am.Am
10-18 06:19:11.121   529  2858 I ActivityManager: Force stopping com.companyname.maui.toolkit.wechat.devicetest appid=10128 user=0: start instr
10-18 06:19:11.123   529  2858 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10128; state: DISABLED
10-18 06:19:11.124   529   559 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10128; state: ENABLED
10-18 06:19:11.129   288   288 D Zygote  : Forked child process 16435
10-18 06:19:11.131   529   559 I ActivityManager: Start proc 16435:com.companyname.maui.toolkit.wechat.devicetest/u0a128 for added application com.companyname.maui.toolkit.wechat.devicetest
10-18 06:19:11.137 16435 16435 I chat.devicetes: Late-enabling -Xcheck:jni
10-18 06:19:11.145 16435 16435 I chat.devicetes: Unquickening 12 vdex files!
10-18 06:19:11.145 16435 16435 W chat.devicetes: Unexpected CPU variant for X86 using defaults: x86
10-18 06:19:11.155   393   416 I adbd    : jdwp connection from 16435
10-18 06:19:11.242 16435 16435 D NetworkSecurityConfig: No Network Security Config specified, using platform default
10-18 06:19:11.243 16435 16435 D NetworkSecurityConfig: No Network Security Config specified, using platform default
10-18 06:19:11.246 16435 16435 D debug-app-helper: Checking if libmonodroid was unpacked to /data/app/~~aAYw_Nl02YQsmQ7NzusN6w==/com.companyname.maui.toolkit.wechat.devicetest-AMmILHcZijyomdC_4zEMAQ==/lib/x86/libmonodroid.so
10-18 06:19:11.246 16435 16435 D debug-app-helper: Native libs extracted to /data/app/~~aAYw_Nl02YQsmQ7NzusN6w==/com.companyname.maui.toolkit.wechat.devicetest-AMmILHcZijyomdC_4zEMAQ==/lib/x86, assuming application/android:extractNativeLibs == true
10-18 06:19:11.246 16435 16435 I debug-app-helper: Setting up for DSO lookup in app data directories
10-18 06:19:11.246 16435 16435 D debug-app-helper: Added filesystem DSO lookup location: /data/app/~~aAYw_Nl02YQsmQ7NzusN6w==/com.companyname.maui.toolkit.wechat.devicetest-AMmILHcZijyomdC_4zEMAQ==/lib/x86
10-18 06:19:11.246 16435 16435 W debug-app-helper: Using runtime path: /data/app/~~aAYw_Nl02YQsmQ7NzusN6w==/com.companyname.maui.toolkit.wechat.devicetest-AMmILHcZijyomdC_4zEMAQ==/lib/x86
10-18 06:19:11.246 16435 16435 W debug-app-helper: checking directory: `/data/user/0/com.companyname.maui.toolkit.wechat.devicetest/files/.__override__/lib`
10-18 06:19:11.246 16435 16435 W debug-app-helper: directory does not exist: `/data/user/0/com.companyname.maui.toolkit.wechat.devicetest/files/.__override__/lib`
10-18 06:19:11.246 16435 16435 W debug-app-helper: Checking whether Mono runtime exists at: /data/user/0/com.companyname.maui.toolkit.wechat.devicetest/files/.__override__/libmonosgen-2.0.so
10-18 06:19:11.246 16435 16435 W debug-app-helper: Checking whether Mono runtime exists at: /data/app/~~aAYw_Nl02YQsmQ7NzusN6w==/com.companyname.maui.toolkit.wechat.devicetest-AMmILHcZijyomdC_4zEMAQ==/lib/x86/libmonosgen-2.0.so
10-18 06:19:11.246 16435 16435 I debug-app-helper: Mono runtime found at: /data/app/~~aAYw_Nl02YQsmQ7NzusN6w==/com.companyname.maui.toolkit.wechat.devicetest-AMmILHcZijyomdC_4zEMAQ==/lib/x86/libmonosgen-2.0.so
10-18 06:19:11.247 16435 16435 W chat.devicetes: Attempt to remove non-JNI local reference, dumping thread
10-18 06:19:11.247 16435 16435 I DOTNET  : JNI_OnLoad: JNI_OnLoad in pal_jni.c
10-18 06:19:11.250 16435 16435 W monodroid: Creating public update directory: `/data/user/0/com.companyname.maui.toolkit.wechat.devicetest/files/.__override__`
10-18 06:19:11.250 16435 16435 W chat.devicetes: Attempt to remove non-JNI local reference, dumping thread
10-18 06:19:11.250 16435 16435 W monodroid: runtime args empty
10-18 06:19:11.251 16435 16435 F monodroid: No assemblies found in '/data/user/0/com.companyname.maui.toolkit.wechat.devicetest/files/.__override__' or '<unavailable>'. Assuming this is part of Fast Deployment. Exiting...
10-18 06:19:11.259   529  3096 I ActivityManager: Process com.companyname.maui.toolkit.wechat.devicetest (pid 16435) has died: fg  FGS 
10-18 06:19:11.259   288   288 I Zygote  : Process 16435 exited cleanly (65)
10-18 06:19:11.259   529   560 I libprocessgroup: Successfully killed process cgroup uid 10128 pid 16435 in 0ms
10-18 06:19:11.259   529  3096 W ActivityManager: Crash of app com.companyname.maui.toolkit.wechat.devicetest running instrumentation ComponentInfo{com.companyname.maui.toolkit.wechat.devicetest/com.companyname.maui.toolkit.wechat.devicetest.TestInstrumentation}
10-18 06:19:11.260   529  3096 I ActivityManager: Force stopping com.companyname.maui.toolkit.wechat.devicetest appid=10128 user=0: finished inst
10-18 06:19:11.262 16420 16420 D AndroidRuntime: Shutting down VM
10-18 06:19:13.868  1218 16358 E WakeLock: GCM_HB_ALARM release without a matched acquire!
10-18 06:19:13.868  1218 16358 W WakeLock: GCM_HB_ALARM counter does not exist
10-18 06:19:13.871   529   658 D ConnectivityService: reportNetworkConnectivity(101, false) by 10087
10-18 06:19:13.872   855  2727 D NetworkMonitor/101: Forcing reevaluation for UID 10087. Dns signal count: 3
10-18 06:19:13.872  1218 16358 E WakeLock: GCM_CONN_ALARM release without a matched acquire!
10-18 06:19:13.872  1218 16358 W WakeLock: GCM_CONN_ALARM counter does not exist
10-18 06:19:13.895   855 16460 D NetworkMonitor/101: PROBE_DNS www.google.com 21ms OK 108.160.163.117,2001::42dc:9b0c
10-18 06:19:14.178   855 16460 D NetworkMonitor/101: PROBE_HTTPS https://www.google.com/generate_204 time=282ms ret=204 request={Connection=[close], User-Agent=[Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36]} headers={null=[HTTP/1.1 204 No Content], Alt-Svc=[h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"], Connection=[close], Content-Length=[0], Date=[Mon, 18 Oct 2021 06:19:13 GMT], X-Android-Received-Millis=[1634537954177], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1634537954118]}
10-18 06:19:14.183   855 16459 D NetworkMonitor/101: isCaptivePortal: isSuccessful()=true isPortal()=false RedirectUrl=null isPartialConnectivity()=false Time=307ms
10-18 06:19:14.183   529   558 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.net.conn.NETWORK_CONDITIONS_MEASURED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
10-18 06:19:14.185   529   658 D ConnectivityService: [101 WIFI] validation passed
10-18 06:19:14.720     0     0 D logd    : logdr: UID=2000 GID=2000 PID=16467 n tail=0 logMask=99 pid=0 start=0ns timeout=0ns
realZhangChi commented 3 years ago

The problem is solved, see issue "How to use XHarness for testing in Maui project" in the XHarness repository.

premun commented 3 years ago

Ah, good to know!