Failed to connect to the simulator

Since yesterday, when a power failure to the area stopped everything, I have been unable to run the sim. All apps build but fails to proceed with "Failed to connect to the simulator".
No other apps appear to have been damaged.
I have tried
  • reboot the Mac - obviously reloads Eclipse
  • swap the SDK to an earlier version
Running Mac Mojave, SDK 3.0.5, Eclipse Oxygen.

Any other suggestions before I reinstall Eclipse?
  • Try uninstalling the Connect IQ SDK Manager as well. Even though they're listed separately, I think you have to uninstall both. When I tried to uninstall just the IDE, it appeared to be uninstalled (didn't appear in the list anymore), but all the functions were still there until I also uninstalled the SDK manager.
  • That did it .... am proceeding to re-install, will advise, thanks
  • Sorry, it's still broken!
    I uninstalled both components successfully. Eclipse re-opened with no Connect IQ in the menu (and complaining about no editor for the current project)
    I re-booted the Mac for good measure.
    I followed the installation process - which was over in seconds, with no errors.
    Eclipse re-opened with Connect IQ, but the sim still won't start.

    [ further]
    But Eclipse did not require any of the steps in "Configuring the Eclipse Plug-in" in the instructions. Seems to me the uninstall is leaving configuration details.
  • Yeah I didn't expect all the steps needed to be followed for a reinstall.

    Try running the simulator manually with "sudo"
  • Interesting Unable to connect to an ANT device; no devices available
    Mean anything to you? I'm not using any ANT device!
    ->message processor init on channel 0




    ->message processor init on channel 0




    ->message processor init on channel 0




    ->message processor init on channel 0




    ->message processor init on channel 0




    ->message processor init on channel 0




    ->message processor init on channel 0




    ->message processor init on channel 0




    Unable to connect to an ANT device; no devices available




    title = A

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    title = A

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    title = G

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    title = P

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    title = A

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    title = P

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    title = O

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    title = A

    artist =

    collection =

    genre =

    track_num = 0

    duration = 0

    num_tracks = 0

    type = 3

    12:00:54 PM: Debug: SetLayout

  • Interesting:
    ->message processor init on channel 0

    Unable to connect to an ANT device; no devices available


    amongst a whole bunch of uninteresting stuff (that theForum won't let me post; "Unapproved"!!)
    I'm not using and ANT devices.

    [will be back in 12 hrs]
  • RaceQs, did the simulator exit by itself again after it printed all of those messages?

    The ANT device message is not really a *fatal* error -- it's more like one of those informational messages that just looks like an error. I get it too when I start the simulator manually. I get all the same stuff you do, except for the final line ("Debug: SetLayout").

    You might want to try it again when you have a chance. Someone else posted a couple of years ago that they had to launch the sim with sudo (just once) in order for it initialize itself properly. Maybe it'll work now.....

  • Interesting...

    When I launch the sim from the terminal with sudo now, the Sim window opens as a grey box and the IQ logo appears in the Carousel and the terminal session does not close.
    Then, with the sim in this state, I can build and run an app in the sim!
    Now, to be able to run an app in the sim, I have to have the simulator invoked from sudo in the terminal window.

    If I close the sim window and attempt or build/run from Eclipse, it fails as before.

    If I start the sim from the terminal window, I can then build and run apps from Eclipse, but the console output appears in the terminal window, not in Eclipse console.

    So, I can proceed to run apps in the simulator, but only if the simulator is started in the terminal.

    Bizarre!

    I have just returned briefly from some on-water testing (Wed afternoon yacht racing and post-racing entertainment). Off to bed now and will experiment further in the morning.




  • OK, I have probably don't have the correct terminology here, but it looks like Eclipse is failing to launch the simulator that the IQ plugin needs to connect to in order to run watch apps. If the simulator has been started from a terminal window, then the IQ plugin is able to connect.

    Eclipse's failure to launch the simulator looks very much like my failure to launch the simulator from the terminal without 'sudo': the simulator icon briefly flashes in the Carousel and dies.
    So it looks like a permissions issue.
    My Unix skills are a bit rusty. Here are the perms on simulator:
    -rwxr--r--@ 1 alansmith staff 43583888 21 Nov 01:45 simulator


    So how can I find out why Eclipse is failing to launch the simulator?
  • Yes, the Eclipse Connect IQ plug-in is running the simulator with your normal privileges, as it should. If it needed admin privileges (which it shouldn't), then it would have to pop-up a window to ask you for your credentials. So the case where you run the simulator from the terminal without sudo should be equivalent to the case where the plug-in runs it (aside from any additional parameters that the plug-in could hypothetically pass in, which it doesn't, at least on Windows.)

    In this case it's not the permissions on the simulator itself that are the problem, it's the permissions on whatever the simulator is trying to access. e.g. Open internal network ports so the plugin can communicate with it.

    In Linux you can trace all the system calls that an app makes using the strace tool, so you could see where it is failing.

    In Mac OS X, it's a bit more complicated, as you have to use dtrace/dtruss which requires admin privileges, but in your case you also want to run the simulator with non-admin privileges so you can see it fail.

    sudo dtruss -f sudo -u YOUR_USERNAME ./simulator >& trace.txt


    This will give you a huge file, but typically you only care about the last few lines, which would indicate what happens just before the simulator exits.

    You could post trace.txt as an attachment or as plain text on https://www.pastebin.com and maybe someone from Garmin can help you.

    Good luck!