Skip to main content

使用指引

安装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.m,line表示代码行数,log表示要打印的日志
  2. 指定方法的符号名称symbol,同样log表示要打印的日志

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

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

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

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

Metadata

Release files for lldblogger-cli 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lldblogger-cli 1.0
File Interpreter ABI Platform Actions
lldblogger_cli-1.0-py3-none-any.whl Python 3 none any Details for lldblogger_cli-1.0-py3-none-any.whl

Release files / lldblogger_cli-1.0-py3-none-any.whl

Download URL lldblogger_cli-1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9b6f888cd77ec4ddb20bb7c12598feed6c9b76370f6161226f70c22192500bc
BLAKE2b-256 checksum
How to use checksums
22dacbba0ccd8e5a034575cb6b59d19074edde07a34394f34be9d29096b73029
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.0

Security for lldblogger-cli 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page