diff --git a/crossbench/plt/android_adb.py b/crossbench/plt/android_adb.py
index 9054144..00e49e6 100644
--- a/crossbench/plt/android_adb.py
+++ b/crossbench/plt/android_adb.py
@@ -12,17 +12,16 @@
 from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, Tuple
 
 from crossbench import cli_helper
+from crossbench import path as pth
 from crossbench.plt.arch import MachineArch
 from crossbench.plt.posix import RemotePosixPlatform
 
 if TYPE_CHECKING:
-  from crossbench.path import (LocalPath, LocalPathLike, RemotePath,
-                               RemotePathLike)
   from crossbench.plt.base import CmdArg, ListCmdArgs, Platform
   from crossbench.types import JsonDict
 
 
-def _find_adb_bin(platform: Platform) -> RemotePath:
+def _find_adb_bin(platform: Platform) -> pth.RemotePath:
   adb_bin = platform.search_platform_binary(
       name="adb",
       macos=["adb", "~/Library/Android/sdk/platform-tools/adb"],
@@ -37,7 +36,7 @@
 
 def adb_devices(
     platform: Platform,
-    adb_bin: Optional[RemotePath] = None) -> Dict[str, Dict[str, str]]:
+    adb_bin: Optional[pth.RemotePath] = None) -> Dict[str, Dict[str, str]]:
   adb_bin = adb_bin or _find_adb_bin(platform)
   output = platform.sh_stdout(adb_bin, "devices", "-l")
   raw_lines = output.strip().splitlines()[1:]
@@ -58,12 +57,12 @@
 
   _serial_id: str
   _device_info: Dict[str, str]
