PRO 30% Free • Stripe ($15) & Razorpay (₹899)

Running Hello World Locally (Xcode & Terminal)

Top Course Staff · 1 min read · Developer tools · PRO · 30% Free Preview Available

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

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 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:\'.

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

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.'

30% Free Preview Reached · Unlock Remaining 70%

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.

✓ Full Access to All 160+ Projects
✓ Instant Blur Removal Everywhere
✓ Production Source Code & Blueprints
✓ All Future Deep Dives Included
Instant Unhindered Activation ·
End of Preview · Unlock Complete Blueprint & Source Code

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.

Production AI Blueprints

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.