Last active
August 23, 2021 00:58
-
-
Save matsuda/e4da2f061982d3362fb6ac962e7ba500 to your computer and use it in GitHub Desktop.
LLDB tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simulator起動時に `Lost connection to the debugger` と表示されてディタッチされてしまう&Simulator上でアプリが起動しない | |
# https://developer.apple.com/forums/thread/681037 | |
``` | |
settings set plugin.process.gdb-remote.packet-timeout 300 | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Swift | |
*/ | |
// 変数に代入 | |
// `$`を付ける | |
(lldb) e var $vc = viewController | |
(lldb) po $vc | |
// ライブラリをimport | |
(lldb) expr -l Swift -- import SomeLibrary | |
/** | |
* Objective-C | |
*/ | |
// poiter addressを変数に代入 | |
(lldb) po UIView* $v = nil | |
(lldb) po $v = (UIView *)0x10551b330 | |
// 参考 | |
* http://akisute.com/2015/12/xcode-72-lldb-swift.html | |
/// LLDB (Swift): Casting Raw Address into Usable Type | |
/// https://stackoverflow.com/a/42766226 | |
expr -l Swift -- import UIKit | |
expr -l Swift -- let $pin = unsafeBitCast(0x7df67c50, to: UIViewController.self) | |
expr -l Swift -- print($pin.alpha) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment