cycript调试

recursiveDescription - 打印UIView对象

cy# [[UIApp keyWindow] recursiveDescription].toString()
`; layer = >
   | >
   |    | >
   |    |    | >
   |    |    |    | ; layer = >
   |    |    |    |    | >
   |    |    |    |    |    | >
...
   |    |    | >
   |    |    |    | 

_printHierarchy - 直接打印所有UIViewController

[[[UIWindow keyWindow] rootViewController] _printHierarchy].toString()

_autolayoutTrace - recursiveDescription的简化版,去掉了UIView的一些描述

cy# [[UIApp keyWindow] _autolayoutTrace].toString()
*
|   *
|   |   *
|   |   |   *
|   |   |   |   *
|   |   |   |   |   *
|   |   |   |   |   |   *
...
|   |   |   |   
|   |   |   
|   |   |   |   
|   |   |   
|   |   |   |   `

_ivarDescription - 打印某个对象所有instance的名字和值

cy# [choose(SBApplication)[0] _ivarDescription].toString()
`:
in SBApplication:
\t_bundleIdentifier (NSString*): @"com.apple.social.remoteui.SocialUIService"
\t_displayIdentifier (NSString*): @"com.apple.social.remoteui.SocialUIService"
\t_path (NSString*): @"/Applications/SocialUIService.app"
\t_bundleVersion (NSString*): @"87"
\t_defaultImageNamesByScreenType (NSMutableDictionary*): <__NSDictionaryM: 0x17672a90>
\t_defaultImageNamesForOrientation (NSDictionary*): nil
...
in NSObject:
\tisa (Class): SBApplication`

_methodDescription - 打印某个对象的属性,实例和类方法

cy# [choose(SBApplicationController)[0] _methodDescription].toString()
`:
in SBApplicationController:
\tClass Methods:
\t\t+ (void) setClearSystemAppSnapshotsWhenLoaded:(BOOL)arg1; (0x1b2ad1)
...
\t\t+ (id) sharedInstanceIfExists; (0x1b2b6d)
\tInstance Methods:
\t\t- (id) setupApplication; (0x1b3e3d)
...
\t\t- (id) applicationWithDisplayIdentifier:(id)arg1; (0x1b3d0d)
in NSObject:
\tClass Methods:
\t\t+ (bool) cy\$hasImplicitProperties; (0xdb45d80)
...
\t\t+ (void) finalize; (0x39a49ad1)
\tProperties:
\t\t@property (nonatomic) BOOL isAccessibilityElement;  (@dynamic isAccessibilityElement;)
...
\t\t@property (nonatomic) BOOL shouldGroupAccessibilityChildren;  (@dynamic shouldGroupAccessibilityChildren;)
\tInstance Methods:
\t\t- (id) cy\$toCYON:(bool)arg1 inSet:(set, std::allocator >*)arg2; (0xdb45b60)
...
\t\t- (void) finalize; (0x39a49ad5)`

找到目标App的Documents目录路径

cycript -p TargetApp
cy# [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask][0] 

获取bundle info

[[NSBundle mainBundle] infoDictionary].toString()

你可能感兴趣的:(cycript调试)