https://github.com/ospoon/adb_auto
使用Python来操作adb命令
https://github.com/ospoon/adb_auto
adb android python
Last synced: about 1 month ago
JSON representation
使用Python来操作adb命令
- Host: GitHub
- URL: https://github.com/ospoon/adb_auto
- Owner: OSpoon
- Created: 2019-01-19T14:16:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T03:34:00.000Z (over 7 years ago)
- Last Synced: 2025-06-29T18:52:20.831Z (11 months ago)
- Topics: adb, android, python
- Language: Python
- Homepage:
- Size: 615 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### adb_auto
使用Python来执行adb命令
##### 使用方法
1. 初始化adb_tools
```
adb_tools = adb_tools()
```
2. 输出连接信息和设备信息
```
adb_tools.print()
```
3. 执行命令
常用:
```
adb_tools.adb_click(int(random.uniform(838, 1030)), int(random.uniform(1155, 1347)))
```
```
adb_tools.adb_swipe(24, 1047, 24, 175)
```
```
adb_tools.adb_input('hello')
```
```
adb_tools.adb_dump()
```
```
adb_tools.adb_key(str(67))
```
其他:
```
command = '-d shell sh /data/data/me.piebridge.brevent/brevent.sh'
print('激活:' + command)
print(adb_tools.adb_run(command))
```
##### 注释
- auto_adb.py中的auto_adb类来自开源项目wechat_jump_game
- Tools目录来自开源项目wechat_jump_game
- 添加adb_tools类添加adb_click,adb_swipe,adb_input,adb_dump,adb_key及adb_run
- 修改默认adb执行出现OSError时Tools下adb.exe的引用