Building Your First Nintendo Switch App: A macOS DevkitPro Setup Guide
Setting Up the Development Toolchain
We’ll kick things off by preparing the Nintendo Switch Development Kit using devkitPro on macOS.
The prerequisite is straightforward: ensure Xcode Command Line Tools are installed, or run the command below.
bashxcode-select --install
Install the DevKitPro Package Manager
Download the latest devkitpro-pacman-installer.pkg from the GitHub Releases page.
Install it by running the following command (adjust the path as needed).
bashsudo installer -pkg /path/to/devkitpro-pacman-installer.pkg -target /
Install Libraries and Tools for Switch Development
Install the switch-dev package group using dkp-pacman. Run the command below:
bashsudo dkp-pacman --noconfirm --sync switch-dev
Update Shell Runtime Configuration
1. First Step
Create ~/.bash_profile (or edit it if it already exists) and add the following environment variables:
bashexport DEVKITPRO=/opt/devkitpro export DEVKITARM="${DEVKITPRO}/devkitARM" export DEVKITPPC="${DEVKITPRO}/devkitPPC" export PATH="${DEVKITPRO}/tools/bin:${PATH}"
2. Second Step Reload your bash profile to apply the changes:
bashsource ~/.bash_profile
Build Your First Application
DevkitPro ships with sample code installed at ${DEVKITPRO}/examples. You can use this to verify your toolchain or as a boilerplate for your first project.
bashcp -r "${DEVKITPRO}/examples/switch/templates/application" /tmp/example cd /tmp/example make
You now have a file in the current directory named example.nro.
