如何在不使用 Eclipse 的情况下在 Android 上安装/替换

发布于 2024-08-26 07:54:20 字数 427 浏览 2 评论 0原文

一个朋友给我发了一个更高版本的 .apk 文件。我的设备上已经安装了早期版本。

当我尝试 adb 安装该文件时,我得到以下信息:

$ 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?我没有源代码,所以我无法从 Eclipse 中执行此操作。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

最舍不得你 2024-09-02 07:54:20

卸载时,您必须指定活动的 java 路径。

adb uninstall com.haseman.myapp

我的主要活动位于 src/com/haseman/myapp/LaunchActivity.java

进一步,您可以使用 Commonly 进行替换安装

adb install -r myApplication.apk

,但是,如果不使用相同的密钥对两个 apk 进行签名,则替换构建将会失败手机和您要安装的 apk。如果您看到错误“INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES”,您需要先卸载该应用程序,然后再安装。

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.

顾冷 2024-09-02 07:54:20

您必须使用adb uninstall [packagename],例如adb uninstall org.vimtips.supacount

这是清单中列出的包名称:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.vimtips.supacount"
    android:versionCode="6" android:versionName="0.1.5">

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">
慕巷 2024-09-02 07:54:20

您需要提供 -r 键:

adb install -r myapp-release.apk

这已经讨论过:
为什么 adb 安装失败?

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?

弃爱 2024-09-02 07:54:20

在“设置”->“应用程序”->“管理应用程序”下从手机中删除旧版本,然后安装应该可以进行。

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

财迷小姐 2024-09-02 07:54:20

在设置->应用程序->管理应用程序下从手机中删除旧版本
然后可以通过cmd命令行安装或者上传到网站直接下载到手机上

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文