Skip to main content

iClick Automation Tool Without Jailbreak Python Package.

Project description

iclick-auto

PyPI version PyPI license

English | 中文

用于iOS免越狱自动化的 Python SDK。除了 API 调用功能外,还实现了断线重连和事件监听机制。

官方网站: https://iosclick.com/

安装

pip install iclick-auto

快速开始

from iclick import client as iclient

# 创建客户端实例
client = iclient()

# 监听设备事件
client.on('device:online', lambda data: print('设备上线:', data))
client.on('device:offline', lambda data: print('设备下线:', data))

# 连接服务器
client.connect()

# 调用 API
result = client.invoke('getDevices', {'deviceId': 'P60904DC8D3F'})

print('结果:', result)

API 文档

client(options)

创建客户端实例。

参数:

参数 类型 可选 说明 默认值
options.host str WebSocket 服务器地址 127.0.0.1
options.port int WebSocket 服务器端口 23188
options.autoReconnect bool 是否启用自动重连 True
options.reconnectDelay int 重连延迟(秒) 3
options.maxReconnectAttempts int 最大重连次数,0表示无限 8

示例:

from iclick import client as iclient

client = iclient({
    'host': '192.168.31.15',
    'port': 23188,
    'autoReconnect': True,
    'reconnectDelay': 5
})

client.connect()

连接到 WebSocket 服务器。

示例:

try:
    client.connect()
    print('连接成功')
except Exception as error:
    print('连接失败:', error)

client.invoke(type, params, timeout)

调用 API 方法。

参数:

  • type (str): API 类型
  • params (dict, 可选): 请求参数,默认 {}
  • timeout (int, 可选): 超时时间(秒),默认 18

返回: 响应数据

示例:

# 发送按键
result = client.invoke('sendKey', {
    'deviceId': 'P60904DC8D3F',
    'key': 'h',
    'fnkey': 'COMMAND'
})

# 自定义超时时间
result = client.invoke('someType', {'param': 'value'}, 30)

client.on(event_name, callback)

注册事件监听器。

参数:

  • event_name (str): 事件名称
  • callback (callable): 回调函数,接收事件数据作为参数

示例:

client.on('device:online', lambda data: print('设备上线:', data))
client.on('device:offline', lambda data: print('设备下线:', data))

client.off(event_name, callback)

移除事件监听器。

参数:

  • event_name (str): 事件名称
  • callback (callable, 可选): 要移除的回调函数。如果不提供,将移除该事件的所有监听器

示例:

def handler(data):
    print('收到事件:', data)

# 注册监听器
client.on('someEvent', handler)

# 移除特定监听器
client.off('someEvent', handler)

# 移除事件的所有监听器
client.off('someEvent')

client.destroy()

销毁客户端,断开连接并清理所有资源。

示例:

client.destroy()
print('客户端已销毁')

License

MIT

相关链接

问题反馈

如有问题,请在 Issues 中反馈。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iclick_auto-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iclick_auto-1.0.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file iclick_auto-1.0.0.tar.gz.

File metadata

  • Download URL: iclick_auto-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iclick_auto-1.0.0.tar.gz
Algorithm Hash digest
SHA256 789d81e9193840a6522fb35de07e765e21e2412630fb45c9795a0bd0e4f9fe4b
MD5 9c43d520d76adf8b83a1f894f2b88d00
BLAKE2b-256 a5ffecc2895ce917c26145cfd632e3798c1c4f294c9d812b2b775e8bb9b5245e

See more details on using hashes here.

Provenance

The following attestation bundles were made for iclick_auto-1.0.0.tar.gz:

Publisher: publish-pypi.yml on Undefined-Token/iclick-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iclick_auto-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: iclick_auto-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iclick_auto-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89a61ffae4dfc640d1748d0070874f6e6ac0b05c4bc9361866473324f138d1ec
MD5 3377d106d2ed7523344875654726f78d
BLAKE2b-256 75bf16010c6e0086af67dcfa2afbe124b62c84ed8d3c10c200539df584905be2

See more details on using hashes here.

Provenance

The following attestation bundles were made for iclick_auto-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Undefined-Token/iclick-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page