-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add ppath command #72
Changes from all commits
72145be
ff0d763
e6e9f51
aa3396f
f3119a6
84d60b8
8f16c09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ def lldbcommands(): | |
FBPrintInternals(), | ||
FBPrintInstanceVariable(), | ||
FBPrintKeyPath(), | ||
FBPrintApplicationDocumentsPath(), | ||
FBPrintData(), | ||
] | ||
|
||
|
@@ -301,6 +302,32 @@ def run(self, arguments, options): | |
printCommand = 'po [{} valueForKeyPath:@"{}"]'.format(object, keypath) | ||
lldb.debugger.HandleCommand(printCommand) | ||
|
||
|
||
class FBPrintApplicationDocumentsPath(fb.FBCommand): | ||
def name(self): | ||
return 'pdocspath' | ||
|
||
def description(self): | ||
return "Print application's 'Documents' directory path." | ||
|
||
def options(self): | ||
return [ | ||
fb.FBCommandArgument(short='-o', long='--open', arg='open', boolean=True, default=False, help='open in Finder'), | ||
] | ||
|
||
def run(self, arguments, options): | ||
# in iOS SDK NSDocumentDirectory == 9 NSUserDomainMask == 1 | ||
NSDocumentDirectory = '9' | ||
NSUserDomainMask = '1' | ||
path = fb.evaluateExpressionValue('(NSString*)[NSSearchPathForDirectoriesInDomains(' + NSDocumentDirectory + ', ' + NSUserDomainMask + ', YES) lastObject]') | ||
pathString = '{}'.format(path).split('"')[1] | ||
cmd = 'echo {} | tr -d "\n" | pbcopy'.format(pathString) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems |
||
os.system(cmd) | ||
print pathString | ||
if options.open: | ||
os.system('open '+ pathString) | ||
|
||
|
||
class FBPrintData(fb.FBCommand): | ||
def name(self): | ||
return 'pdata' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