Video: Local Debugging for your Alexa Skill

The Alexa team recently announced that they will be publishing more tutorials for developing skills. As most of us advanced Skill Builders have learned, there is a dearth of tutorials on the Internet once you get past the initial beginner tutorials. One such topic that has cost me quite a lot of time finding information on is locally debugging Alexa Skills.

Local debugging has a number of benefits for Alexa Developers. First off, you don’t want to be doing a dance between the tabs in the Alexa Developer Console. When I first started creating Alexa Skills, it was easy enough to simply have the Build, Code, and Test sections opened in different browser tabs. Make a change to the model in the Build tab (i.e. add an Intent), add the Intent Handler in the Code tab, hit Deploy, then debug your skill with the Test tab using manual text input. This gets old fast, as you spend a lot of time refreshing and shifting between browser tabs.

Second, you need quicker feedback on what is broken in your skill. I will admit that the integrated CloudWatch logs for the Alexa-hosted Skills is really nice. A simple console.log(someData) will log data from your skill to CloudWatch.

CloudWatch Alexa hosted skill link in console
Cloudwatch hosted Alexa Skill debug logs

However, flipping between your testing session and the CloudWatch logs can be tedious and cumbersome once your Skill has progressed. The session also seems to end quicker than expected. It would be a lot better if you could test your skill and iterate quicker.

Luckily, the Alexa team put out a video that addresses setting up local debugging for your Skill. Check out this straightforward video from Sattwik Pati:

The general gist of this tutorial video is to change your endpoint for your skill from the hosted endpoint to a Ngrok endpoint. Then you run a script and you should be able to test your skill locally on your own computer in your own development environment.

Sattwik Pati also put out a blog post a few months ago on the same topic. You should take a look at this if you find tutorial articles easier to follow.

In the video, Sattwik also uses the ASK CLI dialog command to interact with his local skill. If you want to learn more about this, check out our latest article on using the ASK CLI dialog command.

Happy hacking (and new year)!