<PropertyGroup>
<StripDebugSymbols>False</StripDebugSymbols>
<StripDebugSymbols Condition="'$(Configuration)' == 'Release'">True</StripDebugSymbols>
- <AdbTool>$(ANDROID_SDK_ROOT)\platform-tools\adb</AdbTool>
<ApkDir>$(PublishDir)apk\</ApkDir>
</PropertyGroup>
<Message Importance="High" Text="Apk: $(ApkBundlePath)"/>
<Message Importance="High" Text="PackageId: $(ApkPackageId)"/>
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="$(AdbTool) kill-server"/>
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="$(AdbTool) start-server"/>
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="$(AdbTool) logcat -c" ContinueOnError="WarnAndContinue" />
- <Message Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Importance="High" Text="Uninstalling apk (ignore errors if any):"/>
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="$(AdbTool) uninstall net.dot.HelloAndroid" ContinueOnError="WarnAndContinue" />
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="$(AdbTool) install $(ApkDir)/bin/HelloAndroid.apk" />
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(RunActivity)' != 'true' and '$(ArchiveTests)' != 'true'"
- Command="$(AdbTool) shell am instrument -e env:MONO_LOG_LEVEL warning -e env:MONO_LOG_MASK all -w net.dot.HelloAndroid/net.dot.MonoRunner"/>
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(RunActivity)' == 'true' and '$(ArchiveTests)' != 'true'" Command="$(AdbTool) shell am start -n net.dot.HelloAndroid/net.dot.MainActivity" />
- <Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="$(AdbTool) logcat -d" />
+ <Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="dotnet xharness android test --package-name=net.dot.HelloAndroid --instrumentation=net.dot.MonoRunner --app=$(ApkDir)/bin/HelloAndroid.apk --expected-exit-code=42 --output-directory=$(ApkDir)/log" />
</Target>
<ItemGroup>
Condition="'$(ArchiveTests)' != 'true'">
<!-- FIXME: only run if the TargetArchitecture matches the current architecture -->
- <!-- install and run on ios simulator -->
- <Exec Condition="'$(IosSimulator)' != '' and '$(ArchiveTests)' != 'true'" Command="xcrun simctl shutdown "$(IosSimulator)"" ContinueOnError="WarnAndContinue" />
- <Exec Condition="'$(IosSimulator)' != '' and '$(ArchiveTests)' != 'true'" Command="xcrun simctl boot "$(IosSimulator)"" />
- <Exec Condition="'$(IosSimulator)' != '' and '$(ArchiveTests)' != 'true'" Command="open -a Simulator" />
- <Exec Condition="'$(IosSimulator)' != '' and '$(ArchiveTests)' != 'true'" Command="xcrun simctl install "$(IosSimulator)" $(AppBundlePath)" />
- <Exec Condition="'$(IosSimulator)' != '' and '$(ArchiveTests)' != 'true'" Command="xcrun simctl launch --console booted net.dot.HelloiOS" />
+ <!-- install and run on ios simulator or device -->
+ <Exec Condition="'$(TargetOS)' == 'iOSSimulator'" Command="dotnet xharness apple run --app=$(AppBundlePath) --targets=ios-simulator-64 --output-directory=/tmp/out" />
+ <Exec Condition="'$(TargetOS)' == 'iOS'" Command="dotnet xharness apple run --app=$(AppBundlePath) --targets=ios-device --output-directory=/tmp/out" />
<!-- run on MacCatalyst -->
<Exec Condition="'$(TargetOS)' == 'MacCatalyst'" Command="open -W $(AppBundlePath)" />