迫于找不到好用的 Android 自动化软件,自己做了一套,顺带开个源
資深大佬 : lookcos 7
简介:
hermit,是一款支持多种语言的轻量级的安卓操作软件,支持快速的点击、滑动、读取与设置剪切板、模拟输入、寻找控件并点击等。摆脱 ADB,通过 HTTP API 的方式控制,对局域网和模拟器支持不错。
hermit 的工作方式

hermit 项目地址
APP: https://github.com/LookCos/hermit
Python 操作模块: https://github.com/LookCos/hermit-py
喜欢别忘了来颗 star
蓝奏云下载地址: https://wwi.lanzous.com/b05mv4csd 密码:22qz
使用方法
在要被操作的手机上安装 hermit APP,如果使用 python,请下载 pyhermit 并安装,其他语言请移步 github,根据 HTTP API 直接操作。
演示:群聊抢红包

import time from pyhermit import Hermit hm = Hermit('127.0.0.1:9999') # 每隔 0.1 秒监视一次 while not hm._is_clickable('text', '微信红包'): time.sleep(0.1) hm.click_text('微信红包') # 模拟器配置低,打开红包过程略慢,需要等待 1 秒钟,才能再开。 hm.click_desc('开', 1)
演示:打开酷安并快速找到并进入 iPhone SE 区

import time from pyhermit import Hermit # 实例化 hm = Hermit('127.0.0.1:9999') # 按下 home 键 hm.action_home() hm.click_channel([ {'text': '酷安'}, {'text': '闲聊'}, {'text': '数码'}, {'text': '平板'}, {'text': '手机'}, {'text': '苹果'} ]) # 如果没找到,就一直下滑,直到找到为止。 while not hm._is_clickable('text', 'iPhone SE'): hm.swipe_up(4) time.sleep(0.2) hm.click_text('iPhone SE')
打开微信,并搜索 V2EX

import time from pyhermit import Hermit hm = Hermit('127.0.0.1:9999') hm.click_text('微信', 1) hm.shell_tap(670, 86) time.sleep(1) hm.input('id', 'com.tencent.mm:id/bhn', 'v2ex') hm.click_id('com.tencent.mm:id/b3b', 1) time.sleep(5) # 等待搜索结果 hm.swipe_up(5)
大佬有話說 (17)