unable to communicate with ios simulator

hapmlpy's Avatar


01 Aug, 2018 10:00 AM

Reveal throw a error:"unable to communicate with ios simulator "when trying the sample app.
When trying my own project, app can't be discovered by Reveal, and I got this message in Xcode:
Loading Reveal Server from /Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer...
2018-08-01 17:25:24.742178+0800 BingGo_Prototype[1685:55380] ERROR: Reveal Server requires UIApplication to be available. You may be trying to start Reveal Server too early or in an incompatible process. Reveal Server was loaded successfully.

  1. Support Staff 1 Posted by Vlas Voloshin on 01 Aug, 2018 12:36 PM

    Vlas Voloshin's Avatar


    These issues certainly look suspicious – I'll try to help you with both of them. They may be related to each other, but I'd like to investigate them separately first.

    "Unable to communicate with iOS Simulator" message indicates that the sample app launch sequence fails when attempting to find an appropriate simulator instance to boot. It's possible that your configuration of simulator environment is somehow incompatible, but I'll need more information to confirm this:

    • Which version of Reveal, Xcode and macOS are you using?
    • Which version of Xcode is selected for command line tools? To find this out, please run these two commands in Terminal and let me know what results you see:

      echo $DEVELOPER_DIR
      xcode-select -p
    • In order to diagnose your simulator environment, I'd like to take a look on the list of runtimes, device types and devices available in it. Please run the following command in Terminal to collect it:

      { xcrun simctl list runtimes --json & xcrun simctl list devicetypes --json & xcrun simctl list devices --json; } > ~/Desktop/simctl-dump.txt

      This will create a file called simctl-dump.txt on your Desktop – please attach it to this discussion.

    "Reveal Server requires UIApplication to be available" error, alongside with the log that you've shown, indicates that your Reveal loading breakpoint may have been created incorrectly – I see that Reveal Server received a request to start immediately upon loading. I assume that you've followed the instructions in our integration guide, in this case can you show me the configuration of UIApplicationMain breakpoint that you've created in the process? You can access it in Xcode's Breakpoint Navigation by ⌃clicking on the breakpoint and selecting Edit Breakpoint….

    However, even if Reveal Server receives a request to start too early, it is still supposed to start automatically when application becomes active at the end of its launch sequences. Do you see any messages in debugger console such as this?

    INFO: Reveal Server started (Protocol Version 45).

    If you don't, can you try backgrounding your app in the Simulator (press ⌘⇧H) and opening it again, without relaunching? Normally Reveal Server stops automatically when inspected app becomes inactive, and restarts when it becomes active again, and you should see corresponding messages in the console.

    I'll be looking forward for your response – and will continue this investigation after receiving more information from you.

    Best regards,

  2. 2 Posted by hapmlpy on 01 Aug, 2018 03:22 PM

    hapmlpy's Avatar

    Hi Vias,
    here is the information you asked

    (1) version of software/

    Reveal: version 16
    Xcode: version 9.4.1
    Build version 9F2000
    macOS: High Sierra 10.13.6

    (2) I am not sure if this is the "version of Xcode for command line tool".../

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/4.2.1
    Apple LLVM version 9.1.0 (clang-902.0.39.2)
    Target: x86_64-apple-darwin17.7.0
    Thread model: posix

    (3) device types list/

    Please checking the attachment file

    (4) breakpoint/

    I attach a screenshot of *Edit BreakPoint... * panel

    (5) Yes, I did see the message/

    INFO: Reveal Server started (Protocol Version 45).
  3. Support Staff 3 Posted by Vlas Voloshin on 02 Aug, 2018 11:49 AM

    Vlas Voloshin's Avatar

    Hi Jain,

    Thanks for this information! I've analysed the simctl output you've provided, and realised that you have an iOS 10.3 simulator runtime available, but no devices with this runtime. In a case like this, Reveal attempts to create a simulator device to run the sample app on, but after performing some testing I've realised that there's actually a bug in our code responsible for doing so! We'll make sure to fix it in the next release, but in the meantime you should be able to work around it manually, simply by running the following command in Terminal:

    xcrun simctl create iPhone 7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 com.apple.CoreSimulator.SimRuntime.iOS-10-3

    This command simply creates a new iPhone 7 simulator with iOS 10.3 runtime. Once this is done, you should be able to launch the sample app from Reveal. Please let me know if this helps.

    As for inspecting your own app, the screenshot that you've attached shows that the debugger command in the breakpoint is reveal load --autostart. Please change it to simply reveal load, as the integration guide suggests. This should get rid of the "Reveal Server requires UIApplication to be available." message.

    However, while "Reveal Server started (Protocol Version 45)." message indicates that Reveal Server instance in your application runs successfully, the fact that you don't see it in Reveal means there's a third problem, this time around connectivity. You can start by trying to inspect the sample app (now that you hopefully can do it), but I assume that you'll get a similar result: it will start in the Simulator, but Reveal won't be able to detect it. This could be caused by several possible system configuration issues, and we have a Bonjour Debugging guide available that has a few steps to diagnose the problem. Can you please go through these steps and show me the results? I would specifically highlight the point around /etc/hosts file in the "Still Having Issues?" section: a few of our users have had a problem similar to yours simply because they've made changes to /etc/hosts that they didn't realise would cause network configuration issues. In fact, I'd appreciate if you could show me the contents of that file form your machine to double-check if it's modified or corrupted.

    Once again, looking forward for your response!

    Best regards,

  4. 4 Posted by hapmlpy on 02 Aug, 2018 02:48 PM

    hapmlpy's Avatar

    Hi Vlas,
    (1)I tried using the command you suggested to create a iPhone 7 simulator, but I got this mesage:

    Invalid device type: 7
    (2) I followed Bonjour Debugging guide, the output is:
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    Reveal-Protocol-Version: 45
    Reveal-Device-Simulator: YES
    Reveal-System-Name: iOS
    Accept-Ranges: bytes
    Date: Thu, 02 Aug 2018 14:13:30 GMT
    Reveal-System-Version: 11.4
    Content-Length: 1932716
    Reveal-Device-Model: iPhone
    (3) The /etc/hostsfile is zero byte. This file seems to deny any modifications, I can't open it or copy it. How should I check it contents?

    Best Regards,

  5. Support Staff 5 Posted by Vlas Voloshin on 03 Aug, 2018 12:34 AM

    Vlas Voloshin's Avatar

    Hi Jain,

    Sorry, I've made a small typo in that command. Please try this one instead:

    xcrun simctl create iPhone\ 7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 com.apple.CoreSimulator.SimRuntime.iOS-10-3

    Looks like Reveal Server works well, so at the moment I'll assume that the problem is with the /etc/hosts file. It's definitely strange that it's reported as zero-bytes long, but I'd like to confirm this before making any modifications to it. In order to do that, please run these commands in Terminal:

    ls -l /etc/hosts
    cat /etc/hosts

    These should print some information about the file and its contents (if any), respectively, for example:

    Vlas-Voloshin-MacBook-Pro:~ vlas$ ls -l /etc/hosts
    -rw-r--r--  1 root  wheel  213 27 Nov  2015 /etc/hosts
    Vlas-Voloshin-MacBook-Pro:~ vlas$ cat /etc/hosts
    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##   localhost broadcasthost
    ::1             localhost

    If you can definitely see that this file is empty (i.e. the second command gives an empty result, and neither something like I've posted above, nor an error), you need to restore its original contents. Internet has a few guides to do so, but this one looks reasonable. If, however, you see errors when running these commands, or the contents are not actually empty, or you're having trouble restoring the original contents of /etc/hosts, please let me know.

    Best regards,

  6. 6 Posted by hapmlpy on 03 Aug, 2018 07:12 AM

    hapmlpy's Avatar

    Hi Vlas, I restored /etc/hosts file, it worked finally!
    I really appreciate your help.

  7. Support Staff 7 Posted by Vlas Voloshin on 03 Aug, 2018 07:15 AM

    Vlas Voloshin's Avatar

    Hi Jain,

    I'm glad we've been able to resolve this – enjoy Reveal!

    Best regards,

  8. Vlas Voloshin closed this discussion on 03 Aug, 2018 07:15 AM.

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

Keyboard shortcuts


? 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