Back to Skiasharp

Setup Guide

.agents/skills/release-testing/references/setup.md

3.119.44.0 KB
Original Source

Setup Guide

Prerequisites and environment setup for integration tests.

Prerequisites

All Platforms

bash
dotnet workload install maui wasm-tools
npm install -g appium
appium driver install mac2 uiautomator2 xcuitest

Docker (Linux tests)

Docker Desktop must be installed and running. Verify with:

bash
docker --version
docker info --format '{{.OSType}}'  # Should output "linux"

The LinuxConsoleTests use SkiaSharp.NativeAssets.Linux.NoDependencies (statically linked) to avoid system dependency issues in minimal containers.

Playwright (Blazor tests)

bash
cd tests/SkiaSharp.Tests.Integration
dotnet build -p:SkiaSharpVersion=X.Y.Z -p:HarfBuzzSharpVersion=X.Y.Z.N
pwsh bin/Debug/net8.0/playwright.ps1 install chromium

macOS Additional

  • Install Carthage: brew install carthage
  • Select Xcode: sudo xcode-select -s /Applications/Xcode.app

Windows Additional

  1. Install WinAppDriver
  2. Enable Developer Mode in Settings

Android Setup

Locating Android SDK

Check these common locations in order:

  1. $ANDROID_HOME or $ANDROID_SDK_ROOT (if set)
  2. $HOME/Library/Android/sdk (macOS default)
  3. $HOME/Android/Sdk (Linux default)
  4. C:\Users\<user>\AppData\Local\Android\Sdk (Windows default)

If not found: Ask user for path, then verify platform-tools/adb and emulator/emulator exist.

Required Tools

Once SDK is located, verify:

  • adb version works
  • emulator -list-avds returns output

Required Emulators

TypeAPI LevelPurpose
Old21-23Minimum supported Android
New35-36Latest Android

To check existing AVDs: List with emulator -list-avds, then check each AVD's config.ini for image.sysdir containing android-XX where XX is the API level.

To create missing emulators:

  1. Install system image: sdkmanager "system-images;android-{API};google_apis;arm64-v8a"
  2. Create AVD: avdmanager create avd -n {name} -k "system-images;android-{API};google_apis;arm64-v8a" -d pixel

For API 36+, use google_apis_playstore instead of google_apis.

Starting Emulators

⚠️ CRITICAL: Always use -wipe-data to ensure a clean emulator state.

  1. Start with wipe: emulator -avd {name} -wipe-data -no-snapshot -no-audio
  2. Wait for boot: poll adb shell getprop sys.boot_completed until it returns 1
    • Fresh wipe takes 60-120 seconds to boot (vs 15-30s without wipe)
  3. Verify API level: adb shell getprop ro.build.version.sdk

Note: If emulator or adb are not in PATH, locate them via the SDK path documented above (e.g., $ANDROID_HOME/emulator/emulator).


iOS Setup

List Available Runtimes

bash
xcrun simctl list runtimes | grep -i ios

Tests require oldest and newest available runtimes.

Device Selection

  • Prefer iPhone over iPad (more common)
  • Any model works — tests validate rendering, not device features
  • Be consistent — use same device type for old and new runtimes

To find devices for a runtime: xcrun simctl list devices available | grep -A10 "iOS {version}"


Pre-Flight Verification

Before running release tests, verify:

  1. Android SDK foundadb version works
  2. Old Android emulator exists — AVD with API 21-23
  3. New Android emulator exists — AVD with API 35-36
  4. iOS runtimes available — at least 2 different versions
  5. Appium installedwhich appium returns path
  6. Appium drivers installedappium driver list --installed shows uiautomator2, xcuitest
  7. Docker availabledocker info succeeds (for Linux console tests)

If any check fails: Fix before proceeding. Do not skip tests.


Package Sources

Test project uses these feeds (pre-configured in nuget.config):

  • SkiaSharp Preview: https://aka.ms/skiasharp-eap/index.json
  • dotnet-public: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json