4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SharedPreference は消さずにアプリだけアンインストールする方法

Posted at

ADB のコマンドで、

adb shell pm uninstall -k <package name>

を実行します。

ヘルプには、

pm uninstall: removes a package from the system.
Options:
-k: keep the data and cache directories around after package removal.

と書いてあります。

「おっしゃ、別なPCでビルドしてインストールしたアプリの設定情報消したくなかったんだよね〜」

と思いきや、署名(debug.keystore とか)が異なる環境でビルドされたアプリの場合、上記のコマンドでアンインストールしても、新しいアプリをインストールする時に、

[2013-04-10 17:58:29 - MyApp] Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE
[2013-04-10 17:58:29 - MyApp] Please check logcat output for more details.
[2013-04-10 17:58:29 - MyApp] Launch canceled!

というエラーが出てアンインストールできません。
結局、

adb shell pm uninstall <package name>

で、アンインストールすることになります。

という本末転倒なお話でした。

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?