YueChen-C / py-ios-device

IOS Professional Performance Testing Tool . You can get CPU, GPU, Memory , Lifecycle and other metrics from real iOS devices . iOS 性能测试工具
GNU General Public License v3.0
667 stars 183 forks source link

app_lifecycle执行报错 #90

Closed oschanger closed 1 year ago

oschanger commented 1 year ago
leo@ChenXus-MacBook-Pro ~ % pyidevice instruments app_lifecycle -b com.taobao.fleamarket     
2023-02-17 13:59:38 [INFO] [LockDown] lockdown.py[line:73] Connecting Device 00008120-000651892E38C01E 
2023-02-17 13:59:38 [INFO] [Instrument] Instrument.py[line:22] InstrumentServer init ...
2023-02-17 13:59:38 [INFO] [Instrument] dvt.py[line:167] set com.apple.instruments.server.services.coreprofilesessiontap callback ...
start com.taobao.fleamarket pid:11193 [!] wait a few seconds, being analysed...
2023-02-17 13:59:40 [ERROR] [Instrument] dvt.py[line:252] unpack requires a buffer of 64 bytes
Traceback (most recent call last):
  File "/Users/leo/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ios_device/servers/dvt.py", line 239, in _receiver
    self._channel_callbacks[(2 ** 32 - dtx.channel_code)](dtx)
  File "/Users/leo/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ios_device/cli/base.py", line 619, in on_graphics_message
    demo(res.selector.data)
  File "/Users/leo/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ios_device/cli/base.py", line 609, in demo
    for event in Kperf.to_dict(data):
  File "/Users/leo/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ios_device/util/kperf_data.py", line 1021, in to_dict
    for event in self.parse(kd_buf):
  File "/Users/leo/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ios_device/util/kperf_data.py", line 979, in parse
    for event in KdBufParser.decode(buf_io):
  File "/Users/leo/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ios_device/util/kperf_data.py", line 872, in decode
    yield cls(*struct.unpack(KD_BUF_FORMAT, buf))
struct.error: unpack requires a buffer of 64 bytes

iPhone 14promax iOS 16.1.2

YueChen-C commented 1 year ago

每次必现吗?

YueChen-C commented 1 year ago

新版已解决

dansunhappy commented 11 months ago

app_lifecycle “start com.gdb.mobilegdb pid:4632 [!] wait a few seconds, being analysed...” 卡死在这个地方, 没有返回数值, 使用的命令时 pyidevice instruments app_lifecycle -b

YueChen-C commented 11 months ago

launchSuspendedProcessWithDevicePath 之前可以尝试等待几秒中提升一些稳定性,但无法绝对避免这个问题,具体我也不知道为什么堆栈数据有时候没有推过来。