如何在不使用 Eclipse 的情况下在 Android 上安装/替换
一个朋友给我发了一个更高版本的 .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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
卸载时,您必须指定活动的 java 路径。
我的主要活动位于 src/com/haseman/myapp/LaunchActivity.java
进一步,您可以使用 Commonly 进行替换安装
,但是,如果不使用相同的密钥对两个 apk 进行签名,则替换构建将会失败手机和您要安装的 apk。如果您看到错误“INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES”,您需要先卸载该应用程序,然后再安装。
When you uninstall you have to specify the java path to the activity.
where my main activity is at src/com/haseman/myapp/LaunchActivity.java
further, you can do a replace install with
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.
您必须使用
adb uninstall [packagename]
,例如adb uninstall org.vimtips.supacount
。这是清单中列出的包名称:
You have to use
adb uninstall [packagename]
, for instance,adb uninstall org.vimtips.supacount
.This the package name listed in your manifest:
您需要提供 -r 键:
这已经讨论过:失败?
为什么 adb 安装
You need to supply the -r key:
This has been already discussed:
Why does adb install <same-packagename-always-release> fail?
在“设置”->“应用程序”->“管理应用程序”下从手机中删除旧版本,然后安装应该可以进行。
delete the old version from your phone under settings->applications->manage applications and then the install should work.
在设置->应用程序->管理应用程序下从手机中删除旧版本
然后可以通过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