How to install/replace on Android without using Ec

2019-04-03 05:53发布

A buddy sent me a later version of an .apk file. I already had the earlier version on my device.

When I tried to adb install the file, I got this:

$ adb install ../FlashLite.apk 
320 KB/s (18311 bytes in 0.055s)
    pkg: /data/local/tmp/FlashLite.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]

$ adb uninstall FlashLite.apk
Failure

$ adb uninstall /data/local/tmp/FlashLite.apk
Failure

How do you install/replace from the cmd line? I don't have the source, so I cannot do it from Eclipse.

5条回答
The star\"
2楼-- · 2019-04-03 06:32

delete the old version from your phone under settings->applications->manage applications Then you can install by cmd line or upload it to a website and directly download it to the phone

查看更多
Explosion°爆炸
3楼-- · 2019-04-03 06:40

When you uninstall you have to specify the java path to the activity.

adb uninstall com.haseman.myapp

where my main activity is at src/com/haseman/myapp/LaunchActivity.java

further, you can do a replace install with

adb install -r myApplication.apk

Commonly, however, replacing a build will fail if the same key isn't used to sign both the apk on the phone and the apk you want to install. If you see an error "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES" you need to uinstall the app first and then install it.

查看更多
放荡不羁爱自由
4楼-- · 2019-04-03 06:43

You need to supply the -r key:

adb install -r myapp-release.apk

This has been already discussed: Why does adb install <same-packagename-always-release> fail?

查看更多
等我变得足够好
5楼-- · 2019-04-03 06:45

delete the old version from your phone under settings->applications->manage applications and then the install should work.

查看更多
男人必须洒脱
6楼-- · 2019-04-03 06:55

You have to use adb uninstall [packagename], for instance, adb uninstall org.vimtips.supacount.

This the package name listed in your manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.vimtips.supacount"
    android:versionCode="6" android:versionName="0.1.5">
查看更多
登录 后发表回答