0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

自分がよく使う adb コマンド一覧など

0
Last updated at Posted at 2026-03-09

自分が実行したことのないコマンドは記載しません。
また、逐次追記していきます。

Mac前提(./adb or PATHが通っていれば adb)です。
Windows など Mac 以外の環境で実行する場合は気をつけてください。


adbの場所

私は面倒くさいのでパスを通さないことが多いです。

~/Library/Android/sdk/platform-tools/adb

emulatorの場所

~/Library/Android/sdk/emulator/emulator

※ 以下の ./adb / ./emulator は、それぞれのディレクトリで実行する前提

接続デバイス一覧

./adb devices

テキスト入力

./adb shell input text hello

デバイスを指定して実行する場合

./adb -s <device id> shell input text hello

エミュレーター一覧出力

$ ./emulator -list-avds
Pixel_8_Pro_API_35
Pixel_Tablet
...

エミューレーター実行

./emulator -avd Pixel_8_Pro_API_35
止めるときは ctrl + c

adbサーバーの再起動

./adb kill-server
./adb start-server

アプリのインストール

./adb install app.apk

上書きインストール

./adb install -r app.apk

アプリのアンインストール

./adb uninstall com.example.app
com.example.app は application id

付録

AAB から ユニバーサルAPK を作成する

ユニバーサルAPKは全環境全部入りAPKです。
Google Play Console からもダウンロードができますが
ここでは詳しい手順は説明しません。

1. ユニバーサルAPKを作成する

デバッグ署名

java -jar bundletool.jar build-apks \
  --bundle=app.aab \
  --output=app.apks \
  --mode=universal
※ app.aabの署名の可否にかかわらずapp.apksはdebug署名される

署名付きで作成

java -jar bundletool.jar build-apks \
  --bundle=app.aab \
  --output=app.apks \
  --mode=universal \
  --ks=my.keystore \
  --ks-key-alias=myalias \
  --ks-pass=pass:password \
  --key-pass=pass:password

2. unzipしてAPK取り出し

unzip app.apks -d output

ユニバーサルAPK

output/universal.apk

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?