root ps -e
control+D,来退出Cycript
cycript - p 2771 进入进程
rm -f /Users/ztwl/.ssh/known_hosts
cy# alertView = [[UIAlertView alloc] initWithTitle:@"test" message:@"Cyrill" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]
cy# [alertView show]
cyrun 命令
cyrun -n SpringBoard -e
cyrun -n SpringBoard -d
https://www.jianshu.com/p/2bbe4b0b3950
比一个一个打印属性方便多了
cy# [#0x5822600 _ivarDescription].toString()
快捷的获取 ViewController 的方法。[]
[[[UIWindow keyWindow] rootViewController] _printHierarchy].toString()
#展示的架构是基于layout
cy# [[UIApp keyWindow] _autolayoutTrace].toString()
#通过view的nextResponder方法,可以找出它所属的视图控制器ViewController
cy# [#0x181009f0 nextResponder]
#打印出当前界面的view层级
cy# UIApp.keyWindow.recursiveDescription().toString()
_ivarDescription - 打印某个对象所有instance的名字和值
cy# [choose(SBApplication)[0] _ivarDescription].toString()
_methodDescription - 打印某个对象的属性,实例和类方法
cy# [choose(SBApplicationController)[0] _methodDescription].toString()
找到目标App的Documents目录路径
cycript -p TargetApp
cy# [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask][0]
获取bundle info
[[NSBundle mainBundle] infoDictionary].toString()
网友评论