{"id":13305908,"url":"https://github.com/yanbo92/iOS-perf","last_synced_at":"2025-03-10T14:32:26.811Z","repository":{"id":38037993,"uuid":"412317304","full_name":"yanbo92/iOS-perf","owner":"yanbo92","description":"A iOS APP Performance Testing Tool. 这是一款iOS性能监控工具，支持Mac以及Windows端运行，电脑通过USB连接手机后运行脚本即可。本项目基于jlintxia开源的iOS测试方案修改而来，增加动态建表，动态增加grafana面板以及docker打包环境等特性。其中iOS性能数据来源于开源工具tidevice和py-ios-device。","archived":false,"fork":false,"pushed_at":"2022-07-07T08:58:25.000Z","size":7881,"stargazers_count":106,"open_issues_count":11,"forks_count":25,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-29T18:36:49.349Z","etag":null,"topics":["docker-compose","grafana","ios","performance","python3","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/yanbo92.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}},"created_at":"2021-10-01T03:52:33.000Z","updated_at":"2024-07-10T13:55:45.000Z","dependencies_parsed_at":"2022-07-06T16:32:17.003Z","dependency_job_id":null,"html_url":"https://github.com/yanbo92/iOS-perf","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/yanbo92%2FiOS-perf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanbo92%2FiOS-perf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanbo92%2FiOS-perf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanbo92%2FiOS-perf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yanbo92","download_url":"https://codeload.github.com/yanbo92/iOS-perf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221180034,"owners_count":16770698,"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":["docker-compose","grafana","ios","performance","python3","testing"],"created_at":"2024-07-29T17:55:20.067Z","updated_at":"2024-10-23T09:30:30.418Z","avatar_url":"https://github.com/yanbo92.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS-perf\n\n[READ IN ENGLISH](./README_EN.md)\n\n这是一款iOS性能监控工具，支持Mac以及Windows端运行，电脑通过USB连接手机后运行脚本即可。\n\n当前支持获取的性能数据包括GPU、CPU、内存、FPS、功耗、网络、温度，以及一系列手机硬件数据，并将根据需求继续新增。\n\n本项目基于jlintxia开源的iOS测试方案修改而来，增加动态建表，动态增加grafana面板以及docker打包环境等特性。其中iOS性能数据来源于开源工具tidevice和py-ios-device。\n\n\n注意：本项目依赖MySQL进行性能数据存储，Grafana进行数据动态展示，也就是说需要在本机或者可达的网络（比如公司局域网）\n上搭建MySQL+Grafana服务，我提供了一份docker-compose.yml文件，可以使用docker快速搭建一套环境。\n\n\n\n## 效果展示\n\n![gif](iOS-perf-3x.gif)\n\n  \n\n\n\n\n\n## 准备工作\n\n服务端搭建依赖docker以及docker-compose，安装指南：\n\n\u003ehttps://dockerdocs.cn/get-docker/\n\u003e\n\u003ehttps://dockerdocs.cn/get-started/08_using_compose/\n\n运行测试依赖python3环境，安装指南：\n\n\u003ehttps://www.python.org/downloads/\n\n\n### 服务端搭建\n\n命令行运行\n\n```\ndocker -v \u0026\u0026 docker-compose -v\n```\n\n如果能正常输出版本，如下，则表示docker环境正常，可以继续\n\n\u003eDocker version 20.10.8, build 3967b7d\n\u003e\n\u003edocker-compose version 1.29.2, build 5becea4c\n\n拉取镜像并启动服务：\n\n```\ndocker-compose up -d  \n```\n**提示：初次打开`Grafana`时，系统会提示你修改密码，为了方便建议不修改，即保持账号密码均为`admin`，否则在python运行指令中将要进行对应的传参。**\n\n\n\n### 本地环境搭建\n\n命令行执行\n\n```\npip install -r requirements.txt\n```\n\n\n\n\n\n\n\n\n## 运行命令\n命令行执行：\n```shell\npython run.py --udid=00008110-001A4D483CF2801E \\\n--bundleid=com.apple.Preferences \\\n--grafana_host=localhost \\\n--grafana_port=30000 \\\n--grafana_user=admin \\\n--grafana_password=admin \\\n--mysql_host=localhost \\\n--mysql_port=33306 \\\n--mysql_username=root \\\n--mysql_password=admin \\\n--mysql_db=iOSPerformance\n```\n\n\n### 运行参数说明\n\n\n\n#### 建议修改参数\n\n\u003e- --bundleid：待测APP的包名，通过`ideviceinstaller -l`获取，默认值为`com.apple.Preferences`\n\u003e- --udid iPhone：手机的唯一标识符，通过 `idevice_id -l` 获取，客户端只连接一台手机时不用写\n\n\n\n#### Grafana可选参数\n\n\u003e - --grafana_host：Grafana的主机地址，只写ip，不用写Scheme，也就是`http://`或者`https//`，默认值localhost\n\u003e - --grafana_port：Grafana的端口号，默认值30000\n\u003e - --grafana_user：Grafana的用户名，默认值admin\n\u003e - --grafana_password：Grafana的密码，默认值admin\n\n\n\n#### MySQL可选参数\n\n\u003e - --mysql_host：MySQL的主机地址，不用写Scheme，也就是`http://`或者`https//`，默认值localhost\n\u003e - --mysql_port：MySQL的端口号，默认值33306\n\u003e - --mysql_user：MySQL的用户名，默认值root\n\u003e - --mysql_password：MySQL的密码，默认值admin\n\n\n\n## 数据导出\n\n命令行执行：\n```shell\npython mysql.py --runid=iphone6_1008_1532 \\\n--mysql_host=localhost \\\n--mysql_port=33306 \\\n--mysql_username=root \\\n--mysql_password=admin \\\n--mysql_db=iOSPerformance\n```\n\n其中，`--runid`为必须参数，可以从显示测试数据的Grafana页面的左上角找到，通常为手机名称+月日+时分。其余Mysql参数均为可选参数，默认值与上方[MySQL可选参数](#MySQL可选参数)相同。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanbo92%2FiOS-perf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanbo92%2FiOS-perf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanbo92%2FiOS-perf/lists"}