Level1エンジニア 麻呂の徒然草

平安貴族でもわかる技術のお話

Androidの開発環境を構築してみる for Mac

まずAndroid開発するための手段は基本的には2種類あって、
EclipseにADT(Android Development Tools)を導入する。
Android Studioをインストールする。
のどちらかになる。

Android Studioは動作が重いなどの理由から開発の現場ではまだまだADTがメジャーだったりするみたいだが、公式ページからADTのBundle版が消えていたりGoogle的にはこれからはAndroid Studioにシフトしていく流れっぽいのでこの機会に自分もAndroid Studioに移行してみようと思う。
なので今回は②について説明する。

Android Studioのインストール

①ここからAndroid Studioをダウンロードしてインストール
Android Studio と SDK ツールをダウンロードする | Android Studio

②起動・設定 f:id:genbassnohito-maroro0208:20160911222411p:plain 前のバージョンの設定を引き継ぐかみたいなことを聞かれるので
「I do not have a previous version of Android Studio or I do not want to import my Settings」をクリック

f:id:genbassnohito-maroro0208:20160911222637p:plain Next

f:id:genbassnohito-maroro0208:20160911222709p:plain 今回はとりあえずStandardを選択してNext Finish

動作確認

f:id:genbassnohito-maroro0208:20160911222721p:plain 「Start a new Android Studio project」をクリック

f:id:genbassnohito-maroro0208:20160911222838p:plain 名前とドメインと保存先を指定してNext

f:id:genbassnohito-maroro0208:20160911222935p:plain Phone&Tabletにチェック、API 15: Android 4.0.3(IceCreamSandwich)を確認してNext

f:id:genbassnohito-maroro0208:20160911222947p:plain Empty ActivityでNext

f:id:genbassnohito-maroro0208:20160911223001p:plain なんでもいいのですがとりあえずデフォルトで

f:id:genbassnohito-maroro0208:20160911223046p:plain 読み込まれたら多分Tipsが出てきますが、closeで閉じて、左の1:Projectをクリック。

f:id:genbassnohito-maroro0208:20160911231502p:plain app > java > com.example.(自分の名前).myapplication > MainActivityを選択。

f:id:genbassnohito-maroro0208:20160911223055p:plain 仮想デバイスを作成します。 Create New Emulatorをクリック。

f:id:genbassnohito-maroro0208:20160911225426p:plain 今回はNexus 5Xを選択。Next

f:id:genbassnohito-maroro0208:20160911223155p:plain するとAndroid Studioが推奨するAPIが選択されているのでインストール。 今回はAPI Level23、ABI x86のMarshmallowをダウンロード。

f:id:genbassnohito-maroro0208:20160911230352p:plain ダウンロードが終わったら、さっきのMarshmallowが青くなって選択されているのを確認してNext

f:id:genbassnohito-maroro0208:20160911230537p:plain 大きさとか変えられるみたいだが、デフォルトでFinish

f:id:genbassnohito-maroro0208:20160911230801p:plain Nexus 5X API 23 を選択してOK

f:id:genbassnohito-maroro0208:20160911231243p:plain

上手くいっていれば、こんな感じでHelloWorldと出てくるはずです