-
Notifications
You must be signed in to change notification settings - Fork 605
macOS Quick Start Guide
This guide provides step-by-step instructions to set up the Alexa Voice Service (AVS) Device SDK on macOS. When finished, you'll have a working sample app to test interactions with Alexa.
WARNING: This guide doesn't include instructions to enable wake word.
Software
Tool | Minimum Version |
---|---|
Python | 2.7.x |
Xcode | - |
Homebrew | - |
To install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Register an AVS Product and Create a Security Profile, if you haven't already. It must be enabled for Code-Based Linking.
-
Make sure that Python 2.7.x is installed on your system:
python -V
-
Update Homebrew:
brew update
-
Set up your build environment. Create a my_project folder, and these subfolders: build, source, third-party, application-necessities > sound-files.
cd ~/ mkdir my_project cd {my_project} mkdir build source third-party application-necessities cd application-necessities mkdir sound-files cd ~/{my_project}
-
Install curl-openssl, which is required to connect to AVS:
cd ~ brew install curl-openssl
-
Install the core SDK dependencies:
cd ~ brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-libav sqlite3 repo cmake clang-format doxygen wget git
IMPORTANT: Make sure that command ran successfully, and that no errors were thrown. If for any reason the install command fails, run brew install for each dependency individually.
-
Install and configure PortAudio. Portaudio is required to stream microphone input/output data.
cd ~/my_project/third-party wget -c http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz tar xf pa_stable_v190600_20161030.tgz cd portaudio ./configure make
IMPORTANT: If you see
"error: cannot find 10.5 to 10.12 SDK"
, then run:./configure --disable-mac-universal make
-
Clone the SDK into the ~/my_project/source folder:
cd ~/{my_project}/source git clone git://github.com/alexa/avs-device-sdk.git
- Use the CMake parameters in this section to customize how the SDK builds. To get debug logs from the sample app, include the
-DCMAKE_BUILD_TYPE=DEBUG
option. For more information, see Debug builds.
In this example it is declared that gstreamer is enabled, and provides the path to PortAudio, and also enables debug logging (which is optional):
cd ~/my_project/build
cmake /~/{my_project}/source/avs-device-sdk \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DCURL_LIBRARY=/usr/local/opt/curl-openssl/lib/libcurl.dylib \
-DCURL_INCLUDE_DIR=/usr/local/opt/curl-openssl/include \
-DPORTAUDIO=ON \
-DPORTAUDIO_LIB_PATH=/~/{my_project}/third-party/portaudio/lib/.libs/libportaudio.a \
-DPORTAUDIO_INCLUDE_DIR=/~/{my_project}/third-party/portaudio/include
-DCMAKE_BUILD_TYPE=DEBUG
make
- Now, you can build the SDK by running this command:
make SampleApp -j2
Note: You can use -j3
or j4
to run processes in parallel during make.
If you want to build the full SDK, including unit and integration tests, run make
instead of make SampleApp
.
After you have built the SDK, you'll need to configure and authorize it to access AVS using Login with Amazon (LWA). To do this, follow these authorization instructions.
You can designate aliases to launch the sample app. To do this:
- Open
~/.bash_profile
. Add these aliases and save:
IMPORTANT: Make sure you update the paths to match your folder structure.alias alexac="~/{my_project}/{build}/SampleApp/src/SampleApp {build}/Integration/AlexaClientSDKConfig.json" alias alexacdebug="~/{my_project/build}/SampleApp/src/SampleApp ~/{my_project}/{build}/Integration/AlexaClientSDKConfig.json DEBUG9"
- After you've added these aliases, make sure to activate your
~/.bash_profile
:source ~/.bash_profile
- Now the sample app can be launched with this single command:
alexac
See the Troubleshooting Guide.
API Reference
Quick-start Guides
- All Quick-start Guides
- For Android
- Cross-compile for iOS
- Generic Linux
- For macOS
- For Raspberry Pi
- For Ubuntu Linux
- For Windows 64-bit
Other Guides + Optimizations
- Authorizing AVS Device SDK Software with AVS
- Build libcurl with mbed TLS and nghttp2
- Build libcurl with nghttp2 for macOS
- Optimize libcurl for Size
- Runtime Configuration for CA Certificates
- Updating the SDK
Development Kits
Resources