# Architecture
```mermaid
flowchart TD
subgraph ClientSide["Test Client"]
T["Test Code"]
CL["Appium Client Library
(Java / Python / JS / Ruby / C#)"]
end
subgraph ServerHost["Automation Host"]
AS["Appium Server
WebDriver HTTP API"]
XD["UiAutomator2 Driver
(appium-uiautomator2-driver)"]
ADBM["ADB + Port Forwarding"]
CDM["Chromedriver Management
(hybrid / webview only)"]
end
subgraph DeviceTarget["Android Device / Emulator"]
U2S["UiAutomator2 Server
(instrumentation HTTP API)"]
UIA["UiAutomator Framework"]
CD["Chromedriver
(in webview context)"]
AUT["Application Under Test"]
end
T --> CL
CL -->|"W3C WebDriver over HTTP"| AS
AS -->|"Forwards session commands to driver"| XD
XD -->|"Install, shell, forward ports"| ADBM
XD -->|"Context switch to WEBVIEW_*"| CDM
ADBM -->|"adb forward (e.g. host:8200 → device:6790)"| U2S
CDM -->|"Chromedriver HTTP"| CD
U2S -->|"UiAutomator APIs"| UIA
UIA -->|"UI interactions + accessibility tree"| AUT
CD -->|"WebDriver in webview"| AUT
```