15 Star 73 Fork 34

Gitee 极速下载 / SoloPi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/alipay/SoloPi
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

SoloPi

GitHub stars GitHub license GitHub release API TesterHome

English Version: README

SoloPi是一个无线化、非侵入式的Android自动化工具,公测版拥有录制回放、性能测试、一机多控三项主要功能,能为测试开发人员节省宝贵时间。 SoloPi新增鸿蒙版本,欢迎大家试用,切到 solopi-harmony分支

功能特性

录制回放

录制回放

游戏录制回放使用视频

Native应用录制回放使用视频

SoloPi拥有录制操作的能力,用户只需要通过SoloPi执行用例步骤,SoloPi就能够将用户的操作记录下来,并且支持在各个设备上进行回放,这一切都能够在手机上独立完成。详见录制回放一篇。

SoloPi JSON 可以转化为其他自动化脚本,目前支持 Appium 和 Macaca ,可以前往 https://github.com/soloPi/SoloPi-Convertor 下载体验,欢迎Watch、Star、Fork 三连。

性能工具

性能工具

性能工具使用视频

响应耗时计算使用视频

SoloPi能够记录待测应用的各项指标,你可以在悬浮窗中观察实时更新的数据,也可以对性能数据进行录制,在录制结束后查看图表;同时,SoloPi还支持性能加压,能够对CPU、内存与网络环境进行限制,复现应用在性能较差、网络环境不佳场景下的表现。

除了常规性能指标,SoloPi还提供了启动耗时计算工具,测试同学只需要点击两次按钮,就可以得到最贴近用户体验的启动耗时数据。同时,启动耗时计算工具还可以通过广播调用,可以非常方便的与UI自动化测试打通。详见性能工具一篇。

一机多控

一机多控

一机多控使用视频

SoloPi支持通过操作一台主机设备来控制多台从机设备,不需要在各个设备上分别进行重复冗杂的兼容性测试,能够极大提升兼容性测试的效率。详见一机多控一篇。

构建

开源部分包含录制回放与性能测试工具,一机多控功能由于稳定性原因暂时我们还没有开源,后续我们会继续推进。

编译环境:

  • macOS 10.14.3
  • Android Studio 4.0
  • Gradle 6.1.1
  • CMake 3.6/3.10均可
  • Ndk 16
  • TargetApi 29
  • MinimumApi 18
  • 注意,构建时请将Android Studio的instant run功能关闭,否则打出来的安装包会无法使用

快速开始

下载配置Android SDK路径

前往https://developer.android.com/studio/releases/platform-tools#downloads下载对应系统版本的SDK Platform Tools,解压好后在系统环境变量中添加环境变量ANDROID_SDK=${sdk解压路径}。你也可以参考网上的一些adb配置文档进行准备,比如 https://sspai.com/post/40471

对于Windows 10以上,配置完环境变量后就可以在新开启的命令行中生效,对于较老版本的Windows系统,需要重启PC才能生效,对于Linux和macOS系统,请通过echo $ANDROID_SDK的方式检验是否生效。

开启手机的开发者模式

请打开手机设置应用,在关于手机->软件信息菜单下,连续点击编译编号一项7次,系统会提示您已进入开发者模式或者类似文案(不同的系统版本开发者模式开启方式略有不同)。

回到设置应用根页面,可以看到开发者选项一项,开启USB调试功能。

常见问题

** 如果使用过程中有遇到问题,可以先去FAQ查找是否有解决方法 **

对于VIVO设备,如果在开发者选项中包含“USB安全操作”,需要手动进行开启,否则录制回放与一机多控功能可能会无法正常操作

对于小米设备,需要开启开发者选项中的USB安装USB调试(安全设置),否则录制回放与一机多控功能会无法正常操作;此外,还需要手动开启SoloPi应用权限中的后台弹出界面选项,否则无法正常使用

对于魅族设备,如果待测应用属于支付、金融类应用,需要在手机管家中关闭安全支付功能,否则录制回放与一机多控功能可能会无法正常操作

对于华为设备,需要开启开发者选项中的 "仅充电"模式下允许ADB调试,否则断开USB线后会提示adb调试中断

对于OPPO设备,系统会10分钟自动断开USB调试,导致SoloPi不可用。如果想要保持调试稳定,需要将设备连接到电脑

如果设备有安全输入法,请前往系统设置->输入法关闭安全输入法,否则例如密码等一些输入框无法正常输入

连接设备并开启wifi调试端口

请先连接设备到PC,通过下方命令检查设备是否与电脑建立好连接。

连接时,您的设备上会提示是否允许USB调试,请选择确定。

Windows:

   %ANDROID_SDK%\platform-tools\adb.exe devices

