Open spaceshiptrip opened 1 month ago
Using VSCode and manually build and deploy:
If you're using VS Code on your Mac and have already installed the Garmin Connect IQ SDK, you can compile and deploy your app to your Garmin Fenix 5X Plus by following these steps:
The Garmin Connect IQ SDK comes with command-line tools that allow you to compile, simulate, and deploy your apps. To use these tools, ensure that you have the Connect IQ SDK installed and that the monkeyc
command-line tool is in your system's PATH.
Open a terminal.
Add the Garmin Connect IQ SDK to your PATH by adding this line to your ~/.zshrc
(or ~/.bashrc
if using Bash):
export PATH=$PATH:/path/to/garmin/sdk/bin
Replace /path/to/garmin/sdk/bin
with the actual path where you installed the SDK (e.g., /Users/yourusername/Library/Application Support/Garmin/ConnectIQ/Sdk/bin
).
Reload the terminal or source your shell config file:
source ~/.zshrc
Verify that monkeyc
is available by running:
monkeyc --version
You should see output like monkeyc version <version-number>
.
Create a New Connect IQ Project:
IntervalApp
).IntervalApp/
├── source/
│ └── app.mc # Your Monkey C source code
├── manifest.xml # Your manifest file
└── resources/ # Optional resources (e.g., icons)
Add Your Source Code and Manifest:
app.mc
) to the source/
folder.manifest.xml
at the project root (as you've already created).monkeyc
In the terminal, navigate to your project directory (where the manifest.xml
is located) and use the monkeyc
command to compile your app.
Here’s the basic syntax for compiling:
monkeyc -o output.prg -f manifest.xml -y developer_key.der -m /path/to/sdk/device_profiles/fenix5XPlus/device.xml source/app.mc
Let’s break down the command:
-o output.prg
: This specifies the output file (.prg
) that will be generated. This is the compiled app.-f manifest.xml
: The path to your manifest.xml
file.-y developer_key.der
: The path to your developer key (more on this below).-m /path/to/sdk/device_profiles/fenix5XPlus/device.xml
: The path to the Fenix 5X Plus device profile. This is required to target your specific watch model. Replace /path/to/sdk/
with the actual path where you installed the SDK.source/app.mc
: The path to your source code.If this is your first time compiling an app for Garmin Connect IQ, you need to generate a developer key. You can do this using the monkeyc
command:
monkeyc --create-key developer_key.der --cn "Your Name"
This will generate a file called developer_key.der
that you can use to sign your app when compiling.
Garmin provides a Connect IQ Simulator as part of the SDK. To run your app on the simulator:
Launch the Simulator:
connectiq
This will open the Garmin Connect IQ Simulator.
Load and run your app in the simulator:
.prg
file you compiled (output.prg
).Once your app is compiled into the .prg
file, you can deploy it to your Garmin Fenix 5X Plus.
Use the monkeydo
command to deploy the app to your watch:
monkeydo output.prg /path/to/sdk/device_profiles/fenix5XPlus/device.xml
Replace /path/to/sdk/device_profiles/fenix5XPlus/device.xml
with the correct path to your device profile XML file in the SDK. This command deploys the output.prg
file to your Fenix 5X Plus.
Once deployed, the app should appear on your Fenix 5X Plus under "Apps". You can now launch and test it directly on the watch.
.zshrc
).device_profiles
folder of the SDK.developer_key.der
for signing your app.Let me know if you encounter any issues or need further assistance with the compilation or deployment process!
Now that you have the
manifest.xml
and the source code for your Garmin Connect IQ app, you can compile and deploy it to your Garmin Fenix 5X Plus. Here's a step-by-step guide to help you with the process:Step 1: Set Up Your Development Environment
Make sure you've installed the Garmin Connect IQ SDK and the Connect IQ SDK Manager. If you're using Eclipse or Visual Studio Code, ensure your IDE is set up correctly with the Connect IQ SDK plugin.
Using Eclipse (Garmin's Recommended IDE):
Open Eclipse.
Install Connect IQ Plugin:
Create a New Connect IQ Project:
IntervalApp
).Add Your Source Files:
manifest.xml
andsource
folder content with your actual source code andmanifest.xml
.source
directory and themanifest.xml
is at the project root.Step 2: Compile Your App
Using Eclipse:
Build the Project:
manifest.xml
, right-click on your project in the Project Explorer.Check for Compilation Errors:
Step 3: Deploy the App to Your Garmin Device
Using Eclipse:
Connect Your Garmin Fenix 5X Plus:
Launch the Simulator:
fenix 5X Plus
) from the Device drop-down list.Deploy to Your Watch:
Step 4: Test the App on Your Watch
Once the app is successfully deployed, you should be able to find it on your Garmin Fenix 5X Plus under the "Apps" menu.
Step 5: Using the Simulator (Optional)
Garmin provides a simulator that allows you to test your app without deploying it directly to your device.
Launch the Simulator:
Test the App:
Step 6: Sync with Garmin Connect (for Activity Upload)
After testing and saving activities, when you connect your watch to Garmin Connect (via the mobile app or Garmin Express on a PC), the activity should sync with your Garmin Connect account. If the session was saved, it will be uploaded automatically.
Troubleshooting
manifest.xml
is correctly configured.Let me know if you run into any issues or need further clarification!