iClick Automation Tool Without Jailbreak Python Package.
Project description
iclick-auto
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
相关链接
- API参考: https://iosclick.com/zh/api/index.html
- 事件通知: https://iosclick.com/zh/api/notify.html
- PyPI 包: https://pypi.org/project/iclick-auto/
问题反馈
如有问题,请在 Issues 中反馈。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
789d81e9193840a6522fb35de07e765e21e2412630fb45c9795a0bd0e4f9fe4b
|
|
| MD5 |
9c43d520d76adf8b83a1f894f2b88d00
|
|
| BLAKE2b-256 |
a5ffecc2895ce917c26145cfd632e3798c1c4f294c9d812b2b775e8bb9b5245e
|
Provenance
The following attestation bundles were made for iclick_auto-1.0.0.tar.gz:
Publisher:
publish-pypi.yml on Undefined-Token/iclick-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iclick_auto-1.0.0.tar.gz -
Subject digest:
789d81e9193840a6522fb35de07e765e21e2412630fb45c9795a0bd0e4f9fe4b - Sigstore transparency entry: 772176950
- Sigstore integration time:
-
Permalink:
Undefined-Token/iclick-python@3679481903f7ca6d1fa4cf654a520912242e1376 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Undefined-Token
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@3679481903f7ca6d1fa4cf654a520912242e1376 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89a61ffae4dfc640d1748d0070874f6e6ac0b05c4bc9361866473324f138d1ec
|
|
| MD5 |
3377d106d2ed7523344875654726f78d
|
|
| BLAKE2b-256 |
75bf16010c6e0086af67dcfa2afbe124b62c84ed8d3c10c200539df584905be2
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iclick_auto-1.0.0-py3-none-any.whl -
Subject digest:
89a61ffae4dfc640d1748d0070874f6e6ac0b05c4bc9361866473324f138d1ec - Sigstore transparency entry: 772176959
- Sigstore integration time:
-
Permalink:
Undefined-Token/iclick-python@3679481903f7ca6d1fa4cf654a520912242e1376 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Undefined-Token
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@3679481903f7ca6d1fa4cf654a520912242e1376 -
Trigger Event:
push
-
Statement type: