Is there a programmatic way to extract the actual CIQ App/Datafield Name - to map the randomized PRG filename to the associated App Name?
Is there a programmatic way to extract the actual CIQ App/Datafield Name - to map the randomized PRG filename to the associated App Name?
The mappings from PRG name to app name are present in garmindevice.xml -- you can extract the mappings programmatically if you can access the device "file system" (via USB Mass Storage or MTP) and parse…
I expected them to be kept there if they were there previously because the same app was already there from the store. Now I know this isn't the case.
The mappings from PRG name to app name are present in garmindevice.xml -- you can extract the mappings programmatically if you can access the device "file system" (via USB Mass Storage or MTP) and parse the XML.
Example (after beautification):
<?xml version="1.0" encoding="UTF-8"?> <Device xmlns="http://www.garmin.com/xmlschemas/GarminDevice/v2" ... <Extensions> ... <IQAppExt xmlns="http://www.garmin.com/xmlschemas/IqExt/v1"> ... <Apps> <App> <AppName>Connect IQ Store</AppName> <StoreId>7cd38736-510a-4480-8801-0dfe2f5944af</StoreId> <AppId>1e3e023f-bdc8-4127-b36a-a8eeebfd683f</AppId> <AppType>watch-app</AppType> <Version>30</Version> <FileName>5CC82AC.PRG</FileName> </App> ...
To see something like the above:
- Copy \GARMIN\GARMINDEVICE.XML to your hard drive
- Open the copy in VS Code (or some other text editor)
- If using VS Code, format / beautify the document: CTRL/CMD-SHIFT-P > Format Document
Thank you!!
I just did this and it worked brilliantly. I was able to scrub the PRGs on my device. Thanks!
So is the prg name decided by the device? Isn't it available after the build? Because if it is only decided by the device it means I need to connect the device (fr965, so need to use Android File Transfer) wait for at least 1 minute (because connecting it kind of freezes the device on a black screen and nothing happens in the computer) until the AFT pops up, copy the prg to the device, disconnect the USB cable, and then reconnect (again wait 1+ minute) just to be able to look at garmindevice.xml.
Welcome to Connect IQ development!
So is the prg name decided by the device? Isn't it available after the build?
This thread is from 2015, so take it with a grain of salt. But yeah, for all intents and purposes you should assume PRG names are random/unknown. (Unless ofc you sideloaded an app, and said app wasn't already installed from the store.)
https://forums.garmin.com/developer/connect-iq/f/discussion/1206/prg-names-from-the-app-stor
I believe the filename generated by Garmin Express is based on the app ID, but the filenames generated by Garmin Connect Mobile are simply randomized.
When you install something from the store, it is given an 8 character program name. Not the name you used when building an IQ file. The key then is the AppId for the app. If you later copy over a sideload, it will take the same name as the 8 character one from the store if the AppId is the same. If I'm testing a sideload, I'll first uninstall the store version so the name doesn't get changed. This was easier to see before prg files got hidden on devices.
It doesn't work!
1. I did had the (beta) app installed from the store previously.
2. I sideloaded the new prg, but it isn't added to garmindevice.xml
3. Indeed, no prg files in Apps directory.
So I have no way to add a txt file to be able to see the logs!?
Hopefully I'm not misunderstanding, but if you previously installed an app from the store, then you sideload a PRG with same app id, then the sideload will take on the name of the app from the store.
So I wouldn't expect garmindevice.xml to change when you sideload the app in this case. Just use the same base name as the original PRG from the store.
Or to make things simpler, you can do what jim_m_58 does and uninstall the store app before sideloading. In that case, the sideloaded app name will be preserved (with the possible exception of truncation to 8 characters.)
Jim's idea doesn't work on fr965 because it's a music device so I can't see any prg file.
I didn't mean to say the garmindevice.xml wasn't changed, but that my app wasn't in there (even though I did start it and I know it's the right version because I have a version const that I display on the main view just to be sure I'm debugging the latest build).
But I think I made it work now. I don't know why it didn't work previously. I "downgraded" to the store version from Connect IQ app, then I did see it in the xml, noted the filename, and then sideloaded the new build and added the txt file, and I can finally see the logs.