Unable to integration Reveal on iOS device

王洪运's Avatar

王洪运

07 Mar, 2017 07:31 AM

I read the guide Load the Reveal Server via an Xcode Breakpoint and follow the steps.

But when I run my APP , the APP crashed. And the Xcode did not log any thing in the console.

  1. Support Staff 1 Posted by Vlas Voloshin on 07 Mar, 2017 07:40 AM

    Vlas Voloshin's Avatar

    Hello!

    Can I confirm that your app doesn't crash if you disable the breakpoint that you've added to integrate Reveal? Can you describe some details of this crash, maybe some screenshots or stack traces? I can recommend creating an exception breakpoint in Xcode, so that you can get more information if your app crashes due to an unhandled exception. You can do this using DebugBreakpointsCreate Exception Breakpoint… menu in Xcode. After you do this, try running your app again with Reveal integration breakpoint enabled to see whether your app now pauses in some specific place. It's possible that integrating Reveal has triggered a lingering issue in your app, which is often the case when something like what you describe happens.

    Best regards,
    Vlas.

  2. 2 Posted by 王洪运 on 07 Mar, 2017 07:51 AM

    王洪运's Avatar

    When I disabled the breakpoint, the APP can run successfully.

    The stack traces :

    * thread #1: tid = 0x917cc, 0x0000000101354000, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0xe7ffdefe)
      * frame #0: 0x0000000101354000
        frame #1: 0x00000001820a68b8 libdyld.dylib`start + 4
    
      thread #3: tid = 0x917ff, 0x00000001821c4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
        frame #0: 0x00000001821c4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
        frame #1: 0x000000018228d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
        frame #2: 0x000000018228d020 libsystem_pthread.dylib`start_wqthread + 4
    
      thread #4: tid = 0x91800, 0x00000001821c54d8 libsystem_kernel.dylib`kevent_qos + 8, queue = 'com.apple.libdispatch-manager'
        frame #0: 0x00000001821c54d8 libsystem_kernel.dylib`kevent_qos + 8
        frame #1: 0x00000001016120fc libdispatch.dylib`_dispatch_mgr_invoke + 232
        frame #2: 0x00000001015ffcb8 libdispatch.dylib`_dispatch_mgr_thread + 52
    
      thread #5: tid = 0x91801, 0x00000001821a8fd8 libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.notification_center.server_conn.0x000000012ffb0a50.dq'
        frame #0: 0x00000001821a8fd8 libsystem_kernel.dylib`mach_msg_trap + 8
        frame #1: 0x00000001821a8e54 libsystem_kernel.dylib`mach_msg + 72
        frame #2: 0x00000001822d314c libxpc.dylib`xpc_pipe_routine + 256
        frame #3: 0x00000001822c5f18 libxpc.dylib`_xpc_interface_routine + 200
        frame #4: 0x00000001822c62f0 libxpc.dylib`_xpc_look_up_endpoint + 224
        frame #5: 0x00000001822bfc60 libxpc.dylib`_xpc_connection_bootstrap_look_up_slow + 212
        frame #6: 0x00000001822bf958 libxpc.dylib`_xpc_connection_init + 536
        frame #7: 0x00000001822bf730 libxpc.dylib`_xpc_connection_resume_init + 20
        frame #8: 0x00000001015fda3c libdispatch.dylib`_dispatch_client_callout + 16
        frame #9: 0x000000010160a554 libdispatch.dylib`_dispatch_queue_drain + 1036
        frame #10: 0x000000010160172c libdispatch.dylib`_dispatch_queue_invoke + 464
        frame #11: 0x000000010160c66c libdispatch.dylib`_dispatch_root_queue_drain + 760
        frame #12: 0x000000010160c364 libdispatch.dylib`_dispatch_worker_thread3 + 132
        frame #13: 0x000000018228d470 libsystem_pthread.dylib`_pthread_wqthread + 1092
        frame #14: 0x000000018228d020 libsystem_pthread.dylib`start_wqthread + 4
    
      thread #6: tid = 0x91802, 0x0000000103644008, queue = 'com.apple.root.background-qos'
        frame #0: 0x0000000103644008
        frame #1: 0x0000000101c6d0b4 xCon.dylib`W9DB28E6CDA694328A8127AAECAD15425(char const*, stat*) + 84
        frame #2: 0x0000000182f2dd7c Foundation`_NSResolveSymlinksInPathUsingCache + 460
        frame #3: 0x0000000182f439dc Foundation`-[NSString(NSPathUtilities) _stringByResolvingSymlinksInPathUsingCache:] + 132
        frame #4: 0x0000000182f45150 Foundation`_NSFrameworkPathFromLibraryPath + 64
        frame #5: 0x0000000182f995e8 Foundation`__25+[NSBundle allFrameworks]_block_invoke + 344
        frame #6: 0x00000001015fda3c libdispatch.dylib`_dispatch_client_callout + 16
        frame #7: 0x00000001015fe8b4 libdispatch.dylib`dispatch_once_f + 132
        frame #8: 0x0000000182f80274 Foundation`+[NSBundle allFrameworks] + 80
        frame #9: 0x0000000100783088 LeBan`__initialize_class_variables_block_invoke + 68
        frame #10: 0x00000001015fda7c libdispatch.dylib`_dispatch_call_block_and_release + 24
        frame #11: 0x00000001015fda3c libdispatch.dylib`_dispatch_client_callout + 16
        frame #12: 0x000000010160cc9c libdispatch.dylib`_dispatch_root_queue_drain + 2344
        frame #13: 0x000000010160c364 libdispatch.dylib`_dispatch_worker_thread3 + 132
        frame #14: 0x000000018228d470 libsystem_pthread.dylib`_pthread_wqthread + 1092
        frame #15: 0x000000018228d020 libsystem_pthread.dylib`start_wqthread + 4
    
      thread #7: tid = 0x9180a, 0x00000001821c441c libsystem_kernel.dylib`__semwait_signal + 8, name = 'gputools.smt_poll.0x13100a080'
        frame #0: 0x00000001821c441c libsystem_kernel.dylib`__semwait_signal + 8
        frame #1: 0x00000001820e122c libsystem_c.dylib`nanosleep + 212
        frame #2: 0x00000001820e114c libsystem_c.dylib`usleep + 68
        frame #3: 0x000000010166c9f0 GPUToolsCore`smt_poll_thread_entry(void*) + 140
        frame #4: 0x000000018228fb28 libsystem_pthread.dylib`_pthread_body + 156
        frame #5: 0x000000018228fa8c libsystem_pthread.dylib`_pthread_start + 156
        frame #6: 0x000000018228d028 libsystem_pthread.dylib`thread_start + 4
    
      thread #8: tid = 0x9180b, 0x00000001821c4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
        frame #0: 0x00000001821c4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
        frame #1: 0x000000018228d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
        frame #2: 0x000000018228d020 libsystem_pthread.dylib`start_wqthread + 4
    
      thread #9: tid = 0x9180c, 0x00000001821c4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
        frame #0: 0x00000001821c4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
        frame #1: 0x000000018228d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
        frame #2: 0x000000018228d020 libsystem_pthread.dylib`start_wqthread + 4
    
  3. Support Staff 3 Posted by Vlas Voloshin on 07 Mar, 2017 08:08 AM

    Vlas Voloshin's Avatar

    Seems like you're running your app on a physical device, is this correct? If that's the case, can you try running your app in Simulator first in order to check that Reveal integration works correctly? If it does, we can continue with determining the cause of your issues when running on device, but please keep in mind that as per Debugging on Device section of the Breakpoint integration guide, you'll need to add a custom build phase in your project. Please let me know if you have already done so.

    Best regards,
    Vlas.

  4. Support Staff 4 Posted by Vlas Voloshin on 07 Mar, 2017 08:15 AM

    Vlas Voloshin's Avatar

    By the way, I have noticed that thread #6 in the stack trace that you have provided includes the following:

    frame #0: 0x0000000103644008
    frame #1: 0x0000000101c6d0b4 xCon.dylib`W9DB28E6CDA694328A8127AAECAD15425(char const*, stat*) + 84
    frame #2: 0x0000000182f2dd7c Foundation`_NSResolveSymlinksInPathUsingCache + 460
    frame #3: 0x0000000182f439dc Foundation`-[NSString(NSPathUtilities) _stringByResolvingSymlinksInPathUsingCache:] + 132
    frame #4: 0x0000000182f45150 Foundation`_NSFrameworkPathFromLibraryPath + 64
    frame #5: 0x0000000182f995e8 Foundation`__25+[NSBundle allFrameworks]_block_invoke + 344
    

    xCon.dylib looks like a library used to detect jailbreaking. I'm not sure whether it's a coincidence or not, but if you're running your app on a jailbroken device, unfortunately I cannot guarantee that breakpoint integration would behave correctly. Otherwise, if it's a library that you have added into your app yourself, it's possible that it somehow detects that Reveal is being loaded and makes your app crash. Unfortunately, we haven't tested the breakpoint integration with third-party libraries like this one, so it's possible that it won't work correctly. Keep in mind that the integration guide provides other integration methods that might work better in your case.

  5. 5 Posted by 王洪运 on 07 Mar, 2017 08:23 AM

    王洪运's Avatar

    Yes, the Reveal integration worked correctly in Simulator.

    I'm sure that I add the custom build phase in my project.

  6. Support Staff 6 Posted by Vlas Voloshin on 07 Mar, 2017 08:33 AM

    Vlas Voloshin's Avatar

    I've dug a little deeper, and it turns out that xCon is rather a Cydia tweak that attempts to defeat jailbreak detection in certain ways. Because of that, my initial conclusion would be, unfortunately, that the configuration of your device would not allow Reveal breakpoint integration to work correctly on it, and that you may have to try a different integration method.

    However, you can also try doing the following:

    • Disable your existing Reveal integration breakpoint for now.
    • Create a new symbolic breakpoint with UIApplicationMain symbol, but no action, and don't tick the "Automatically continue" checkbox.
    • Run your app.
    • Debugger should pause your app in the UIApplicationMain function.
    • Now try executing reveal status and reveal load commands in the Debugger Console. Debugger console should print some output: please send me that.
    • If the output of reveal load command includes Reveal Server was loaded successfully, try continuing execution of your app to see what happens next.

    Best regards,
    Vlas.

  7. 7 Posted by 王洪运 on 07 Mar, 2017 09:20 AM

    王洪运's Avatar

    I unstalled the xCon, but it not fixed.

    I try to create a new symbolic breakpoint with UIApplicationMain symbol, don't add an action and tick the "Automatically continue" checkbox.

    But when I executed reveal status, the console log error: process is not yet ready to execute Reveal Server commands.

    I use Cocoapods to integration Reveal, and succeed.

  8. Support Staff 8 Posted by Vlas Voloshin on 07 Mar, 2017 12:15 PM

    Vlas Voloshin's Avatar

    Hello again,

    The error that reveal status command has returned implies that the state of the application when it pauses in UIApplicationMain breakpoint is somehow unexpected. It's possible that the debugger is missing some part of the symbol information, or maybe stops in an unexpected location. In both cases, I suspect this could be caused by the fact that you're running your app on a jailbroken device, by the particular set of tweaks you have installed there, or maybe by some issue with the debugger communication.

    One more thing you could check is the stack trace of the main thread when the app is paused back in that UIApplicationMain breakpoint. In a normal situation, the stack should contain functions start, main and UIApplicationMain, and Xcode should show a disassembly of UIApplicationMain function. If you see something else, you can try using a different place to invoke reveal load command – for example, in application(_:, didFinishLaunchingWithOptions:) function. You can put this breakpoint in any location hit early in your app's lifecycle, just keep in mind that if the breakpoint would hit later than the app initially becomes active, you should change the breakpoint command to reveal load -a: this way Reveal Server would also start automatically.

    But since Cocoapods integration worked for you, do you think it would be convenient for you just to use that in your app?

    Best regards,
    Vlas.

  9. 9 Posted by 王洪运 on 08 Mar, 2017 02:07 AM

    王洪运's Avatar

    I try to integration Reveal in a non-jailbroken device, and it work. I'm sure that the jailbroken device can't integration Reveal with breakpoint, but I don't know the reason.

  10. Support Staff 10 Posted by Vlas Voloshin on 08 Mar, 2017 02:54 AM

    Vlas Voloshin's Avatar

    Alright, thanks for trying this out. It's definitely worth knowing that there are currently some problems with the breakpoint integration on a jailbroken device. We might check this ourselves at some point to see if we can reproduce the issues you've encountered. Until then, I hope you can either use a non-jailbroken device for testing, or use Cocoapods integration.

    Best regards,
    Vlas.

  11. Vlas Voloshin closed this discussion on 08 Mar, 2017 02:54 AM.

  12. 王洪运 re-opened this discussion on 08 Mar, 2017 02:59 AM

  13. 11 Posted by 王洪运 on 08 Mar, 2017 02:59 AM

    王洪运's Avatar

    OK, thanks very match.

  14. Vlas Voloshin closed this discussion on 08 Mar, 2017 02:59 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac