create account

【Programming】Android Development vol.4 / AVDの作成と初期設定 by promari

View this thread on: hive.blogpeakd.comecency.com
· @promari ·
$20.59
【Programming】Android Development vol.4 / AVDの作成と初期設定
[前回](https://steemit.com/promari/@promari/programming-android-development-vol-3-ide-android)は[Android Studio](https://ja.wikipedia.org/wiki/Android_Studio)でプロジェクトの作成方法を紹介致しました。今回はAndroid StudioでAndroidアプリを実行するためにAVD(Android Virtual Device)と呼ばれるエミュレータの準備の方法をご紹介致します。

Androidアプリの開発の醍醐味は、AVDと呼ばれるエミュレータで作り出したAndroidのスマホを動かしながら開発できること。Androidのスマホを持っていない場合、エミュレータでいくらでも疑似端末を作り出すことができます。逆にそれだけ端末の数が増えると言う事は、テストの工数も膨大な数に上ります。まさにトレードオフの関係性です。

Android Studioのツールバーから「AVD Manager」ボタンをクリックし、AVD Managerを起動します。「Tools」→「AVD Manager」でも起動可能です。

![hlcrce9ep6.png](https://img.esteem.ws/hlcrce9ep6.png)

Android Virtual Device Managerが起動しますので、「+ Create Virtual Device」をクリックします。

![375i0gc0si.png](https://img.esteem.ws/375i0gc0si.png)

Select Hardware画面で端末の種類を指定します。

![il3bmmca20.png](https://img.esteem.ws/il3bmmca20.png)

必要に応じてエミュレートしたい端末を選択します。ここでは端末の種類は5インチ画面のNexus 5Xを選択します。「Next」をクリックします。

![nmq0fubh4a.png](https://img.esteem.ws/nmq0fubh4a.png)

System Image画面で、システムイメージを選択します。「x86 Images」タブを選択し、Pieを選択します。選択後「Next」をクリックします。API Levelは28です。尚、システムイメージとは、AVDの動作に必要なファイルをまとめたものと捉えてください。

![mo1hl9mjq8.png](https://img.esteem.ws/mo1hl9mjq8.png)

Android Virtual Device画面が表示されます。

![f3lycnhheb.png](https://img.esteem.ws/f3lycnhheb.png)

Enable Devide Frameのチェックを外し、「Finish」をクリックします。尚、「Show Advance Settings」ボタンをクリックするとさらに詳細設定が可能です。

作成したAVD(Nexus 5X API 28)が表示されていましたらAVDの作成は完了です。他の端末もエミュレータとして作成したい場合は同様の手順で作することができます。

![g5q7vlp8qt.png](https://img.esteem.ws/g5q7vlp8qt.png)

次に、AVDを起動して初期設定を行います。「▶」ボタンをクリックします。

![ujc9t5ahxh.png](https://img.esteem.ws/ujc9t5ahxh.png)

するとNexus 5Xエミュレータが立ち上がりました。

![v4ewijxm51.png](https://img.esteem.ws/v4ewijxm51.png)

このようにAndroid Studioでは簡単に端末を作成し、まるで実機を動かしているような動作検証を行うことができます。エミュレータが起動しましたらさきほどのYour Virtual Devices画面が閉じてかまいません。

尚、以下のような画面が表示されましたら「既にエミュレータは起動しています」とうエラーメッセージが表示されてますので、背後にエミュレータが起動しているか確認しましょう。

![gdypux0vs4.png](https://img.esteem.ws/gdypux0vs4.png)

AVD作成直後はOSの言語設定が英語になっていますので、言語設定を行います。画面の「■」ボタンをクリックします。

![bbcl7d3154.png](https://img.esteem.ws/bbcl7d3154.png)

アプリの一覧が表示されますので歯車のアイコンをクリックし設定アプリを起動します。

![273nvp8r5s.png](https://img.esteem.ws/273nvp8r5s.png)

下にスクロールしていき「System」の項目をタップします。

![3pu4urjd8c.png](https://img.esteem.ws/3pu4urjd8c.png)

「Languages & input」をタップします。

![mlmk3cn11s.png](https://img.esteem.ws/mlmk3cn11s.png)

Languagesをクリックし、「Add a language」をタップします。

![6zv91e61s3.png](https://img.esteem.ws/6zv91e61s3.png)

一番下のほうにスクロールすると表示される「日本語」をタップします。

![k8hrdjtxwq.png](https://img.esteem.ws/k8hrdjtxwq.png)

Language preferences画面で日本語(日本)がリストに追加されています。

![3ey43epcjv.png](https://img.esteem.ws/3ey43epcjv.png)

さらに下図のアイコンを上にドラッグアンドドロップします。

![sc6eqsiwf5.png](https://img.esteem.ws/sc6eqsiwf5.png)

すると順序が入れ替わり、端末の言語表記が日本語に切り替わります。

切り替わりましたら左上の「←」アイコンをクリックし、Language & input画面に戻ります。

![c3iq1eoj62.png](https://img.esteem.ws/c3iq1eoj62.png)

次に時刻の修正を行います。システムの設定画面に戻り、「日付と時刻」をクリックします。

![kip5bryzd1.png](https://img.esteem.ws/kip5bryzd1.png)

「タイムゾーンの自動設定」のスイッチをOFFにし、タイムゾーンの選択をタップします。

![0j7cjn1hig.png](https://img.esteem.ws/0j7cjn1hig.png)

「タイムゾーン」をクリックします。

![un6ebdyc51.png](https://img.esteem.ws/un6ebdyc51.png)

東京 日本時間(GMT +09:00)を選択します。

![eazd7oojn0.png](https://img.esteem.ws/eazd7oojn0.png)

時刻が正しい表示になりました。

![t05y45ysdr.png](https://img.esteem.ws/t05y45ysdr.png)

尚、AVGで複数端末のエミュレータを作成する場合は、AVG毎にこの設定を行う必要があります。

以上でAVDの作成と初期設定は終わりです。次はAndroidアプリの起動方法を説明します。

![RGgukq5E6HBS5wrYDNU5euL5kWt6DCj2LPGHAqZSwkfuoLdEdH7eB2otBDVMtGomJ8P4VL5cKfjf69rtMbw4585DE9g1mLB8NZM7JXuMHuBBCgyw74nJcZCj8hD8Z6n.png](https://ipfs.busy.org/ipfs/QmYQChjSnbGyuXBF36PYZ7dh59GzrVQguEZwoE9rnBJkaM)

written by [tamito0201](https://steemit.com/@tamito0201/)

プログラミングとのご縁結びなら[プロマリ](https://www.programming-mariage.jp/)へ。

オンラインプログラミング学習スクールの[プロマリ](https://www.programming-mariage.jp/)は、プログラミングの初学者の皆様を応援しています。プログラミング講師と一緒に面白いアプリを作りませんか。

<a href="https://www.programming-mariage.jp">![btpb5hmlur.png](https://img.esteem.ws/btpb5hmlur.png)</a>

The programming school "[Promari](https://www.programming-mariage.jp/)" will help you learn programming. "[Promari](https://www.programming-mariage.jp/)" is supporting the first scholars of programming. Let's develop an application with our programming instructor.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 620 others
properties (23)
authorpromari
permlinkprogramming-android-development-vol-4-avd
categorypromari
json_metadata{"links":["https://steemit.com/promari/@promari/programming-android-development-vol-3-ide-android","https://ja.wikipedia.org/wiki/Android_Studio","https://ipfs.busy.org/ipfs/QmYQChjSnbGyuXBF36PYZ7dh59GzrVQguEZwoE9rnBJkaM","https://steemit.com/@tamito0201/","https://www.programming-mariage.jp/","https://www.programming-mariage.jp/","https://www.programming-mariage.jp","https://www.programming-mariage.jp/","https://www.programming-mariage.jp/"],"image":["https://img.esteem.ws/hlcrce9ep6.png","https://img.esteem.ws/375i0gc0si.png","https://img.esteem.ws/il3bmmca20.png","https://img.esteem.ws/nmq0fubh4a.png","https://img.esteem.ws/mo1hl9mjq8.png","https://img.esteem.ws/f3lycnhheb.png","https://img.esteem.ws/g5q7vlp8qt.png","https://img.esteem.ws/ujc9t5ahxh.png","https://img.esteem.ws/v4ewijxm51.png","https://img.esteem.ws/gdypux0vs4.png","https://img.esteem.ws/bbcl7d3154.png","https://img.esteem.ws/273nvp8r5s.png","https://img.esteem.ws/3pu4urjd8c.png","https://img.esteem.ws/mlmk3cn11s.png","https://img.esteem.ws/6zv91e61s3.png","https://img.esteem.ws/k8hrdjtxwq.png","https://img.esteem.ws/3ey43epcjv.png","https://img.esteem.ws/sc6eqsiwf5.png","https://img.esteem.ws/c3iq1eoj62.png","https://img.esteem.ws/kip5bryzd1.png","https://img.esteem.ws/0j7cjn1hig.png","https://img.esteem.ws/un6ebdyc51.png","https://img.esteem.ws/eazd7oojn0.png","https://img.esteem.ws/t05y45ysdr.png","https://img.esteem.ws/btpb5hmlur.png"],"tags":["promari","programming","japanese","blog","android"],"app":"esteem/2.0.4-surfer","format":"markdown+html","community":"esteem.app"}
created2019-03-05 12:18:18
last_update2019-03-05 12:18:18
depth0
children2
last_payout2019-03-12 12:18:18
cashout_time1969-12-31 23:59:59
total_payout_value15.642 HBD
curator_payout_value4.943 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,169
author_reputation6,028,120,705,374
root_title"【Programming】Android Development vol.4 / AVDの作成と初期設定"
beneficiaries
0.
accountesteemapp
weight1,000
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,768,238
net_rshares30,358,135,673,527
author_curate_reward""
vote details (684)
@steemitboard ·
Congratulations @promari! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@promari/voted.png?201903051421</td><td>You received more than 6000 upvotes. Your next target is to reach 7000 upvotes.</td></tr>
</table>

<sub>_[Click here to view your Board](https://steemitboard.com/@promari)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/carnival/@steemitboard/carnival-2019"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/rltzHT.png"></a></td><td><a href="https://steemit.com/carnival/@steemitboard/carnival-2019">Carnival Challenge - Collect badge and win 5 STEEM</a></td></tr></table>

###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) and get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-promari-20190305t160032000z
categorypromari
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-03-05 16:00:30
last_update2019-03-05 16:00:30
depth1
children1
last_payout2019-03-12 16:00:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,078
author_reputation38,975,615,169,260
root_title"【Programming】Android Development vol.4 / AVDの作成と初期設定"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,777,263
net_rshares0
@tamito0201 ·
thank you for your suport!!
properties (22)
authortamito0201
permlinkre-steemitboard-steemitboard-notify-promari-20190306t181143861z
categorypromari
json_metadata{"tags":["promari"],"app":"steemit/0.1"}
created2019-03-06 18:11:45
last_update2019-03-06 18:11:45
depth2
children0
last_payout2019-03-13 18:11:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length27
author_reputation107,566,925,670,081
root_title"【Programming】Android Development vol.4 / AVDの作成と初期設定"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,828,900
net_rshares0