Brilliant :-)

If you are tired of creating LOGS text files as your PRG files are created and auto-renamed all the time....


Just create a BAT file (batch) in the LOGS directory with these line. Run it every time you load up a new PRG file to your device. You are welcome :-) Obviously run it from the LOGS directory, which is what happens when you double click on the BAT file from the folder.

What this does is remove existing TXT files, copies all your PRG files to the LOGS folder, renaming them to TXT files, and then zeros out the contents so the TXT files are empty.


PRG2TXT.BAT
===============================
del *.txt >nul 2>&1
copy ..\*.prg .\*.txt
for %%f in (*.txt) do break>%%f

  • peterdedecker good point, thanks! Not to be too pedantic but it's mass storage vs MTP (MTP works over USB, too, as well as other transports). And it's the Windows command prompt, not DOS....

    However, I haven't tried it, but I suppose you could try something like this (although I'd be sure to read the FAQ/known limitations, since my understanding is that MTP is very different than a "real" filesystem):
    http://www.mtpdrive.com/index.html
    The MTPdrive allows mapping devices operating in MTP mode to a drive letter in Microsoft Windows. It offers read access to the files on the device with ability to delete them (e.g. digital cameras or Apple devices). Write access is supported as well but it depends on device's capabilities (typically Android based devices allow it).

  • and it only works if you're developing on Windows, not Mac ;)
  • RaceQs Yeah, now that Windows 10 has Ubuntu, it would be nice to standardize on bash scripts for this kind of thing. Windows command prompt scripting is really nothing compared to bash, awk, grep, sed, etc.... In the past I've even used GNU tools for win32 to help automate Windows builds, when batch files weren't enough.

    I guess the problem is that Mac is a BSD derivative while Ubuntu is Linux, so scripts wouldn't be 100% interoperable....
  • Mac is a whole different beast when it comes to MTP devices too.. A mac won't be able to access the device natively at all. You need something like ATP (https://www.android.com/filetransfer/) even to do a sideload.
  • Former Member
    Former Member
    Here is something similar for Windows with Powershell, will detect the PRG Name and USB Device:

    https://forums.garmin.com/forum/developers/connect-iq/connect-iq-showcase/1226544-tool-ciqapplogs#post1226544


    PS C:\temp> .\ciqapplogs.ps1 -help

    NAME
    C:\temp\ciqapplogs.ps1

    ÜBERSICHT
    Enable/Disable App Logging


    SYNTAX
    C:\temp\ciqapplogs.ps1 [-help] [<CommonParameters>]

    C:\temp\ciqapplogs.ps1 [-list <String>] [-print] [<CommonParameters>]

    C:\temp\ciqapplogs.ps1 [-create <String>] [<CommonParameters>]

    C:\temp\ciqapplogs.ps1 [-delete <String>] [<CommonParameters>]


    BESCHREIBUNG
    The script allows to enable logging of an App by creating the correct logfile,
    or disable logging by deleting the logfile. The name of the logfile is automaticly determined.
    You can also list the content of the logfile directory or display the content of the logfile.