無法安裝同一個名稱的程式

2009.03.25 08:11PM
無法安裝同一個名稱的程式

事情是這樣子的

最近在開發程式時,忘記先解安裝舊的同名應用程式 from eclips,再來安裝新的同名程式 from apk

直接安裝新的時,就會發現Install Fail。

查了一下原因,原來是Application的Install,類似Windows程式需要Register一樣,Android 的 Applicatoin需要Signing。

 

I can't install ApiDemos apps in my IDE because of a signing error

The Android system requires that all applications be signed, as described in Signing Your Applications. The ApiDemos applications included with the SDK are preinstalled on the emulator and for that reason have been compiled and signed with a private key.

If you want to modify or run one of the ApiDemos apps from Eclipse/ADT or other IDE, you can do so so only after you uninstall the

preinstalled

[2008-08-13 15:14:15 - ApiDemos] Re-installation failed due to different application signatures.
[2008-08-13 15:14:15 - ApiDemos] You must perform a full uninstall of the application. WARNING: ...This will remove the application data!
[2008-08-13 15:14:15 - ApiDemos] Please execute 'adb uninstall com.android.samples' in a shell.

The error occurs because, in this case, you are attempting to install another copy of ApiDemos onto the emulator, a copy that is signed with a different certificate (the Android IDE tools will have signed the app with a debug certificate, where the existing version was already signed with a private certificate). The system does not allow this type of reinstallation.

To resolve the issue, you need to fully uninstall the preinstalled and then reinstall it using the adb tool. Here's how to do that:

  1. In a terminal, change to the tools directory of the SDK.

  2. If no emulator instance is running, start an emulator using using the command emulator &.

  3. Uninstall the preinstalled app using the command adb uninstall com.android.samples.

  4. Reinstall the app using the command adb install <path to the ApiDemos.apk>. If you are working in Eclipse/ADT, you can just compile and run the app in the normal way.

Note that if multiple emulator instances are running, you need to direct your uninstall/install commands to the emulator instance that you are targeting. To do that you can add the -s <serialNumber> to the command, for example:

adb -s emulator-5556 install

不過雖然知道了這件事

我因為手賤,把應用程式直接kill掉,然後再直接刪除目錄,所以就沒法用 adb uninstall的方式...

所以問題還是沒解決,有什麼其他的解法呢?

 

3 則回應

  •  從手機上移除應用程式

    在模拟器或手機上本身有卸载工具

    settings->Applications->Manager Applications->API Demos->Uninstall->finish

    執行

    2010-02-04
  • 是實體的手機嗎?

    如果是實體的手機,大絕就是洗掉回到出廠設定

    I Love Android http://wiki.cheyingwu.tw/Android

     

    2009-03-27
    • plokijuh wrote:

      是實體的手機嗎?

      如果是實體的手機,大絕就是洗掉回到出廠設定

       

      是實體的手機 XD

      1. 後來自行尋找到答案
      2. 在eclips build一次source,然後讓app再從eclips自動安裝到g1
      3. 拔掉g1跟usb的連接
      4. 這時可以找到app的移除紐了,趕緊移除掉
      5. 裝同一個name的app,from apk檔案
      6. 正常!

       

       

      @ Android - 中文TW社群支援站

       

      2009-03-28