λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
πŸ’š 개발/μ•ˆλ“œλ‘œμ΄λ“œ

[μ•ˆλ“œλ‘œμ΄λ“œ] Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package [Package name] signatures do not match previously installed version

by devshin.kr 2021. 7. 28.
728x90

λ‚΄ κ²½μš°μ—λŠ” μ–΄λ–€ κ²½μš°μ— λ§Œλ‚œ μ—λŸ¬μΈκ³  ν•˜λ‹ˆ..

예λ₯Ό λ“€μ–΄,
- AVD(Android Virtual Device) A 에 com.devshin93.apktest λΌλŠ” μ΄λ¦„μ˜ νŒ¨ν‚€μ§€κ°€ μ„€μΉ˜λ˜μ–΄ μžˆλ‹€.
- ν•΄λ‹Ή 앱을 build ν•΄μ„œ app-debug.apk λΌλŠ” μ΄λ¦„μ˜ apk file 을 λ§Œλ“€μ—ˆλ‹€.
- AVD A 에 μ„€μΉ˜λœ app-debug.apk κ³Ό λ™μΌν•œ 앱을 AVD B에 μ„€μΉ˜ν•˜κ³ μž ν•œλ‹€.

Android Studio μ—μ„œ terminal 을 μ—΄κ±°λ‚˜ apk file κ²½λ‘œμ—μ„œ cmd 창을 μ—΄μ–΄ apk file을 μ„€μΉ˜ν•œλ‹€.
-r μ˜΅μ…˜ : λ™μΌν•œ μ΄λ¦„μ˜ apk file 이 μ‘΄μž¬ν•  경우 기쑴의 νŒŒμΌμ„ μ§€μš°κ³ , μƒˆλ‘œμš΄ νŒŒμΌμ„ μ„€μΉ˜ν•œλ‹€.
-t μ˜΅μ…˜ : Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] 의 문제λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•œ μ˜΅μ…˜.


> adb install -r -t app-debug.apk


- κΈ°μ‘΄ AVD B 에 λ™μΌν•œ μ΄λ¦„μ˜ νŒ¨ν‚€μ§€(com.devshin93.apktest)κ°€ 이미 μ„€μΉ˜λ˜μ–΄ μžˆλ‹€. κ·ΈλŸ¬λ‚˜ 이전 λ²„μ „μ—μ„œ μ„€μΉ˜ν•œ apk file κ³ΌλŠ” μ„œλͺ…값에 차이가 μžˆλŠ” λ“― 보인닀.

> adb install -t -r app-debug.apk
Performing Streamed Install
adb: failed to install app-debug.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.devshin93.apktest signatures do not match previously installed version; ignoring!]

> adb uninstall com.devshin93.apktest
Success

> adb install -t -r app-debug.apk
Performing Streamed Install
Success

 



+ 덧 1 )

app-build.apk 파일의 생성 μœ„μΉ˜ : [ν”„λ‘œμ νŠΈλͺ…] > app > build > outputs > apk > debug

Android Studio μ—μ„œ build ν•˜λ©΄ μœ„μ˜ κ²½λ‘œμ— μƒμ„±λœλ‹€.

 

+ 덧 2)

app-build.apk 파일의 κ²½λ‘œμ—μ„œ λ°”λ‘œ adb install ν•œ 것은, adb.exe 에 λŒ€ν•œ μ‹œμŠ€ν…œ ν™˜κ²½ λ³€μˆ˜κ°€ μž‘ν˜€ 있기 λ•Œλ¬Έμ΄λ‹€.

μž‘ν˜€ μžˆμ§€ μ•Šλ‹€λ©΄ μ‹œμŠ€ν…œ ν™˜κ²½ λ³€μˆ˜ adb λ“±μœΌλ‘œ 검색해 ν™˜κ²½λ³€μˆ˜λ₯Ό μž‘μ•„ μ£Όλ©΄ λœλ‹€..

λŒ“κΈ€