macOS或Linux:

   $ANDROID_SDK/platform-tools/adb devices

如果命令行显示出对应的设备号(如下图所示),则表示连接成功。

建立连接

对于Windows系统,需要安装Android设备的驱动程序才可以连接成功,可以前往手机厂商官网下载安装对应的驱动程序(通常厂商会将驱动程序集成在手机管家程序中,可以通过下载安装手机管家配置驱动)

如果显示的不是device,请确认下您的设备是否已经安装好驱动,并且允许了USB调试,部分手机需要将连接模式设置为传输图片(MTP)模式才可正常连接。

单机场景

Windows:

   %ANDROID_SDK%\platform-tools\adb.exe tcpip 5555

macOS或Linux:

   $ANDROID_SDK/platform-tools/adb tcpip 5555

通常设备会显示restarting in TCP mode port: 5555来提示手机已开启无线ADB调试模式。

请确保设备处于安全的网络环境,不要随意允许ADB调试请求,以免给您带来不必要的损失。

多机场景

在设备号列表中找到您需要使用的设备,请记录下device字段之前的一段字母数字组合,这个是手机的序列号。

Windows:

   %ANDROID_SDK%\platform-tools\adb.exe -s ${之前记录的序列号} tcpip 5555

macOS或Linux:

   $ANDROID_SDK/platform-tools/adb -s ${之前记录的序列号} tcpip 5555

下载打包好的SoloPi APK(SoloPi.apk文件),或者clone源码在本地编译,具体在SoloPi中的操作可以参考: 第一次使用

文档

代码导读

  • app: 应用业务逻辑。
  • shared: 应用核心功能,主要包含node(页面节点获取操作)、event(各类事件监控获取,包含辅助功能事件、触摸事件)、io(数据维护,数据库)、display(性能工具监控项)
  • common: 应用框架功能,包含adb能力包装、全局Service能力、消息模块与常用工具。
  • mdlibrary: ExportService对应的Proxy生成(引用)
  • permission: 权限处理包(引用)
  • AdbLib: ADB连接处理(引用)
  • androidWebscokets: Android实现的WebSocket(引用)

内容讨论

面向行业测试相关从业人员,对工具有什么意见或者建议的话也欢迎Issue、PR或加群讨论。

  • 钉钉群(一群已满,请添加二群):

group

  • 微信群:

    目前微信群已满,推荐加入钉钉群 **除了钉钉群外,我们在TesterHome也有相关板块,可以在社区里留言回复 https://testerhome.com/topics/node152 **

贡献

SoloPi 需要开发者们的共建,也希望能在开发者的支持下更好的发展,如果你基于SoloPi开发出了更贴近业务场景的能力(商业/非商业),欢迎和我们联系,也希望能主动为开源出力,提交各种 features/bugfix/issue ,共同维护SoloPi这套自动化工具。

如何贡献

代码贡献 : SoloPi 开发参与说明书

独乐乐不如众乐乐,开源的核心还是在于技术的分享交流,当你对开源项目产生了一些想法时,有时还会有更加Smart的表达方式,比如(Thanks to uiautomator2):

  • 我们的业务需要这项功能 ==> 我加了个功能,可以在很多场景用到,已经提交MR了。

  • 这块儿功能有更详细的文档吗? ==> 这块内容我改了一下,更方便使用了,帮忙合并一下。

  • 我在XXX上怎么用不了啊? ==> 在XXX手机上功能有点问题,我已经修复了。

  • 我刚用了XXX功能,怎么和文档上不一样啊? ==> 我根据文档试用了一下,碰到了一些坑,这是我在ATA、Lark发的踩坑贴,有些内容可以补充一下。

  • 这个是不是一直维护啊? ==> 我能做些什么?

    当然,Star、Fork、Merge Request、Issue等功能也随时欢迎大家使用哈!

    如果你有什么好的想法,也可以与我们直接联系,进行更加深入的讨论,我们希望将这套移动端的测试工具框架进行更好的推广,欢迎大家多多宣传。

致谢

我们在开发过程中使用了一些第三方库,这些库的信息可以在 版权信息 中进行查看。

开源许可

This project is under the Apache 2.0 License. See the LICENSE file for the full license text.

Copyright (C) 2015-present, Ant Financial Services Group

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Disclaimer (免责声明)

免责声明

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2015-present, Ant Financial Services Group Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

Soloπ是一个无线化、非侵入式的Android自动化测试工具,公测版拥有录制回放、性能测试、一机多控三项主要功能,能为测试开发人员节省宝贵时间 展开 收起
Java 等 6 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/mirrors/SoloPi.git
git@gitee.com:mirrors/SoloPi.git
mirrors
SoloPi
SoloPi
master

搜索帮助