Skip to main content

__pip_description__

Project description

使用指引

安装lldblogger

pip install lldblogger

指定要测试的app目录地址和断点日志配置文件

from lldblogger.runner import Runner

runner = Runner(log_output_path='log file path')
runner.run("path to app", "path to config json")

...

runner.terminate() # 停止调试

app文件可以从debug配置的ipa包中解压出来,同时需要将配套的dSYM文件置于同一个目录,可以通过Runner的构造函数指定断点日志输出到哪个文件。

断点日志配置文件格式如下:

[
  {
    "file": "文件名",
    "line": 48,
    "log": "[测试串行队列] counter: @counter@"
  },
  {
    "symbol": "-[ViewController viewDidLoad]",
    "log": "<From LLDB> [LLDBTest] 使用符号断点 ViewController viewDidLoad"
  }
]

目前支持两种形式的断点日志

  1. 指定文件名和代码行数,file表示文件名,比如AppDelegate.mline表示代码行数,log表示要打印的日志
  2. 指定方法的符号名称symbol,同样log表示要打印的日志

日志log可以包含动态参数,使用@@包裹动态参数,比如要打印局部变量localVar,可以这么写

"log": "局部变量:@localVar@"

目前已测试的动态参数支持情况:

  1. 方法的参数
  2. 局部变量
  3. 静态变量
  4. 类的实例变量
  5. 简单的表达式

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

lldblogger_cli-1.0-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page