通过 cycript 注入进程,打印出 UI 结构信息,但是有时会发现显示信息不全,如下所示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# cycript -p Cydia cy# UIApp.keyWindow.recursiveDescription().toString() `<UIWindow: 0x727430; frame = (0 0; 320 568); gestureRecognizers = <NSArray: 0x706e90>; layer = <UIWindowLayer: 0x504bf0>> | <UILayoutContainerView: 0x4ee2a0; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x4edcb0>> | | <UITransitionView: 0x72aab0; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x700650>> | | | <UIViewControllerWrapperView: 0x12860b30; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x12824700>> | | | | <UILayoutContainerView: 0x74f140; frame = (0 0; 320 568); autoresize = W+H; gestureRecognizers = <NSArray: 0x4f8500>; layer = <CALayer: 0x74ae10>> | | | | | <UINavigationTransitionView: 0x4e75b0; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x4cd4f0>> | | | | | | <UIViewControllerWrapperView: 0xe89b700; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0xe88df70>> | | | | | | | <CyteWebView: 0xe90f020, https://cydia.saurik.com/ui/ios~iphone/1.1/home/> | | | | | | | | <_UIWebViewScrollView: 0x878200; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = H; gestureRecognizers = <NSArray: 0xe912340>; layer = <CALayer: 0xe911d80>; contentOffset: {0, -64}; contentSize: {320, 835}> | | | | | | | | | <UIWebBrowserView: 0x87ba00; frame = (0 0; 320 835); text = '\u6b22\u8fce\u4f7f\u7528 Cydia\u2122 \u5f00\u53d1\u8005\uff1aJay Freem...'; opaque = NO; gestureRecognizers = <NSArray: 0xe90f8a0>; layer = <UIWebLayer: 0x4ee060>> | | | | | | | | | | <LegacyTileHostLayer: 0x4802220> (layer) | | | | | | | | | | | <LegacyTileLayer: 0x128410f0> (layer) | | | | | | | | | | | <LegacyTileLayer: 0x12829060> (layer) | | | | | | | | | <UIImageView: 0x483a6b0; frame = (3 449.5; 314 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; laye cy# UIApp.keyWindow.recursiveDescription().toString() `<UIWindow: 0x727430; frame = (0 0; 320 568); gestureRecognizers = <NSArray: 0x706e90>; layer = <UIWindowLayer: 0x504bf0>> | <UILayoutContainerView: 0x4ee2a0; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x4edcb0>> | | <UITransitionView: 0x72aab0; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x700650>> | | | <UIViewControllerWrapperView: 0x12860b30; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x12824700>> | | | | <UILayoutContainerView: 0x74f140; frame = (0 0; 320 568); autoresize = W+H; gestureRecognizers = <NSArray: 0x4f8500>; layer = <CALayer: 0x74ae10>> | | | | | <UINavigationTransitionView: 0x4e75b0; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x4cd4f0>> | | | | | | <UIViewControllerWrapperView: 0xe89b700; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0xe88df70>> | | | | | | | <CyteWebView: 0xe90f020, https://cydia.saurik.com/ui/ios~iphone/1.1/home/> | | | | | | | | <_UIWebViewScrollView: 0x878200; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = H; gestureRecognizers = <NSArray: 0xe912340>; layer = <CALayer: 0xe911d80>; contentOffset: {0, -64}; contentSize: {320, 835}> | | | | | | | | | <UIWebBrowserView: 0x87ba00; frame = (0 0; 320 835); text = '\u6b22\u8fce\u4f7f\u7528 Cydia\u2122 \u5f00\u53d1\u8005\uff1aJay Freem...'; opaque = NO; gestureRecognizers = <NSArray: 0xe90f8a0>; layer = <UIWebLayer: 0x4ee060>> | | | | | | | | | | <LegacyTileHostLayer: 0x4802220> (layer) | | | | | | | | | | | <LegacyTileLayer: 0x128410f0> (layer) | | | | | | | | | | | <LegacyTileLayer: 0x12829060> (layer) | | | | | | | | | <UIImageView: 0x483a6b0; frame = (3 449.5; 314 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; laye |
这时可以使用 writeToFile 将信息保存为文件,下载文件查看信息是完整的,并且中文也能显示清楚
1 |
cy# [UIApp.keyWindow.recursiveDescription().toString() writeToFile:"/var/mobile/viewdump.txt" atomically:NO encoding:4 error:NULL]; |
还有一种方法是降级 Cycript,查看当前版本号是 0.9.954,尝试降级到 0.9.590, 再打印信息就没问题了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# cycript -p Cydia cy# UIApp.keyWindow.recursiveDescription().toString() `<UIWindow: 0x739250; frame = (0 0; 320 568); gestureRecognizers = <NSArray: 0x71d9a0>; layer = <UIWindowLayer: 0x71d1c0>> | <UILayoutContainerView: 0x5cfa90; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x5ce060>> | | <UITransitionView: 0x5d7470; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x5d7650>> | | | <UIViewControllerWrapperView: 0x5f6cb0; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x5fa040>> | | | | <UILayoutContainerView: 0x766540; frame = (0 0; 320 568); autoresize = W+H; gestureRecognizers = <NSArray: 0x5f6290>; layer = <CALayer: 0x48041e0>> | | | | | <UINavigationTransitionView: 0x4803e40; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x5c7630>> | | | | | | <UIViewControllerWrapperView: 0xe707ea0; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0xe707f80>> | | | | | | | <CyteWebView: 0x763ae0, https://cydia.saurik.com/ui/ios~iphone/1.1/home/> | | | | | | | | <_UIWebViewScrollView: 0x10abc00; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = H; gestureRecognizers = <NSArray: 0xe5f8fb0>; layer = <CALayer: 0xe5f9e90>; contentOffset: {0, -64}; contentSize: {320, 835}> | | | | | | | | | <UIWebBrowserView: 0x8e0600; frame = (0 0; 320 835); text = '\u6b22\u8fce\u4f7f\u7528 Cydia\u2122 \u5f00\u53d1\u8005\uff1aJay Freem...'; opaque = NO; gestureRecognizers = <NSArray: 0x5d53d0>; layer = <UIWebLayer: 0x748fc0>> | | | | | | | | | | <LegacyTileHostLayer: 0x7137d0> (layer) | | | | | | | | | | | <LegacyTileLayer: 0xe6f9870> (layer) | | | | | | | | | | | <LegacyTileLayer: 0x75f4c0> (layer) | | | | | | | | | <UIImageView: 0xe6bda10; frame = (3 449.5; 314 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0xe6bdb50>> | | | | | | | | | <UIImageView: 0xe6bebb0; frame = (314.5 3; 2.5 374); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0xe6becf0>> | | | | | <UINavigationBar: 0x765a00; frame = (0 20; 320 44); opaque = NO; autoresize = W; gestureRecognizers = <NSArray: 0x429f00>; layer = <CALayer: 0x7666c0>> | | | | | | <_UIBarBackground: 0x765d00; frame = (0 -20; 320 64); userInteractionEnabled = NO; layer = <CALayer: 0x7660a0>> | | | | | | | <UIImageView: 0x765f20; frame = (0 64; 320 0.5); userInteractionEnabled = NO; layer = <CALayer: 0x764790>> | | | | | | | <UIVisualEffectView: 0x766730; frame = (0 0; 320 64); layer = <CALayer: 0x766860>> | | | | | | | | <_UIVisualEffectBackdropView: 0x766a30; frame = (0 0; 320 64); autoresize = W+H; userInteractionEnabled = NO; layer = <UICABackdropLayer: 0x766b30>> | | | | | | | | <_UIVisualEffectFilterView: 0x74ab60; frame = (0 0; 320 64); autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x75d340>> | | | | | | <UINavigationButton: 0xe6e68a0; frame = (242 7; 70 30); opaque = NO; layer = <CALayer: 0xe6d56a0>> | | | | | | | <UIButtonLabel: 0xe7add30; frame = (0.5 5; 69.5 20.5); text = '\u91cd\u65b0\u52a0\u8f7d'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0xe716c10>> | | | | | | | | <_UILabelContentLayer: 0xe70c040> (layer) | | | | | | <UINavigationButton: 0xe6a8d50; frame = (8 7; 35 30); opaque = NO; layer = <CALayer: 0xe6a8850>> | | | | | | | <UIButtonLabel: 0xe7013d0; frame = (0 5; 35 20.5); text = '\u5173\u4e8e'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0xe701610>> | | | | | | | | <_UILabelContentLayer: 0xe701be0> (layer) | | | | | | <<UINavigationItemView: 0xe719280; frame = (142.5 8; 35 27); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0xe719210>>: item=<<UINavigationItem: 0x5f9430>: title:'\u4e3b\u9875'> title=\u4e3b\u9875> | | | | | | | <UILabel: 0xe719380; frame = (0 3.5; 35 21.5); text = '\u4e3b\u9875'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0xe7194e0>> | | | | | | | | <_UILabelContentLayer: 0xe7892d0> (layer) | | | | | | <_UINavigationBarBackIndicatorView: 0x7680e0; frame = (8 11.5; 13 21); alpha = 0; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7682f0>> | | <UITabBar: 0x5ce0e0; frame = (0 519; 320 49); autoresize = W+TM; layer = <CALayer: 0x5ce480>> | | | <_UIBarBackground: 0x5cfef0; frame = (0 0; 320 49); userInteractionEnabled = NO; layer = <CALayer: 0x5ce650>> | | | | <UIImageView: 0x5d4bb0; frame = (0 -0.5; 320 0.5); userInteractionEnabled = NO; layer = <CALayer: 0x5cd770>> | | | | <UIVisualEffectView: 0x5d4820; frame = (0 0; 320 49); layer = <CALayer: 0x5bc0c0>> | | | | | <_UIVisualEffectBackdropView: 0x5d69f0; frame = (0 0; 320 49); autoresize = W+H; userInteractionEnabled = NO; layer = <UICABackdropLayer: 0x5d6d70>> | | | | | <_UIVisualEffectFilterView: 0xe6be200; frame = (0 0; 320 49); autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0xe6be2e0>> | | | <UITabBarButton: 0x5f4390; frame = (2 1; 60 48); opaque = NO; layer = <CALayer: 0x5f7480>> | | | | <UITabBarSwappableImageView: 0x5f76e0; frame = (9 2.5; 41 31); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x5f7950>> | | | | <UITabBarButtonLabel: 0x5f4620; frame = (16 35; 27.5 12); text = 'Cydia'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x5f49d0>> | | | <UITabBarButton: 0x4800580; frame = (66 1; 60 48); opaque = NO; layer = <CALayer: 0x4800ea0>> | | | | <UITabBarSwappableImageView: 0x48197d0; frame = (9.5 2.5; 41 31); opaque = NO; userInteractionEnabled = NO; tintColor = UIDeviceWhiteColorSpace 0.572549 1; layer = <CALayer: 0x4801120>> | | | | <UITabBarButtonLabel: 0x48006f0; frame = (14.5 35; 31 12); text = '\u8f6f\u4ef6\u6e90'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x4800500>> | | | | | <_UILabelContentLayer: 0xe5f99f0> (layer) | | | | <_UIBadgeView: 0xe5f8340; frame = (45.5 2; 18 18); text = ''; userInteractionEnabled = NO; layer = <CALayer: 0x4827500>> | | | | | <UIImageView: 0xe703e20; frame = (0 0; 18 18); opaque = NO; userInteractionEnabled = NO; tintColor = UIDeviceRGBColorSpace 1 0.231373 0.188235 1; layer = <CALayer: 0xe5f4fd0>> | | | | | <UIActivityIndicatorView: 0x5d7870; frame = (2 2; 14 14); layer = <CALayer: 0x5ceb00>> | | | | | | <UIImageView: 0x5d7c30; frame = (0 0; 14 14); opaque = NO; userInteractionEnabled = NO; animations = { contents=<CAKeyframeAnimation: 0xdb0a4a0>; }; layer = <CALayer: 0x5d7d30>> | | | <UITabBarButton: 0x760010; frame = (130 1; 60 48); opaque = NO; layer = <CALayer: 0x761970>> | | | | <UITabBarSwappableImageView: 0x760930; frame = (9 2.5; 41 31); opaque = NO; userInteractionEnabled = NO; tintColor = UIDeviceWhiteColorSpace 0.572549 1; layer = <CALayer: 0x761ae0>> | | | | <UITabBarButtonLabel: 0x7601a0; frame = (19.5 35; 20.5 12); text = '\u53d8\u66f4'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x760310>> | | | | | <_UILabelContentLayer: 0xe5f91e0> (layer) | | | | <_UIBadgeView: 0xe5f5220; frame = (45 2; 27 18); text = '14'; userInteractionEnabled = NO; layer = <CALayer: 0xe5f5470>> | | | | | <UIImageView: 0xe6a6100; frame = (0 0; 27 18); opaque = NO; userInteractionEnabled = NO; tintColor = UIDeviceRGBColorSpace 1 0.231373 0.188235 1; layer = <CALayer: 0xe6a6200>> | | | | | <UILabel: 0xe5f5640; frame = (5 1; 17 16); text = '14'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0xe5f57a0>> | | | <UITabBarButton: 0x760e30; frame = (194 1; 60 48); opaque = NO; layer = <CALayer: 0x75e8d0>> | | | | <UITabBarSwappableImageView: 0x762900; frame = (9.5 2.5; 41 31); opaque = NO; userInteractionEnabled = NO; tintColor = UIDeviceWhiteColorSpace 0.572549 1; layer = <CALayer: 0x761ec0>> | | | | <UITabBarButtonLabel: 0x760fa0; frame = (14.5 35; 31 12); text = '\u5df2\u5b89\u88c5'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x761110>> | | | | | <_UILabelContentLayer: 0xe706ab0> (layer) | | | <UITabBarButton: 0x762a10; frame = (258 1; 60 48); opaque = NO; layer = <CALayer: 0x7632a0>> | | | | <UITabBarSwappableImageView: 0x763ee0; frame = (9 2.5; 41 31); opaque = NO; userInteractionEnabled = NO; tintColor = UIDeviceWhiteColorSpace 0.572549 1; layer = <CALayer: 0x761940>> | | | | <UITabBarButtonLabel: 0x762b80; frame = (19.5 35; 20.5 12); text = '\u641c\u7d22'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x760b30>> | | | | | <_UILabelContentLayer: 0xe706a30> (layer)` |