0

I have a basic question on lldb in Xcode. When using lldb in Xcode, how you guys call the command previously executed ?

Typing the same command every time is very frustrated to me, and
now looking the way to call them in efficient way.

I know "command history" will list the command with the number,
and the $ will execute the command.

But is there something similar like ctrl-p/ctrl-n or ctrl-r in bash to show or search the previous commands ?
(lldb command running on terminal (not build-in lldb inside
Xcode) can do this.)

I'm using Xcode version 11.5(11E608c).

shim
  • 9,289
  • 12
  • 69
  • 108
John
  • 41
  • 6

2 Answers2

1

Type Ctrl R and then type part of the command you want. It'll display the first matching command. Keep typing Ctrl R and it will cycle through previous matching commands.

Rameez
  • 412
  • 1
  • 5
  • 16
1

Use up arrow in the LLDB command prompt. It works similar to Terminal in that regard.

puio
  • 1,208
  • 6
  • 19
  • 1
    Note, in the Xcode Debugger console, clicking outside the prompt line actually moves the cursor, so subsequent up and down arrow gestures move the cursor around in the console text. You have to make sure the prompt is on the prompt line for up and down arrow to work. But if up & down arrow (and ^p ^n) are still not working for you then, that's bug. – Jim Ingham Oct 26 '20 at 18:53
  • thanks a lot !! Somehow, I customized allow, ctrl-n and ctrl-p for key binding, that's why it did not work. after move back to the default keybinding, it works. – John Oct 27 '20 at 11:42