Building Your First Nintendo Switch App: A macOS DevkitPro Setup Guide

Building Your First Nintendo Switch App: A macOS DevkitPro Setup Guide

By Reggi, 29 Nov 2023

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.

bash
xcode-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).

bash
sudo 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:

bash
sudo 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:

bash
export 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:

bash
source ~/.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.

bash
cp -r "${DEVKITPRO}/examples/switch/templates/application" /tmp/example cd /tmp/example make

You now have a file in the current directory named example.nro.


Popular Reads