Using the Connectiq tool shell to push a file to my watch

I'm trying to develop apps for my Venu3 and I would like to test the app on real HW by copying the PRG file to the watch.  I can do this with File Explorer but I'd really like to be able to do this from the command line.  I notice that one of the Connectiq tools is 'shell' and there's an option to this command to push a file to the device.  Unfortunately, I cannot get this command work, it always throws an invalid destination error and fails, e.g. the command 'shell push xyzzy.log' should push a file to the root directory of the device but it fails with invalid destination.

Does anyone know how to use this tool to push files to a Garmin device?

  • I either don't understand what and why and how you want to do, or I do, but then I don't understand your problem.

    Do you want to connect the watch using the USB cable to your computer? If yes then depending on your OS you can cp or copy the pry file to the watch IMHO, no need to use she'll push magic.

    If you don't want to connect, then upload your project (IQ file instead of prg) to the store as a beta app and install it from Connect IQ app on your phone.

  • Sorry, forgot to mention I'm running on Windows.  Yes, I've connected the watch with the USB cable but I can't use the cp.exe program to copy files because there's no way in Windows to refer to the watch.  I've searched but can't find a syntax that will allow the Window's cp.exe command to refer to the connected watch.

  • I either don't understand what and why and how you want to do, or I do, but then I don't understand your problem.
    I can do this with File Explorer but I'd really like to be able to do this from the command line.

    As OP implied, Windows doesn't provide access to MTP devices via the command line, only through File Explorer (which is the Windows graphical shell as well as its GUI file manager).

    Here's a superuser post about this very topic (accessing MTP devices in Windows via the command line), including a comment about accessing Garmin devices.

    https://superuser.com/questions/369959/how-do-i-access-mtp-devices-on-the-command-line-in-windows

    The suggested solution is to use MTPMount, but it seems that:

    - the project is abandoned

    - the latest version has a bug that could cause data loss :/

  • Agreed, Windows commands are broken so, back to my original question, is there a way to get the Connetiq shell command to push a file?

  • I think the shell command is for talking to the simulator, not for managing a real device.

    You can see this if you run a CIQ app in the sim (or otherwise launch the simulator), then run the shell command with no args -- it will connect to the simulator. (If the simulator is not running, it will fail to connect.)

    Also:

    > .\shell --list_transports
    -------------------------------------------------------------
    Transport name: tcp
    This transport takes an optional parameter to specify the
    ip address and portto connect to.  If not passed it will default to
    127.0.0.1:1234

    Given that Garmin devices aren't available via TCP when connected via USB, and the only transport listed is tcp, I have to conclude that shell is probably not for talking to real devices :/. (It would be cool if you could activate a debug mode on the device where it would actually listen on a TCP port via wi-fi, but I don't think any such feature exists.)

  • There's also a commercial solution for mounting MTP devices in Windows -- https://www.mtpdrive.com/ -- but it's not free

  • All I can say is -- sigh so close.  Tnx for the info, I guess I'll learn to like dragging/dropping in File Explorer and yelling loudly when I hit the wrong place on the touch pad and drop files in a totally unexpected place.

  • CTRL-C / CTRL-V might be more reliable

    -- Captain Obvious

    Yeah it's a pain. Just like the fact that you usually have to copy a file off of the MTP "drive" just to view it in an app. Sometimes Windows will automatically create a temporary copy to facilitate this, but not always (I think it either depends on how you try to open the file, or which app you open it with.)

  • There's one more thing you can try. You can upload the project as beta, and then instead of waiting for Garmin to do their thing (that can be minutes or hours), if you anyway would connect the watch to the PC then you can click download in the store and let Garmin Express finish the work.

    The downside is that you have to set up the project (1 time thing).
    All the rest IMHO is not worse than what you would do in your flow:
    instead of building for a device (prg) you do export project (if you only have 1 device in manifest then it should not take longer)
    Instead of drag & drop via the MTP thing, you upload it to the store

  • Tnx for the idea but no, I don't want to deal with a 3rd party site just to do development.  I'll stick with File Explorer and try to control my fingers better.