General VS Code usage questions...

Hi,

Really enjoying VS Code for ConnectIQ, despite some teething troubles. But frustrated with not being able to workout simple things that I am sure are really, really easy if you know how.

And I am certain that I am not alone!

So....

Rather than deluge the forum with lots of related threads, can we have this one as a general discussion thread for Q & A specifically for VS Code?

I'll start:

1. When you start running apps, (Ctrl+Shift+P >> "Connect IQ: Run app") it gives you a nice, searchable list of devices to get you started. But the second time you run it, that list is gone. How can I select a different build target for the simulator without restarting VS Code?

2. For testing an app, I need to use compiler args: Is there a keyboard shortcut to open Connect IQ settings as I need to change them a lot?

  • Thanks Travis.  I setup the command line environment and yep, I can start the simulator (from a macos terminal prompt).  BUT, when I try and run the monkeydo command it says "Unable to connect to simulator.".  Interestingly, my eclipse environment (2020-03 - 4.15.0) still works - that is, the simulator launches and runs the app.  I have VSCode referring to my app directly from the eclipse workspace.

  • 0.1.2 was just published which should address this issue.

  • Thanks Kyle.  The simulator now starts in VSCode, but it's not running my app - it's just a blank window.  I have run the build process in VSCode and that looks like it completes - .PRG file is created.  Also, my app is still building and launching in the simulator on Eclipse.

    This is the output:

    > Executing task in folder TrainingPower: java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /Users/rda/Library/Application Support/Garmin/ConnectIQ/Sdks/connectiq-sdk-mac-3.2.3-2020-10-13-c14e609bd/bin/monkeybrains.jar -o bin/TrainingPower.prg -f /Users/rda/OneDrive/Home/GarminConnect/eclipse-ws/TrainingPower/monkey.jungle -y /Users/rda/OneDrive/Home/GarminConnect/developer_key -d edge530 <


    Terminal will be reused by tasks, press any key to close it.

  • Try just running your app again while the sim is open I've also seen this in windows.

    from the notes for the extension in VS Code

    Known Issues

    • The Connect IQ: Run App command may be required to run twice if the Connect IQ Simulator isn't already running
  • Thanks Jim, just tried again.  No go.

  • If I have created a project using VSCode, how can I get Eclipse to recognise it in order to use the Application Settings?

    I tried just doing an import from folder / source and it has imported it... but not recognised it as Connect IQ. :(

  • you need to have :

          <buildSpec>
                    <buildCommand>
                            <name>connectiq.builder</name>
                            <arguments>
                            </arguments>
                    </buildCommand>
            </buildSpec>
            <natures>
                    <nature>connectiq.projectNature</nature>
            </natures>

    in the eclipse .project file to be recognize as a Connect IQ project

  • Thanks, I see that now. 

    Is there a menu option to change it? I remember finding something for a different technology in eclipse but no idea where. 

  • don't know ! i just edit the file in any editor I have !

  • Is this a bug or something else?
    When I "Connect IQ: Edit Products" and select all, I see "Vivolife"... which is a bit strange because:

    a) It doesn't appear to support... anything... certainly not widgets or data fields

    b) It doesn't appear in the Eclipse devices list

    c) It doesn't appear in the https://developer.garmin.com/connect-iq/compatible-devices/ page

    Should Vivolife be there?