Metadata-Version: 2.4
Name: xpdc
Version: 0.1.2
Summary: XPDC (X-Platform Device Connector) is designed to bridge the gap between devices across multiple platforms (Android, HarmonyOS, iOS).
Author-email: lanbaoshen <lanbaoshen@icloud.com>
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: loguru>=0.7.3
Requires-Dist: pillow>=12.1.0
Dynamic: license-file

<p align="center">
    <img src="logo.png" alt="pyecharts logo" width=200 />
</p>

# Introduction

XPDC (X-Platform Device Connector) is designed to bridge the gap between devices across multiple platforms (Android, HarmonyOS, iOS).

It allows users to operate devices on different platforms with the same set of code.

**Before using XPDC, you need to install the corresponding debug environment separately for each platform's device.**

Android is `adb`, HarmonyOS is `hdc`

# Installation

```shell
# Using uv
pip install uv
uv add xpdc

# Using pip
pip install xpdc
```

# Quick Start

## Install Dependencies

```python
from xpdc import connection, DeviceType

# Specify connect device type
conn = connection(DeviceType.ADB)
# conn = connection(DeviceType.HDC)
# iOS will support it in the future.

conn.cmd(['devices'])

device = conn.devices[0]
# You can also specify the device by its device id
# device = conn.device(device_id='device_id')

device.tap(500, 500)
device.type_text(text='lanbaoshen')
device.screenshot()
device.cmd(cmd=['shell', 'ls'])
device.shell(cmd=['ls'])

# For Android devices, additionally install ADBKeyboard.apk and enable it to support Chinese input.
device.install_and_set_adb_keyboard()
```
