No more on-device debugging?

Hi

I'm trying to debug my apps on an EPIX gen 2 device and having the hardest time. I never had any problems on my old Fenix 5. The Epix gen 2 device connects as an MTP device instead of as a mass storage device, which makes it very difficult to write new log files to it.The windows file system doesn't allow me to create new files under the LOGS directory, I can only rename existing files. 

On top of that, the .prg files are apparently stored in some hidden location that I cannot find (hence I don't know what filenames the apps get), which makes it impossible to add log files for debugging (even if I actually COULD write new files to the device, which I can't).

Although the approach to manually add txt files to the device for debug logging was perhaps not entirely straight forward and rubust, it was extremely useful to debug apps on the devices. 

Question: Is this the end of on-device debugging? Or are there any work-arounds available?

best regards

Fredrik

Top Replies

  • On top of that, the .prg files are apparently stored in some hidden location that I cannot find (hence I don't know what filenames the apps get), which makes it impossible to add log…

All Replies

  • Nope.  The issue you see with MTP is nothing new, as apple only likes it's own music devices.  For windows, I create the txt file on my hard drive and copy it over.

    As far as the name of the txt, this can happen if you have a store version of the app installed and you then copy over a sideload..  When installed from the store, the prg gets an 8 character store assigned name, When you copy over a side load, it takes the existing name, as the manifest ID is the same.  The way to prevent this is to uninstall the store version before you copy over the sideload.  That way your "abc.prg" stays "abc.prg" and the log file needs to be "abc.txt".

    The prg does get hidden, but just use "abc.txt" in the logs directory.

  • Thanks Jim, copying the log files works fine, I should have tested that before. However, I still don't see the names of the .prg files when I install apps through the app store (using Garmin Express). Is side-loading the only option?   

  • On top of that, the .prg files are apparently stored in some hidden location that I cannot find (hence I don't know what filenames the apps get), which makes it impossible to add log files for debugging (even if I actually COULD write new files to the device, which I can't).

    You can look in garmindevice.xml to see the actual filename of any PRG installed on your device, even the hidden/inaccessible PRGs.

    For example (after HTML/XML beautification):

    <App>
        <AppName>Strava Relative Effort</AppName>
        <StoreId>6b53eedd-bf67-4c18-a2d6-af1d59518357</StoreId>
        <AppId>aabaf454-3c10-425f-b377-b3d1ca5b5ccc</AppId>
        <AppType>data-field</AppType>
        <Version>58</Version>
        <FileName>6EEDD6F.PRG</FileName>
    </App>

    But yes, as jim_m_58 mentioned, as long as you don't have the same app (with same UUID) installed from the store, the filename of your sideload should be preserved.

    The issue you see with MTP is nothing new, as apple only likes it's own music devices.  For windows, I create the txt file on my hard drive and copy it over.

    idk why you always make this a windows vs. apple thing. I may as well complain about the mess of compatibility with file systems on external USB storage where different models of TVs (for example) support different subsets of exFAT, FAT32 and NTFS due to Microsoft licensing fees. Microsoft has a long history of trying to force proprietary file formats and "standards" onto the industry so they can lock users in for $$$. Apple is no better or worse, and considering how marginalized they used to be (a long time ago), I don't blame them for not wanting to support their competitor's protocols. May as well criticize Garmin for not enabling Apple Watch, Polar and Suunto to natively sync to Connect.

    And yes, with MTP typically you have to copy files to or from the device, even in Windows, instead of directly opening or creating them in-place. For example, if I try to open garmindevice.xml in VS Code on Windows, what actually gets opened is a copy of the file in a temporary location on my system drive. If I make changes to the file and try to save the temporary copy, it doesn't get synced back to the original (naturally). So to edit anything on the device, I would have to first copy the file off the device, edit it, then copy it back.

    This is because MTP isn't a file system where the client has direct access to the underlying contents, it's a protocol that gives the client less access than a real file system. There's pros and cons to this (e.g. it's slower but more robust.) There's a reason mass storage devices need to be safely removed / ejected and MTP devices do not.

  • Thank you both for your answers. You solved my problem. Now I can find the .prg file name in the GarminSevice.xml, create a corresponding .txt file on my local filesystem and copy it over to the LOGS directory. Back to debugging now.