Metadata-Version: 2.1
Name: gauto-profiler
Version: 0.1.1
Summary: A tool for game automation on android platform
Home-page: https://github.com/qintianchen/AndroidGameProfiler.git
Author: qintianchen
Author-email: 1365265750@qq.com
License: MIT Licence
Platform: UNKNOWN
Requires-Python: >=3.4
Description-Content-Type: text/markdown

## AndroidGameProfiler

A python library that captures the three basic capabilities of a game on Android -- Total PSS (physical memory used by applications, including proportionally Shared library memory), CPU usage, and FPS (frame rate).

The above data are all obtained by adb tool.

## Install

```shell script
pip install gauto-profiler
```

## Usage

```python
from gauto_profiler.mem import *
from gauto_profiler.cpu import *
from gauto_profiler.fps import *
import os

os.chdir(os.path.dirname(os.path.abspath(__file__)))
os.environ["ANDROID_SERIAL"] = "5366a3d3" # the serial of the android device you are willing to test

# Specify the output directory.
# All these threads will share a directory, so once one thread has specify the path, there is no need to do so for the subsequent threads
mem_thread = MemRecorder("output")
cpu_thread = CPURecorder()
fps_thread = FPSRecorder()

# start running
mem_thread.start()
cpu_thread.start()
fps_thread.start()

time.sleep(300) # run for 5 mins

# stop
mem_thread.stop()
cpu_thread.stop()
fps_thread.stop()
mem_thread.join()
cpu_thread.join()
fps_thread.join()

print("All threads have stopped")
```

