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 details)

Uploaded Python 3

File details

Details for the file lldblogger_cli-1.0-py3-none-any.whl.

File metadata

  • Download URL: lldblogger_cli-1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for lldblogger_cli-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9b6f888cd77ec4ddb20bb7c12598feed6c9b76370f6161226f70c22192500bc
MD5 ee3ad60ecbc92f3dc2a16e14df4abcf1
BLAKE2b-256 22dacbba0ccd8e5a034575cb6b59d19074edde07a34394f34be9d29096b73029

See more details on using hashes here.

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