'Permission Denied' error while installing apk on device

旧城冷巷雨未停 提交于 2019-12-22 04:29:10

问题


When I use Eclipse to deploy an Opengl ES app to device I get following error

[2011-09-19 15:56:40 - SimpleCube] Failed to install SimpleCube.apk on device 'S5830bfcc8426': Permission denied
[2011-09-19 15:56:40 - SimpleCube] com.android.ddmlib.SyncException: Permission denied
[2011-09-19 15:56:40 - SimpleCube] Launch canceled!

It used to work before. But now I flashed my phone with GingerReal 1.2 ROM and when I try to run the app it gives out this error.
I have enabled 'Unknown Sources' and 'USB Debugging'.

EDIT: Dunno whether this helps.. but i tried using "adb install" directly. But still it failed. I got the following:

sinu@ubuntu:~$ ./adb install /home/sinu/programs/SimpleCube.apk
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
failed to copy '/home/sinu/programs/SimpleCube.apk' to '/data/local/tmp/SimpleCube.apk': Permission denied

回答1:


I had the same problem so i checked this folder /data/local/tmp and discovered it didn't have r/w permissions for everyone:
drwxrwx--x shell shell 1970-01-02 03:21 tmp
A simple 'chmod 777 tmp' fixed it, so now i can freely debug from eclipse.
I'm not sure if this relevant for other people because i was working on a beta release of some vendor's device.




回答2:


Okay solved it.. it apparently occurs because adb daemon can't run as root- http://groups.google.com/group/android-platform/browse_thread/thread/a8d9f57ecb631689 So change

ro.secure=1 

to:

ro.secure=0 

in /default.prop
It solved this problem. But i got several others following it and I suppose it has got something to do with the ROM



来源:https://stackoverflow.com/questions/7469785/permission-denied-error-while-installing-apk-on-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!