Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Test AWS IoT Greengrass components with local deployments

Focus mode
Test AWS IoT Greengrass components with local deployments - AWS IoT Greengrass

If you develop a Greengrass component on a core device, you can create a local deployment to install and test it. Follow the steps in this section to create a local deployment.

If you develop the component on a different computer, such as a local development computer, you can't create a local deployment. Instead, publish the component to the AWS IoT Greengrass service so that you can deploy it to Greengrass core devices to test it. For more information, see Publish components to deploy to your core devices and Deploy AWS IoT Greengrass components to devices.

To test a component on an Greengrass core device
  1. The core device logs events such as component updates. You can view this log file to discover and troubleshoot errors with your component, such as an invalid recipe. This log file also displays messages that your component prints to standard out (stdout). We recommend that you open an additional terminal session on your core device to observe new log messages in real time. Open a new terminal session, such as through SSH, and run the following command to view the logs. Replace /greengrass/v2 with the path to the AWS IoT Greengrass root folder.

    Linux or Unix
    sudo tail -f /greengrass/v2/logs/greengrass.log
    PowerShell
    gc C:\greengrass\v2\logs\greengrass.log -Tail 10 -Wait
    sudo tail -f /greengrass/v2/logs/greengrass.log

    You can also view the log file for your component.

    Linux or Unix
    sudo tail -f /greengrass/v2/logs/com.example.HelloWorld.log
    PowerShell
    gc C:\greengrass\v2\logs\com.example.HelloWorld.log -Tail 10 -Wait
    sudo tail -f /greengrass/v2/logs/com.example.HelloWorld.log
  2. In your original terminal session, run the following command to update the core device with your component. Replace /greengrass/v2 with the path to the AWS IoT Greengrass root folder, and replace ~/greengrassv2 with the path to your local development folder.

    Linux or Unix
    sudo /greengrass/v2/bin/greengrass-cli deployment create \ --recipeDir ~/greengrassv2/recipes \ --artifactDir ~/greengrassv2/artifacts \ --merge "com.example.HelloWorld=1.0.0"
    Windows Command Prompt (CMD)
    C:\greengrass\v2\bin\greengrass-cli deployment create ^ --recipeDir %USERPROFILE%\greengrassv2\recipes ^ --artifactDir %USERPROFILE%\greengrassv2\artifacts ^ --merge "com.example.HelloWorld=1.0.0"
    PowerShell
    C:\greengrass\v2\bin\greengrass-cli deployment create ` --recipeDir ~/greengrassv2/recipes ` --artifactDir ~/greengrassv2/artifacts ` --merge "com.example.HelloWorld=1.0.0"
    sudo /greengrass/v2/bin/greengrass-cli deployment create \ --recipeDir ~/greengrassv2/recipes \ --artifactDir ~/greengrassv2/artifacts \ --merge "com.example.HelloWorld=1.0.0"
    Note

    You can also use the greengrass-cli deployment create command to set the value of your component's configuration parameters. For more information, see create.

  3. Use the greengrass-cli deployment status command to monitor the progress of your component's deployment.

    Unix or Linux
    sudo /greengrass/v2/bin/greengrass-cli deployment status \ -i deployment-id
    Windows Command Prompt (CMD)
    C:\greengrass\v2\bin\greengrass-cli deployment status ^ -i deployment-id
    PowerShell
    C:\greengrass\v2\bin\greengrass-cli deployment status ` -i deployment-id
    sudo /greengrass/v2/bin/greengrass-cli deployment status \ -i deployment-id
  4. Test your component as it runs on the Greengrass core device. When you finish this version of your component, you can upload it to the AWS IoT Greengrass service. Then, you can deploy the component to other core devices. For more information, see Publish components to deploy to your core devices.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.