Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa0128 committed Apr 17, 2023
1 parent 7e32ba3 commit 938681f
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 56 deletions.
49 changes: 32 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,39 @@
<br>
</p>

## Preview
## 🔎Preview

SoloX - Real-time collection tool for Android/iOS performance data.

We are committed to solving inefficient, cumbersome test execution, and our goal is Simple Test In SoloX!

<img src="https://cdn.nlark.com/yuque/0/2022/png/153412/1662348054846-b0164165-e83a-443e-9a05-8c1f9ddb355f.png?x-oss-process=image%2Fresize%2Cw_1500%2Climit_0" width="100%" >

## Installation
## 📦Requirements

- Install Python 3.10 + [**Download**](https://www.python.org/downloads/)

💡 Python 3.6 ~ 3.9 , please download a version of solox lower than 2.5.4.

💡 If Windows users need to test ios, install and start Itunes.

## 📥Installation

### default

```shell
1.Python:3.10+ (Python 3.6 ~ 3.9 Please download a version of solox lower than 2.5.4)
2.pip install -U solox
3.pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple -U solox (China)
pip install -U solox
```

### mirrors

Note: If Windows users need to test ios, install and start Itunes
```shell
pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple -U solox
```

## Startup SoloX
💡 If your network is unable to download through [pip install -U solox], please try using mirrors to download, but the download of Solox may not be the latest version.

## 🚀Startup SoloX

### default

Expand All @@ -48,7 +62,7 @@ python -m solox
python -m solox --host={ip} --port={port}
```

## Collect in python
## 🏴󠁣󠁩󠁣󠁭󠁿Collect in python

```python
from solox.public.apm import APM
Expand All @@ -67,7 +81,7 @@ battery = apm.collectBattery() # level:% temperature:°C current:mA voltage:mV p
gpu = apm.collectGpu() # % only supports ios
```

## Collect in API
## 🏴󠁣󠁩󠁣󠁭󠁿Collect in API

### Start the service in the background

Expand All @@ -87,14 +101,15 @@ iOS: http://{ip}:{port}/apm/collect?platform=iOS&pkgname=com.bilibili.app.in&tar
target in ['cpu','memory','network','fps','battery','gpu']
```

## PK Model

- 2-devices: test the same app on two different phones
- 2-apps: test two different apps on two phones with the same configuration

notice: only supports android
## 🔥Features

<img src="https://cdn.nlark.com/yuque/0/2022/png/153412/1662348055024-96e38b5e-d6b4-4a06-8070-0707e2fbcd99.png?x-oss-process=image%2Fresize%2Cw_1500%2Climit_0" width="100%">
* **No ROOT/Jailbreak:** No need of Root for Android devices, Jailbreak for iOS devices. Efficiently solving the test and analysis challenges in Android & iOS performance.
* **Data Integrality:** We provide the data about Screenshot, CPU, GPU, Memory, Battery, Network,FPS, Jank, etc., which you may easy to get.
* **Beautiful report board:** A beautiful and detailed report analysis, where to store, visualize, edit, manage, and download all the test cases collected with SoloX no matter where you are or when is it.
* **Useful monitoring settings:** Support setting alarm values, collecting duration, and accessing mobile devices on other PC machines during the monitoring process.
* **PK model:** Supports simultaneous comparative testing of two mobile devices.
🌱2-devices: test the same app on two different phones.
🌱2-apps: test two different apps on two phones with the same configuration.

## Browser

Expand All @@ -105,6 +120,6 @@ notice: only supports android
- windows: PowerShell
- macOS:iTerm2 (https://iterm2.com/)

## Thanks
## 💕Thanks

- https://github.com/alibaba/taobao-iphone-device
82 changes: 53 additions & 29 deletions README.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a>中文</a> | <a href="./README.md">English</a>
<a>English</a> | <a href="./README.zh.md">中文</a>
</p>

<p align="center">
Expand All @@ -13,47 +13,66 @@
<p align="center">
<a href="https://pypi.org/project/solox/" target="__blank"><img src="https://img.shields.io/pypi/v/solox" alt="solox preview"></a>
<a href="https://pypistats.org/packages/solox" target="__blank"><img src="https://img.shields.io/pypi/dm/solox"></a>

<br>
</p>

## 简介
## 🔎简介

SoloX - Android/iOS性能数据实时采集工具
SoloX - Android/iOS性能数据的实时采集工具

我们致力于解决低效、繁琐的测试执行,我们的目标是【Simple Test in SoloX】
我们致力于解决低效、繁琐的测试执行问题,我们的目标是在【Simple Test In SoloX】

<img src="https://cdn.nlark.com/yuque/0/2022/png/153412/1662348054846-b0164165-e83a-443e-9a05-8c1f9ddb355f.png?x-oss-process=image%2Fresize%2Cw_1500%2Climit_0" width="100%" >

## 安装
## 📦环境

- 安装 Python 3.10 + [**Download**](https://www.python.org/downloads/)

💡 Python 3.6 ~ 3.9 , 请安装solox版本低于2.5.4.

💡 如果Windows用户需要测试iOS,请先安装Itunes.

## 📥安装

### 默认

```shell
1.Python:3.10+ (Python 3.6 ~ 3.9 请下载低于2.5.4的版本)
2.pip install -U solox
3.pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple -U solox (在国内推荐使用镜像下载)
pip install -U solox
```

注意: 如果Windows用户需要测试ios,先安装并启动iTunes
### 镜像

```shell
pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple -U solox
```

## 启动SoloX
💡 如果你的网络无法通过 [pip install -U solox] 下载, 可以尝试使用镜像下载,但是可能不是最新版本.

## 🚀启动SoloX

### 默认

```shell
python -m solox
```

### 自定义

```shell
python -m solox --host={ip} --port={port}
```

## 使用python收集
## 🏴󠁣󠁩󠁣󠁭󠁿使用python收集

```python
from solox.public.apm import APM
# solox version >= 2.1.2

apm = APM(pkgName='com.bilibili.app.in',deviceId='ca6bd5a5',platform='Android', surfaceview=True, noLog=True)
apm = APM(pkgName='com.bilibili.app.in',deviceId='ca6bd5a5',platform='Android', surfaceview=True, noLog=True)
# apm = APM(pkgName='com.bilibili.app.in', platform='iOS') only supports one device
# surfaceview: False = gfxinfo (手机开发者-GPU呈现模式- adb shell dumpsys gfxinfo)
# noLog : False (会把测试数据写到log文件)
# surfaceview: False = gfxinfo (Developer - GPU rendering mode - adb shell dumpsys gfxinfo)
# noLog : False (Save test data to log file)

cpu = apm.collectCpu() # %
memory = apm.collectMemory() # MB
flow = apm.collectFlow(wifi=True) # KB
Expand All @@ -62,43 +81,48 @@ battery = apm.collectBattery() # level:% temperature:°C current:mA voltage:mV p
gpu = apm.collectGpu() # % only supports ios
```

## 使用api收集
### 1.后台启动服务
## 🏴󠁣󠁩󠁣󠁭󠁿使用API收集

### 后台启动服务
```
# solox version >= 2.1.5
macOS/Linux: nohup python3 -m solox &
Windows: start /min python3 -m solox &
```

### 2.通过api请求性能数据
### 通过api请求数据

```shell
Android: http://{ip}:{port}/apm/collect?platform=Android&deviceid=ca6bd5a5&pkgname=com.bilibili.app.in&target=cpu
iOS: http://{ip}:{port}/apm/collect?platform=iOS&pkgname=com.bilibili.app.in&target=cpu

target in ['cpu','memory','network','fps','battery','gpu']
```

## 对比模式
- 2-devices: 在两部不同的手机上测试同一个应用
- 2-apps: 在具有相同配置的两部手机上测试两个不同的应用程序
## 🔥功能

注意: 目前只支持安卓
* **无需ROOT/越狱:** Android设备无需ROOT,iOS设备无需越狱。高效解决Android & iOS性能测试分析难题。

<img src="https://cdn.nlark.com/yuque/0/2022/png/153412/1662348055024-96e38b5e-d6b4-4a06-8070-0707e2fbcd99.png?x-oss-process=image%2Fresize%2Cw_1500%2Climit_0" width="100%">
* **数据完整性:** 可提供FPS、Jank、CPU、GPU、Memory、Battery 、Network等性能参数,这些您都可以轻松获得。

## 推荐浏览器
* **美观的报告看板:** 报告看板,您可以随时随地存储、可视化、编辑、管理和下载使用任何版本的SoloX收集的所有测试数据。

* **好用的监控设置:** 支持在监控过程中设置告警值、收集时长、访问其他PC机器的移动设备。

* **比对模式:** 支持两台移动设备同时对比测试。
🌱2-devices: 使用两台不同的设备测试同一个app。
🌱2-apps: 使用两台配置相同的设备测试两个不同的app。

## 浏览器

<img src="https://cdn.nlark.com/yuque/0/2023/png/153412/1677553244198-96ce5709-f33f-4038-888f-f330d1f74450.png" alt="Chrome" width="50px" height="50px" />

## 推荐终端
## 终端

- windows: PowerShell
- macOS:iTerm2 (https://iterm2.com/)
- macOS:iTerm2 (https://iterm2.com/)

## 感谢
## 💕感谢

- https://github.com/alibaba/taobao-iphone-device


11 changes: 6 additions & 5 deletions solox/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
@socketio.on('connect', namespace='/logcat')
def connect():
socketio.emit('start connect', {'data': 'Connected'}, namespace='/logcat')
if not os.path.exists('adblog'):
os.mkdir('adblog')
logDir = os.path.join(os.getcwd(),'adblog')
if not os.path.exists(logDir):
os.mkdir(logDir)
global thread
thread = True
with thread_lock:
Expand All @@ -44,10 +45,10 @@ def backgroundThread():
global thread
try:
current_time = time.strftime("%Y%m%d%H", time.localtime())
logcat = subprocess.Popen(f'adb logcat *:E > ./adblog/{current_time}_adb.log', stdout=subprocess.PIPE,
logPath = os.path.join(os.getcwd(),'adblog',f'{current_time}.log')
logcat = subprocess.Popen(f'adb logcat *:E > {logPath}', stdout=subprocess.PIPE,
shell=True)
file = f"./adblog/{current_time}_adb.log"
with open(file, "r") as f:
with open(logPath, "r") as f:
while thread:
socketio.sleep(1)
for line in f.readlines():
Expand Down
11 changes: 6 additions & 5 deletions solox/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
@socketio.on('connect', namespace='/logcat')
def connect():
socketio.emit('start connect', {'data': 'Connected'}, namespace='/logcat')
if not os.path.exists('adblog'):
os.mkdir('adblog')
logDir = os.path.join(os.getcwd(),'adblog')
if not os.path.exists(logDir):
os.mkdir(logDir)
global thread
thread = True
with thread_lock:
Expand All @@ -42,10 +43,10 @@ def backgroundThread():
global thread
try:
current_time = time.strftime("%Y%m%d%H", time.localtime())
logcat = subprocess.Popen(f'adb logcat *:E > ./adblog/{current_time}_adb.log', stdout=subprocess.PIPE,
logPath = os.path.join(os.getcwd(),'adblog',f'{current_time}.log')
logcat = subprocess.Popen(f'adb logcat *:E > {logPath}', stdout=subprocess.PIPE,
shell=True)
file = f"./adblog/{current_time}_adb.log"
with open(file, "r") as f:
with open(logPath, "r") as f:
while thread:
socketio.sleep(1)
for line in f.readlines():
Expand Down

0 comments on commit 938681f

Please sign in to comment.