{"id":15995760,"url":"https://github.com/jm199504/auto-monkey-test","last_synced_at":"2026-04-28T08:06:03.412Z","repository":{"id":164866996,"uuid":"640293868","full_name":"jm199504/Auto-Monkey-Test","owner":"jm199504","description":"ADB Monkey Testing：支持日志分批抓取 \u0026 日志自动压缩  \u0026 日志分析crash和ANR \u0026 设备重启持续下发 \u0026 指定运行时长","archived":false,"fork":false,"pushed_at":"2023-05-13T16:04:25.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T09:12:19.543Z","etag":null,"topics":["adb","android","logcat","monkey","monkey-testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jm199504.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-13T15:58:23.000Z","updated_at":"2023-06-26T02:58:58.000Z","dependencies_parsed_at":"2023-06-02T05:30:24.356Z","dependency_job_id":null,"html_url":"https://github.com/jm199504/Auto-Monkey-Test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm199504%2FAuto-Monkey-Test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm199504%2FAuto-Monkey-Test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm199504%2FAuto-Monkey-Test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jm199504%2FAuto-Monkey-Test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jm199504","download_url":"https://codeload.github.com/jm199504/Auto-Monkey-Test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271489,"owners_count":20911586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adb","android","logcat","monkey","monkey-testing"],"created_at":"2024-10-08T07:20:52.382Z","updated_at":"2026-04-28T08:06:02.246Z","avatar_url":"https://github.com/jm199504.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Auto-Monkey\n\n### Auto-Monkey在adb shell monkey基础上新增以下功能：\n1. 支持指定运行时长（单位：小时），默认无限运行Monkey直至手动终止；\n2. 支持分批下发Monkey测试指令并自动记录日志（logcat方式）；\n3. 支持对日志进行自动压缩，极大优化磁盘空间占用；\n4. 支持android设备重启，Monkey测试可继续进行；\n5. 支持自动分析crash和anr，抽离对应日志文件提取至指定目录；\n\n### 使用方法\n```commandline\npython3 main.py -packages com.aaa,com.bbb [-device 123456] [-hours 12] [-throttle 500] [-per 20000]\n```\n- packages：应用进程包列表\n- hours：运行小时（选填，默认无限时长）\n- throttle：执行间隔毫秒（选填，默认200毫秒，android设备性能越弱，间隔建议越大）\n- per：单次运行次数（选填，即每执行\u003cper\u003e次后保存一次日志）\n\n### `main`实现流程：\n1. 通过`argparse`接收用户配置\n2. `test_monkey()`方法：\n   2.1 终止Monkey进程\n\n   2.2 终止Logcat进程\n   \n   2.3 下发Logcat开始记录日志\n   \n   2.4 下发`adb shell monkey`命令\n   \n   2.5 轮询Logcat日志文件，判断是否检测到`Monkey finished`字段\n   \n   2.6 终止Monkey进程\n   \n   2.7 终止Logcat进程\n   \n   2.8 压缩日文文件\n   \n   2.9 等待5秒缓存\n3. 根据用户设定运行时长或者无限时循环`test_monkey()`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjm199504%2Fauto-monkey-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjm199504%2Fauto-monkey-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjm199504%2Fauto-monkey-test/lists"}