-  _adb_bin: RemotePath
+  _adb_bin: pth.RemotePath
 
   def __init__(self,
                host_platform: Platform,
                device_identifier: Optional[str] = None,
-               adb_bin: Optional[RemotePath] = None) -> None:
+               adb_bin: Optional[pth.RemotePath] = None) -> None:
     self._host_platform = host_platform
     if adb_bin:
       self._adb_bin = cli_helper.parse_binary_path(
@@ -116,8 +115,8 @@
   def has_root(self) -> bool:
     return self.shell_stdout("id").startswith("uid=0(root)")
 
-  def path(self, path: RemotePathLike) -> RemotePath:
-    return self._host_platform.path(path)
+  def path(self, path: pth.RemotePathLike) -> pth.RemotePath:
+    return pth.RemotePosixPath(path)
 
   @property
   def serial_id(self) -> str:
@@ -250,12 +249,12 @@
   def reverse_remove(self, remote: int, protocol: str = "tcp") -> None:
     self._adb("reverse", "--remove", f"{protocol}:{remote}")
 
-  def pull(self, device_src_path: RemotePath,
-           local_dest_path: LocalPath) -> None:
+  def pull(self, device_src_path: pth.RemotePath,
+           local_dest_path: pth.LocalPath) -> None:
     self._adb("pull", self.path(device_src_path), local_dest_path)
 
-  def push(self, local_src_path: LocalPath,
-           device_dest_path: RemotePath) -> None:
+  def push(self, local_src_path: pth.LocalPath,
+           device_dest_path: pth.RemotePath) -> None:
     self._adb("push", local_src_path, self.path(device_dest_path))
 
   def cmd(self,
@@ -301,7 +300,7 @@
     self.shell("am", "force-stop", package_name)
 
   def install(self,
-              bundle: LocalPath,
+              bundle: pth.LocalPath,
               allow_downgrade: bool = False,
               modules: Optional[str] = None) -> None:
     if bundle.suffix == ".apks":
@@ -309,7 +308,9 @@
     if bundle.suffix == ".apk":
       self.install_apk(bundle, allow_downgrade)
 
-  def install_apk(self, apk: LocalPath, allow_downgrade: bool = False) -> None:
+  def install_apk(self,
+                  apk: pth.LocalPath,
+                  allow_downgrade: bool = False) -> None:
     if not apk.exists():
       raise ValueError(f"APK {apk} does not exist.")
     args = ["install"]
@@ -319,7 +320,7 @@
     self._adb(*args)
 
   def install_apks(self,
-                   apks: LocalPath,
+                   apks: pth.LocalPath,
                    allow_downgrade: bool = False,
                    modules: Optional[str] = None) -> None:
     if not apks.exists():
@@ -419,7 +420,7 @@
       raise ValueError(f"Unknown android CPU ABI: {cpu_abi}")
     return arch
 
-  def app_path_to_package(self, app_path: RemotePathLike) -> str:
+  def app_path_to_package(self, app_path: pth.RemotePathLike) -> str:
     path = self.path(app_path)
     if len(path.parts) > 1:
       raise ValueError(f"Invalid android package name: '{path}'")
@@ -429,7 +430,8 @@
       raise ValueError(f"Package '{package}' is not installed on {self._adb}")
     return package
 
-  def search_binary(self, app_or_bin: RemotePathLike) -> Optional[RemotePath]:
+  def search_binary(self,
+                    app_or_bin: pth.RemotePathLike) -> Optional[pth.RemotePath]:
     app_or_bin_path = self.path(app_or_bin)
     if not app_or_bin_path.parts:
       raise ValueError("Got empty path")
@@ -439,12 +441,12 @@
       return app_or_bin_path
     return None
 
-  def home(self) -> RemotePath:
+  def home(self) -> pth.RemotePath:
     raise RuntimeError("Cannot access home dir on (non-rooted) android device")
 
   _VERSION_NAME_RE = re.compile(r"versionName=(?P<version>.+)")
 
-  def app_version(self, app_or_bin: RemotePathLike) -> str:
+  def app_version(self, app_or_bin: pth.RemotePathLike) -> str:
     # adb shell dumpsys package com.chrome.canary | grep versionName -C2
     package = self.app_path_to_package(app_or_bin)
     package_info = self.adb.dumpsys("package", str(package))
@@ -493,7 +495,7 @@
     return int(float(match_result.group("brightness")) * 100)
 
   @property
-  def default_tmp_dir(self) -> RemotePath:
+  def default_tmp_dir(self) -> pth.RemotePath:
     return self.path("/data/local/tmp/")
 
   def sh(self,
@@ -552,10 +554,12 @@
   def stop_reverse_port_forward(self, remote_port: int) -> None:
     self.adb.reverse_remove(remote_port, protocol="tcp")
 
-  def rsync(self, from_path: RemotePath, to_path: LocalPath) -> LocalPath:
+  def rsync(self, from_path: pth.RemotePath,
+            to_path: pth.LocalPath) -> pth.LocalPath:
     return self.pull(from_path, to_path)
 
-  def pull(self, from_path: RemotePath, to_path: LocalPath) -> LocalPath:
+  def pull(self, from_path: pth.RemotePath,
+           to_path: pth.LocalPath) -> pth.LocalPath:
     device_path = self.path(from_path)
     assert self.exists(device_path), (
         f"Source file '{from_path}' does not exist on {self}")
@@ -564,16 +568,17 @@
     self.adb.pull(device_path, local_host_path)
     return to_path
 
-  def push(self, from_path: LocalPath, to_path: RemotePath) -> RemotePath:
+  def push(self, from_path: pth.LocalPath,
+           to_path: pth.RemotePath) -> pth.RemotePath:
     self.adb.push(from_path, self.path(to_path))
     return to_path
 
   def set_file_contents(self,
-                        file: RemotePathLike,
+                        file: pth.RemotePathLike,
                         data: str,
                         encoding: str = "utf-8") -> None:
     # self.push a tmp file with the given contents
-    tmp_dir: LocalPath = self.host_path(self.host_platform.mkdtemp())
+    tmp_dir: pth.LocalPath = self.host_path(self.host_platform.mkdtemp())
     try:
       tmp_file = tmp_dir / "push.data"
       with tmp_file.open("w", encoding=encoding) as f:
@@ -646,5 +651,5 @@
     }
     return self._system_details
 
-  def screenshot(self, result_path: RemotePath) -> None:
+  def screenshot(self, result_path: pth.RemotePath) -> None:
     self.sh("screencap", "-p", result_path)
diff --git a/tests/crossbench/base.py b/tests/crossbench/base.py
index 417b7af..8ed8a6c 100644
--- a/tests/crossbench/base.py
+++ b/tests/crossbench/base.py
@@ -12,7 +12,6 @@
 from typing import Final, List, Optional, Sequence, Tuple
 from unittest import mock
 
-import psutil
 from pyfakefs import fake_filesystem_unittest
 
 import crossbench
diff --git a/tests/crossbench/plt/test_android_adb.py b/tests/crossbench/plt/test_android_adb.py
index d14dd61..d0c61a5 100644
--- a/tests/crossbench/plt/test_android_adb.py
+++ b/tests/crossbench/plt/test_android_adb.py
@@ -5,9 +5,13 @@
 from __future__ import annotations
 
 import pathlib
+import unittest
 from typing import Final
 from unittest import mock
 
+import pyfakefs
+from pyfakefs.fake_filesystem import OSType
+
 from crossbench.plt.android_adb import Adb, AndroidAdbPlatform
 from crossbench.plt.arch import MachineArch
 from tests import test_helper
@@ -67,18 +71,25 @@
 class AndroidAdbOnWinMockPlatformTestCase(BaseAndroidAdbMockPlatformTestCase):
   __test__ = True
 
+  def setUp(self) -> None:
+    super().setUp()
+    self.fs.os = OSType.WINDOWS
+
   def setUpMockPlatform(self):
     self.mock_platform = WinMockPlatform()
 
+  @unittest.skip(
+      "earlier pyfakefs versions don't handle posix on win properly.")
   def test_host_platform(self):
     self.assertTrue(self.platform.host_platform.is_win)
-    # Enable path type check once we have more mocking support
-    # self.assertIsInstance(
-    #     self.platform.host_path("foo/bar"), pathlib.PureWindowsPath)
-    # self.assertNotEqual(
-    #     str(self.platform.host_path("foo/bar")),
-    #     str(self.platform.path("foo/bar")))
+    self.assertIsInstance(
+        self.platform.host_path("foo/bar"), pathlib.PureWindowsPath)
+    self.assertNotEqual(
+        str(self.platform.host_path("foo/bar")),
+        str(self.platform.path("foo/bar")))
 
+  @unittest.skip(
+      "earlier pyfakefs versions don't handle posix on win properly.")
   def test_mktemp(self):
     self.assertTrue(self.platform.default_tmp_dir.is_absolute())
     self.assertIsInstance(self.platform.default_tmp_dir, pathlib.PurePosixPath)
@@ -86,6 +97,28 @@
                     "/data/local/tmp/custom_prefix.XXXXXXXXXXX")
     self.platform.mkdtemp("custom_prefix")
 
+  @unittest.skip(
+      "earlier pyfakefs versions don't handle posix on win properly.")
+  def test_push(self):
+    local_path = self.mock_platform.path("C:/foo/push.local.data")
+    remote_path = self.platform.default_tmp_dir / "push.remote.data"
+    self.assertIsInstance(local_path, pathlib.PureWindowsPath)
+    self.fs.create_file(local_path, contents="some data")
+    self.expect_adb("push", "C:\\foo\\push.local.data",
+                    "/data/local/tmp/push.remote.data")
+    self.platform.push(local_path, remote_path)
+
+  @unittest.skip(
+      "earlier pyfakefs versions don't handle posix on win properly.")
+  def test_push_remote_win_path(self):
+    local_path = self.mock_platform.path("C:/foo/push.local.data")
+    remote_path = self.mock_platform.path("custom/push.remote.data")
+    self.assertIsInstance(local_path, pathlib.PureWindowsPath)
+    self.fs.create_file(local_path, contents="some data")
+    self.expect_adb("push", "C:\\foo\\push.local.data",
+                    "custom/push.remote.data")
+    self.platform.push(local_path, remote_path)
+
 
 class AndroidAdbMockPlatformTest(BaseAndroidAdbMockPlatformTestCase):
   __test__ = True
