Skip to content

Instantly share code, notes, and snippets.

@gosyujin
Last active December 20, 2015 12:19
Show Gist options
  • Save gosyujin/6129986 to your computer and use it in GitHub Desktop.
Save gosyujin/6129986 to your computer and use it in GitHub Desktop.
android-adb

走り書き

起動中のアプリのActivityのスタックを知りたい、メモリを知りたい

adbコマンドを使ってある程度調べられそう

adbはAndroid SDKに含まれるツール(Android Debug Bridge)

Android SDKをインストールしたディレクトリの platform-tools 下にある

adb shell で端末のシェルを起動できる。

接続している端末(起動しているエミュレータ)が1台だけなら自動的につないでくれ る。それ以外なら指定する必要あり。

dumpsysコマンド

dumpsys activity activities で Activity の一覧を見ることができる。

activity だけだと他の情報も出てきてしまうので activities でしぼる。

activities 以外だと procesess とかを指定できる。

dumpsys meminfo で起動中のアプリのメモリを調べる事ができる。

特定のアプリのみ調べる場合は dumpsys meminfo PIDまたはパッケージ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment