如何从lldb提示符运行外部命令

时间:2014-11-20 11:28:09

标签: lldb

lldb是否具有gdb' s shell命令的等效命令来从提示符运行外部命令? (见How can I execute external commands from the gdb command prompt?

2 个答案:

答案 0 :(得分:8)

这可能是您正在寻找的......

(lldb) help platform shell
     Run a shell command on a the selected platform.  This command takes 'raw'
     input (no need to quote stuff).

Syntax: platform shell <shell-command>

Command Options Usage:
  platform shell [-t <value>]

       -t <value> ( --timeout <value> )
            Seconds to wait for the remote host to finish running the command.

IMPORTANT NOTE:  Because this command takes 'raw' input, if you use any
     command options you must use ' -- ' between the end of the command options
     and the beginning of the raw input.

答案 1 :(得分:0)

(lldb) platform shell ls

如果得到:

error: unable to run a remote command without a platform

尝试以下命令以查看是否需要为lldb提供更多上下文:

(lldb) platform status

如果您在真实的iOS ARM设备上进行调试,则将显示Platform: remote-ios。如果您使用的是模拟器,则会获得与macOS相关的信息。