Running Hello World Locally (Xcode & Terminal)
Running Hello World Locally (Xcode & Terminal)
What is Xcode?
Xcodeis anIDE,IntegratedDevelopmentEnvironment, containing a suite of software development tools developed by Apple for developing software for iOS, watchOS, macOS, iPadOS, and tvOS.
It was first released in 2003 and the latest stable release is version 11.0 and is available via the Mac App Store for download.
Xcode Screenshot
Typically Swift source code files are given the suffix:
- .swift(ex:Hello.swift)
Sometimes it is more convenient to run Swift code in the terminal.
On a Mac, it’s called the Terminal and looks like this:On Windows, it’s called the Command Prompt and looks like this:
Black background with a simple white terminal prompt symbol consisting of a greater-than sign and a dash, resembling '>-'.
Black background with white text showing the Windows command prompt symbol 'C:\'.
Let’s see how we can do it in a macOS terminal:
$ swift --version
Compile:
$ swiftc Hello.swift
swiftcand the source file name.
Execute:
$ ./Hello
./and the executable file name.
Compiling (xkcd)
xkcd: Compiling
'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'
Complete Payment to Unlock Full Guide & Source Code
You are viewing the 30% preview. Join TopCourseAI Pro to unlock the remaining 70% of this article, unblur all code snippets, and gain full access to all 412 technical projects and guides.
Ready to access the complete step-by-step tutorial?
Gain full unhindered access to all 412 technical projects and guides, unblur all source code snippets, and download runnable scripts.
Run a Full-Stack Web Application
Next BlueprintRunning JavaScript in the Browser Console
Related Blueprints & Guides
View all 166 →Android Studio Quick-Start Guide
Android Studio often intimidates beginners, but by learning a few handy shortcuts and getting the lay of the land, we can navigate this powerful development environment with ease.
Developer toolsApache Kafka Tutorial: A Complete Guide for Beginners
Apache Kafkais a well-known distributed event streaming platform designed to efficiently manage real-time data feeds. It was originally developed by LinkedIn in 2011 and later open-sourced. Apache Kafka has gained immens...
Developer toolsBuilding Websites with Wix
Creating a website has never been easier. Previously, making a presentable website meant learning HTML, CSS, andJavaScript. The whole process could take weeks, months, or even years before creating a website that you’re...
Ready to build production-grade AI systems?
Enjoyed this guide? Continue exploring our library of 166+ production blueprints, multi-agent swarms, and autonomous agent systems with 100% unblurred, executable source code.