Difference between revisions of "Setting up Development Environment"

From Nintendo Switch Brew
Jump to navigation Jump to search
m (Adding instructions for Macs with older curl.)
Line 23: Line 23:
 
** openSUSE: <code>sudo zypper install git curl</code>
 
** openSUSE: <code>sudo zypper install git curl</code>
 
** Arch Linux/ALWSL: <code>sudo pacman -S git curl wget</code>
 
** Arch Linux/ALWSL: <code>sudo pacman -S git curl wget</code>
** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS.
+
** macOS: [http://git-scm.com/download/mac Download Git] and install it. Curl is included with the OS, but it might be too old to accept the newer TLS. If the third command below fails,  [https://stackoverflow.com/questions/38131012/why-does-a-new-user-account-fix-my-pod-install follow these instructions.] and try again.
  
 
* Next, we need to download, make executable and run the devkitARM updater (don't worry, the updater is also the installer.)
 
* Next, we need to download, make executable and run the devkitARM updater (don't worry, the updater is also the installer.)

Revision as of 01:15, 17 May 2018

Setup

Install devkitA64. If it's already installed, update it. On Windows, there's a graphical installer. On Unix-like platforms such as Linux/macOS, there's a Perl script. Make sure you also select libnx and the switch examples when installing.

Windows

devkitPro provides 64bit precompiled windows binaries of devkitA64 which can be run directly on Windows.

  • download the latest version of the graphical installer from github and run it, following the instructions as you go.
  • An Internet connection is required.
  • You will want to make sure devkitA64 is selected during the installation process to develop for the Switch - you can also install devkitARM (for 3DS, DS and GBA) and devkitPPC (for GameCube/Wii development) if you wish.
  • Once the installer has finished, launch MSYS from:
    • Windows 7 and earlier: Start -> All Programs -> devkitPro -> MSYS
    • Windows 8 and 8.1: Right click on the Start screen and select 'All Apps'. You should find MSYS there.
    • Windows 10 (pre-Anniversary Update): Start -> All Apps -> devkitPro -> MSYS
    • Windows 10 (post-Anniversary Update): Start -> devkitPro -> MSYS

Unix-like platforms

Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86_64), macOS (x86_64). Note that Linux x86_64 binaries are usable under WSL.

  • First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you'll need it to update libnx or share your code on GitHub, among many other things. If you are running Linux, you'll also need wget; it comes preinstalled on most distributions, but not all.
  • Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS:
    • Debian/Ubuntu/Linux Mint/Ubuntu on WSL: sudo apt-get install git curl
    • Fedora/CentOS/RHEL: sudo yum install git curl
    • openSUSE: sudo zypper install git curl
    • Arch Linux/ALWSL: sudo pacman -S git curl wget
    • macOS: Download Git and install it. Curl is included with the OS, but it might be too old to accept the newer TLS. If the third command below fails, follow these instructions. and try again.
  • Next, we need to download, make executable and run the devkitARM updater (don't worry, the updater is also the installer.)
curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitA64update.pl -o devkitA64update.pl
chmod +x ./devkitA64update.pl
./devkitA64update.pl

You can either use sudo here or chown /opt/devkitpro to be writable by your user before running the script.

Building the examples

Switch examples are still being created; however, there are a growing number of examples available from the switchbrew/switch-examples GitHub repository. These are downloaded by the installer and can be found in $DEVKITPRO/examples/switch

These can be built from the command line.

To start a new homebrew project from the bash shell, simply type the following (replacing ~/projects/myswitchproject with the place you would like your project to be stored, with ~ meaning your HOME directory):

cp -r $DEVKITPRO/examples/switch/templates/application ~/projects/myswitchproject
cd ~/projects/myswitchproject

The standard Makefile will use the folder as the name of the .nro that will be built. You can keep that behaviour or simply change the TARGET := $(notdir $(CURDIR)) line in the Makefile to explicitly name your project.

To compile it, type make in the project directory.