やること
- Ubuntu Server(16.04.1 LTS)上で、Android API 21(Android 5.0)のemulatorを起動する
前提条件
- Android SDKをインストールしていること
手順
- ABIをインストールする
# ABI名を調べる
$ android list sdk --extended --no-ui --all | grep abi
...
id: 97 or "sys-img-armeabi-v7a-android-21"
id: 100 or "sys-img-armeabi-v7a-google_apis-21"
# ABIをインストールする
$ echo "y" | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-21
- AVDを作る
$ echo n | android create avd --force --name emulator-android-21 --target android-21 -c 50M -s WXGA800 --abi armeabi-v7a
- エミュレータを実行する
$ emulator -avd emulator-android-21 -no-skin -no-audio -no-window
- adbで動作確認する
$ adb devices
List of devices attached
emulator-5554 offline
# device状態になるまで1分ぐらいかかる
$ adb devices
List of devices attached
emulator-5554 device
$ adb shell
root@generic:/ #