LoginSignup
194

More than 5 years have passed since last update.

debug用keystoreについて調べてみた

Posted at

デフォルトの設定だと別のマシンでビルドしたapkはインストールできない。

なので、複数人とかで開発していると既存アプリをアンインストールしてからインストールする場面が結構起こる。

いい加減面倒になったのでちょっと調べてみた。

apkを端末にインストールするには署名が必要

debugビルドだろうがreleaseビルドだろうがkeystoreによる署名は必要らしい。

debugビルドの場合、自動的にkeystoreが作られている。

なので、

  • 複数台のマシンで開発している
  • Jenkinsで自動ビルドもさせている

とかいう状況だとそれぞれで別のkeystoreを使っているから別のマシンからインストールできない。

debug用keystoreの保存場所

MacやLinux

~/.android/debug.keystore

Windows XP

C:\Documents and Settings\<user>\.android\

Windows Vista and Windows 7

C:\Users\<user>\.android\

このdebug.keystoreを…

共有のdebug用keystoreを作って上記の場所におけばいい。

debug用keystoreの条件は

に書いてある。

key value
Keystore name debug.keystore
Keystore password android
Key alias androiddebugkey
Key password android
CN CN=Android Debug,O=Android,C=US

ターミナルで

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -validity 10000 -dname "CN=Android Debug,O=Android,C=US"

とやれば生成できる。

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
194