2
2

More than 5 years have passed since last update.

Ubuntu18.04LTS にSwift導入

Last updated at Posted at 2018-09-10

業務でiOS開発をすることになったので、自宅でもSwiftを触れるように最低限の環境を整える。

必要なパッケージのインストール

update&install
$ sudo apt update
$ sudo apt install clang libicu-dev libcurl4-openssl-dev libssl-dev libblocksruntime-dev

Swiftのダウンロード -> ここから

解凍

$ tar xzvf swift-DEVELOPMENT-SNAPSHOT-2018-09-08-a-ubuntu18.04.tar.gz
$ export PATH=$PATH:(Swiftをダウンロードしたパス)/swift-DEVELOPMENT-SNAPSHOT-2018-09-08/usr/bin

作業ディレクトリを作って移動

$ mkdir swiftWorkspace
$ cd swiftWorkspace

パッケージ初期化

$ swift package init --type executable

ソースファイル

Source/swiftWorkspace/main.swift
print("Hello, world!")

ビルド
swift build

実行

$ .build/x86_64-unknown-linux/debug/swiftWorkspace
Hello, world!
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2