Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

py-ios-device

> 数据库
Open source

IOS Professional Performance Testing Tool . You can get CPU, GPU, Memory , Lifecycle and other metrics from real iOS devices . iOS 性能测试工具

796 stars0 likes0 views
WebsiteGitHub

About

IOS Professional Performance Testing Tool . You can get CPU, GPU, Memory , Lifecycle and other metrics from real iOS devices . iOS 性能测试工具

py-ios-device

A python based Apple instruments protocol,you can get CPU, Memory and other metrics from real iOS devices

link: https://testerhome.com/topics/27159

中文文档

Java link: https://github.com/YueChen-C/java-ios-device)

pip :

pip install py-ios-device

python version: 3.7 +

Instruments:

  • Get system Memory and CPU data
  • Get application Memory and CPU data
  • Get FPS data FPS pip install py-ios-device

    pyidevice --help pyidevice instruments --help

Get device list

$ pyidevice devices

Get device info

$ pyidevice  deviceinfo --udid=xxxxxx

Get System performance data

…

Get application performance data

$ pyidevice instruments appmonitor  -b cn.rongcloud.im
{'Pid': 30897, 'Name': 'SealTalk', 'CPU': '0 %', 'Memory': '35.72 MiB', 'DiskReads': '24.12 MiB', 'DiskWrites': '2.28 MiB', 'Threads': 13}
{'Pid': 30897, 'Name': 'SealTalk', 'CPU': '3.4 %', 'Memory': '35.72 MiB', 'DiskReads': '24.12 MiB', 'DiskWrites': '2.30 MiB', 'Threads': 13}

Get custom application performance data

$ pyidevice instruments sysmontap --help
$ pyidevice instruments sysmontap  -b com.tencent.xin --proc_filter physFootprint,cpuUsage --processes --sort cpuUsage # 只显示 memVirtualSize,cpuUsage 参数的进程列表,且根据 cpuUsage 字段排序 

[('WeChat', {'cpuUsage': 0.03663705586691998, 'physFootprint': 2179284992, 'name': 'WeChat', 'pid': 99269})]
[('WeChat', {'cpuUsage': 0.036558268613227536, 'physFootprint': 2179284992, 'name': 'WeChat', 'pid': 99269})]

Get FPS data FPS 12

$ pyidevice instruments condition get
# Get device configuration information

$ pyidevice instruments condition set -c SlowNetworkCondition -p SlowNetwork2GUrban
# Set the device network status. eg: 2G, 3G ,100% Loss

$ pyidevice instruments condition set -c ThermalCondition -p ThermalCritical
# Set the device behaves as though under a high thermal state

Listen to app notifications

…

Dump core profile stack snapshot

$ pyidevice instruments stackshot --out stackshot.log

Analyze the core profile data stream

$ pyidevice instruments instruments core_profile --pid=1107
SealTalk(1107)             PERF_THD_CSwitch (0x25010014)                               DBG_PERF          PERF_DATA                     DBG_FUNC_NONE  
SealTalk(1107)             MACH_DISPATCH (0x1400080)                                   DBG_MACH          DBG_MACH_SCHED                DBG_FUNC_NONE  
SealTalk(1107)             DecrSet (0x1090004)                                         DBG_MACH          DBG_MACH_EXCP_DECI            DBG_FUNC_NONE  

Get Metal GPU Counters

…

Get App Launch Lifecycle

$ pyidevice instruments app_lifecycle -b cn.rongcloud.im
  31.20 ms   Initializing-System Interface Initialization (Dyld init)
  14.33 ms   Initializing-Static Runtime Initialization
  35.68 ms   Launching-UIKit Initialization
 810.46 us   Launching-UIKit Scene Creation
 100.64 ms   Launching-didFinishLaunchingWithOptions()
   2.91 ms   Launching-UIKit Scene Creation
  21.85 ms   Launching-Initial Frame Rendering
App Thread Process ID:6506076, Total Time:207.41 ms

Other

Profiles & Device Management

…

get syslog

$ pyidevice syslog
# --path
# --filter

get crash syslog

$ pyidevice crash list
['.', '..', 'com.apple.appstored', 'JetsamEvent-2021-05-12-112126.ips']

$ pyidevice crash export --name JetsamEvent-2021-05-12-112126.ips

$ pyidevice crash delete --name JetsamEvent-2021-05-12-112126.ips

$ pyidevice crash shell

apps

$ pyidevice apps list

$ pyidevice apps install --ipa_path

$ pyidevice apps uninstall --bundle_id 

$ pyidevice apps launch --bundle_id

$ pyidevice apps kill --bundle_id

$ pyidevice apps shell 

packet capture

$ pyidevice pcapd ./test/test.pacp

$ pyidevice pcapd - | "/Applications/Wireshark.app/Contents/MacOS/Wireshark" -k -i -
# mac forword Wireshark

$ pyidevice pcapd - | "D:\Program Files\Wireshark\Wireshark.exe" -k -i -
# win forword Wireshark

device battery

$ pyidevice battery
# [Battery] time=1622777708, current=-71, voltage=4330, power=-307.43, temperature=3279

enable developer mode

$ pyidevice enable_developer_mode

using python


from ios_device.cli.base import InstrumentsBase
from ios_device.util.dtx_msg import DTXMessage

with InstrumentsBase() as rpc:
    def sysmontap_callback(res: DTXMessage):
        print(res.selector, res.auxiliaries)

    rpc.process_attributes = ['name', 'pid']
    rpc.system_attributes = rpc.device_info.sysmonSystemAttributes()
    rpc.sysmontap(sysmontap_callback)

QQ :37042417

api : document demo: document

Issues· 36 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythoninstrumentsiosperformance-testingpython

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库