Skip to content

II. b] Computer setup [Mac OS X]

Capz edited this page Apr 13, 2015 · 6 revisions

##Notes## The setup described on this page does not reflect the latest Windows setup, but is functional. In the mean time you can grab a copy of citra that will run your 3dsx files from the citra website

~ is the unix way of writing . When you see ~/Documents, it means the Documents folder in your home folder. When you type ls ~/ and press enter in a console window, you'll see that it will list the folders inside of your home folder.

##Install devkitpro## Install devkitpro and aemstro on your own. devkitpro download comes as a perl-based installer for the mac. You'll need the on named devkitARMupdate.pl Once download, you can run this by opening up a terminal window, typing sudo perl and dragging the .pl file on the terminal window. Then press enter. It will ask you to type your password. Type it and press enter (it will not show that you're typing). This will install the ARM bits of devkitpro into your home folder.

##Prepare project folder## Make sure xcode is updated to the latest version (currently 6.2) by updating it via the app store. then decide where you want your project folder to live. I put my 3ds dev folder in Documents in my home folder so my setup looks like this: ~/Documents/3ds/testproject Inside of there make sure to at least have a source, and data folder. Then create an empty file called main.cpp or main.c, depending on which language you want to use, and save it inside of your newly created source folder.

Then download a copy of the makefile, I grabbed mine from the ctru github here you can click raw and copy paste the text into a file called 'makefile' but make sure it doesn't have a file extension like .txt (right click the file and pick get info. Change the filename and extension box if you need to). Save the makefile next to the source and data folders.

##Create Xcode Project## Next up we will need to make an xcode project. Go ahead and create one. When the choose a template window comes up, go into OS X > Other > External Build System and click Next. Then name your project. the name doesn't matter much so i called mine 'a'. It will ask you where to create the project. navigate to your 3ds project folder (in my case that would be ~/Documents/3ds/testproject) and click create.

Next we will need to add the source code to the project, since our blank one doesn't know how to do anything. In the sidebar, right click the project and choose add files to <yourprojectname>. You will not be able to see your code files in the window that pops up. That's alright. Go up one folder (you can press cmd+up arrow to do this) and click your source folder, leave everything set to the defaults and continue. You will now see your source files in xcode, but you will not be able to compile anything yet.

Click the project in the sidebar and you should see a bunch of settings. Under the Info tab, set Directory to ../ Next, click the Build settings tab, and then click the + just left of the search box. pick Add User-defined setting. Create two of them. Name the first DEVKITPRO, and the second DEVKITARM. to find the values to put there, first open op a terminal window and type echo $DEVKITPRO. You can just copy paste the text it will print. then set DEVKITARM to $(DEVKITPRO)/devkitARM.

Finally, we need to change the paths Xcode uses to write compilation files to. In Xcode Preferences, go to the Locations tab, and click Advanced... on the Derived Data section. Then click Custom, and set it to Relative to Workspace. ##Done!## You should now be able to compile code for the 3ds using ctrulib and xcode!