Android Studio PM安装中止 [英] Android Studio pm install aborted

查看:197
本文介绍了Android Studio PM安装中止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从android studio在我的GS5上运行应用程序,然后我得到了这个消息:

Im trying to run an application on my GS5 from android studio and Im getting this:

Waiting for device.
Target device: samsung-sm_g900v-f3af9744
Uploading file
local path: D:\Android\Projects\TestProject\build\outputs\apk\TestProject-debug.apk
remote path: /data/local/tmp/com.brian.testproject
Installing com.datascan.mobilescripts
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.brian.testproject"
Aborted

似乎正在将文件复制到设备,我可以在/ data / local / tmp目录中看到它。它只是在 pm install阶段失败。

It seems to be copying the file to the device, I can see it in the /data/local/tmp directory. Its just failing at the "pm install" stage.

在电话上,我打开USB调试并授权了计算机。这是运行ADB设备时得到的信息:

On the phone I turned on USB Debugging and authorized the computer. Here is what I get when I run ADB devices:

D:\Android\sdk\platform-tools>adb devices
List of devices attached
f3af9744        device

这似乎是正确的。我不太确定问题是什么。 Google在该问题上的搜索没有给我任何相关结果。

So that seems to be correct. Im not really sure what the problem is. Google search on the problem didnt give me any relevant results.

有人知道如何获得除堕胎之外的更多信息吗?感谢您的任何帮助,谢谢!

Does anyone know how to get more information beyond "Aborted"? Any help is appreciated, Thanks!

编辑:

如@所建议亚历克斯我运行了 adb logcat -d -s PackageManager:*,其结果是:

As suggested by @AlexP. I ran "adb logcat -d -s PackageManager:*", this was the result:

D:\Android\sdk\platform-tools>adb logcat -d -s PackageManager:*
--------- beginning of main
--------- beginning of system

没有太多帮助,但是我确实决定在运行pm安装时观看logcat,我发现了错误条目:

Not much help, but I did decide to watch the logcat as the pm install was being run and I found this error entry:

Tag=appproc  |  Text= ERROR: Could not find class 'com.android.commands.pm.Pm'
Tag=art      |  Text= art.runtime/thread.cc:1105] No pending exeption expected: java.lang.ClassNotFoundException: Didn't find class "com.android.commands.pm.Pm" on path: DexPathList[[zip file "/system/framework/pm.jar"],nativeLibraryDirectories=]/vendor/lib, /system/lib]]

之后出现了一系列的错误提示。

Followed by a whole slew of art error entries.

所以我的手机好像丢失了一些东西?

So it seems as though my phone is missing something, maybe?

推荐答案

Android Studio在Galaxy S5上失败的原因是因为该手机的根版本上的adbd(手机而非您PC上的ADB服务)无法以root身份运行,这是一种安全措施。您可以通过手动尝试执行Android Studio apk并在设备上执行命令并发现它们执行失败,然后使用 su ...重试它们并查看该应用程序已在设备上安装并启动来进行验证。有以下三种方法可以解决此问题并取消阻止Android Studio:

The reason that Android Studio fails on Galaxy S5 is because the adbd (ADB service on the phone not your PC), on rooted version of this phone does not run as root, which is a security measure. You can verify this by manually trying to execute the Android Studio apk and execute commands on the device and finding out that they are failing to execute, but retrying them using "su ..." and see that the app installs and starts on the device. There are three options to resolve this and unblock Android Studio:

选项:


  1. 刷新包含修改的ROM-从我的理解来看,您不希望这样做,所以希望保留在库存图像上;这也是一个很好的安全措施,不要让adbd始终以root身份运行。较早的rom也属于此类,但随后您缺少Stock Rom更新和安全补丁。

  2. 创建自定义boot.img并将其刷新到手机中-这基本上是自定义内核,并且由于与上述选项1相似的原因而不再需要。

  3. 在进行应用程序开发时,使用root特权在设备上重新启动adbd-首选且可通过各种方法轻松实现,包括:

首选解决方案:

a。通过终止电话上的服务并使用终端应用程序,以root特权(不安全模式)重新启动adbd,然后使用 su重新启动它。完成应用程序开发后,重新启动手机,adbd将恢复为安全模式,以恢复安全措施。

a. Restart adbd with root privileges (insecure mode) by killing the service on the phone and using a terminal app or so to restart it using "su". After you are done with your app development, restart your phone and adbd will be back in secure mode, restoring the security measures.

b。使用Chainfire的ADB不安全应用程序,该应用程序在XDA上免费提供(以下下载/链接),或在Google Play上付费以支持他的工作。您可以在应用程序中切换模式。在应用程序中,您还可以选择在重新启动时自动重新启用不安全模式。

b. Use Chainfire's ADB insecure app, which is free on XDA (download/link below) or pay for it on Google Play to support his work. You can toggle the mode in the app. In the app, you also have an option to auto re-enable the insecure mode on reboots.

参考:

https://android.stackexchange.com/questions/5884/is-there-a-way-for-me-to-run-adb-shell-as-root-without -typing-in-su

http://forum.xda-developers.com/showthread.php?t=1687590 (包括免费下载链接)

http://forum.xda-developers.com/showthread.php?t=1687590 (includes free download link)

https://play.google.com/store/apps /details?id=eu.chainfire.adbd (用于支持Chainfire的工作)

https://play.google.com/store/apps/details?id=eu.chainfire.adbd (for supporting Chainfire's work)

这篇关于Android Studio PM安装中止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