mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 06:54:03 +02:00
89 lines
3.8 KiB
Plaintext
89 lines
3.8 KiB
Plaintext
br
|
|
.page-title
|
|
h2 リモート・シェル参照
|
|
|
|
.row
|
|
.col-md-6
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading ファイル一覧
|
|
.widget-content.padded
|
|
pre ls -la
|
|
p シェル起動直後はディレクトリはルートです。
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading パッケージ名列挙
|
|
.widget-content.padded
|
|
pre pm list packages
|
|
p インストールされてるアプリのパッケージ名が列挙される。
|
|
p パッケージ名を一部しか覚えていないときに <code>pm list packages [パッケージ名]</code> のようにフィルタリングすることができる。
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading パッケージ削除
|
|
.widget-content.padded
|
|
pre pm uninstall [パッケージ名]
|
|
p その他のパッケージ・マネジャーのコマンドは <a href="http://developer.android.com/tools/help/adb.html#pm" target="_blank">ADB pm | Android Developers</a> を参照。
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading ファイルの中身
|
|
.widget-content.padded
|
|
pre cat /sdcard/hoge.txt
|
|
p 読み込み権限のあるファイルの中身を簡単に確認するときに使う。
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading その他のシェルコマンド
|
|
.widget-content.padded
|
|
p 実行可能なシェルコマンドの一覧を取得するのに、下記のコマンドを実行する。
|
|
pre ls /system/bin
|
|
|
|
a(ng-href='https://github.com/jackpal/Android-Terminal-Emulator/wiki/Android-Shell-Command-Reference', target='_blank', role='button').btn.btn-primary
|
|
i.fa.fa-book
|
|
| もっと詳しいリファレンス
|
|
|
|
|
|
.col-md-6
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading アプリの起動
|
|
.widget-content.padded
|
|
strong Activityの起動 (ACTION_VIEW + URL)
|
|
pre am start -a android.intent.action.VIEW -d http://google.com
|
|
strong Activityの起動(クラス名を指定)
|
|
pre am start -n com.hoge.app/.FugaActivity
|
|
strong サービスの起動
|
|
pre am startservice ... # Intentの指定方法はActivityと同じ
|
|
strong ブロードキャストの送信
|
|
pre am broadcast ... # Intentの指定方法はActivityと同じ
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading キーイベント送信
|
|
.widget-content.padded
|
|
pre input keyevent 3 # HOMEキー
|
|
p 数値でキーコードを指定する。
|
|
p キーコードは <a href="http://developer.android.com/reference/android/view/KeyEvent.html" target="_blank">KeyEvent | Android Developers</a> を参照。
|
|
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading 画面録画 (KitKat4.4より)
|
|
.widget-content.padded
|
|
p 最大3分操作情報を録画できる。
|
|
pre screenrecord [options] <filename>
|
|
p [options]は <a href="http://developer.android.com/tools/help/adb.html#screenrecord" target="_blank">ADB screenrecord | Android Developers</a> を参照。
|
|
p filenameには端末側のパスを指定する。
|
|
pre screenrecord /sdcard/movie/sample.mp4
|
|
.row.padded
|
|
.col-md-12
|
|
.widget-container.fluid-height
|
|
.heading メモリ専有状況
|
|
.widget-content.padded
|
|
pre dumpsys procstats [パッケージ名]
|
|
p 例: <code>dumpsys procstats com.android.chrome</code>
|