LoginSignup
5
2

More than 3 years have passed since last update.

10分でAndroidスマホにGo開発環境をたてる

Last updated at Posted at 2019-05-26

Termuxのインストール

TermuxはAndroid用のターミナルエミュレータです。
Playストアにて「termux」を検索し、Termuxをインストールします。

Termuxを起動し以下のコマンドを実行します。

$ termux-setup-storage
$ apt update
$ apt upgrade

Go言語とgitのインストール

Termuxから、Goとgitをインストール。

$ apt install -y golang git

動作確認

Termuxにhello-worldアプリをgitクローンし、実行します。

$ git clone https://github.com/quzquz/go-http-hello-world.git
$ cd go-http-hello-world
$ go run main.go

少し待つと「Listening on port 8080」と表示されます。
Androidの適当なwebブラウザを起動しurlに以下を入力します。
http://localhost:8080

ブラウザに「Hello world!」と表示されます。

停止するには、Termux上でctrl+dを入力します。

5
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
5
2