無差別に使用しないでくださいkill -9
。非常に悪い習慣です。
正しいコマンドは
$ adb emu kill
または、最近の変更までは正しいコマンドだったと言ったほうがよいでしょう。adb
誰かが認証を追加するのを忘れたようです。
最新(2016年6月現在)の最新adb
バージョンは
$ adb version
Android Debug Bridge version 1.0.36
Revision 0a04cdc4a62f-android
そして試してみると
$ adb emu kill
何も起こりません、これが理由です
...
connect(3, {sa_family=AF_INET, sin_port=htons(5554),
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
write(3, "kill\nquit\n", 10) = 10
read(3, "\377\373\1", 8192) = 3
read(3, "\377\373\3\377\373\0\377\375\0", 8192) = 9
read(3, "Android Console: Authentication required\r\nAndroid Console: type 'auth <auth_token>' to authenticate\r\nAndroid Console: you can find your <auth_token> in \r\n'/home/diego/.emulator_console_auth_token'\r\nOK\r\n", 8192) = 202
read(3, "k\33[K", 8192) = 4
read(3, "\33[Dki\33[K", 8192) = 8
read(3, "\33[D\33[Dkil\33[K\33[D\33[D\33[Dkill\33[K", 8192) = 28
read(3, "\r\nKO: unknown command, try 'help'\r\n", 8192) = 35
read(3, "q\33[K\33[Dqu\33[K", 8192) = 12
read(3, "\33[D\33[Dqui\33[K\33[D\33[D\33[Dquit\33[K", 8192) = 28
read(3, "\r\n", 8192) = 2
read(3, "", 8192) = 0
close(3) = 0
exit_group(0) = ?
+++ exited with 0 +++
次に、別の解決策が必要です。
前のコマンドが機能しない場合 (一部のユーザーが Windows で報告したように)、試すことができます (次のコマンドで 5554 はエミュレータが使用するポートです)。
トークン ファイル ( ~/.emulator_console_auth_token
) の内容をクリップボードにコピーして、Telnet セッション中に貼り付けることができるようにします。
$ telnet localhost 5554
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Android Console: Authentication required
Android Console: type 'auth <auth_token>' to authenticate
Android Console: you can find your <auth_token> in
'/home/user/.emulator_console_auth_token'
OK
auth <YOUR_TOKEN_HERE>
Android Console: type 'help' for a list of commands
OK
Android console command help:
help|h|? print a list of commands
crash crash the emulator instance
kill kill the emulator instance
quit|exit quit control session
redir manage port redirections
power power related commands
event simulate hardware events
avd control virtual device execution
finger manage emulator fingerprint
geo Geo-location commands
sms SMS related commands
cdma CDMA related commands
gsm GSM related commands
rotate rotate the screen by 90 degrees
try 'help <command>' for command-specific help
OK
kill
次に、コマンドプロンプトで入力するだけです
kill
OK: killing emulator, bye bye
Connection closed by foreign host.
エミュレータが終了します。
しかし、待ってください。もっと良い方法があるはずです。そして実際にあります!
この要点は、毎回認証トークンをカットアンドパスする代わりに、expectを使用して自動化されたソリューションを提供します。
お役に立てば幸いです。