9

I've just started using Android Studio. I've got an HTC one (m7) running rooted Lollipop. I'm trying to run the test app I've created on this physical device. When I go to run it I get "Adb Transfer Protocol Error: Permission Denied". The device shows up in android studio when I go to run the app, and I have verified root access. Any help is appreciated.

EDIT: I just tried to install a .apk file using the command adb install and I'm getting permission denied. This is a rooted phone. However, I've always had root access on this phone, and before upgrading to android 5.0 Lollipop I could run this command and instantly install a .apk without having to do adb shell. If this is the problem, how do I tell android studio to run adb shell before trying to install and run the app?

REAL O G
  • 693
  • 7
  • 23

2 Answers2

18

Well, I solved it. The folder \data\local\tmp did not have full read write execute permissions. Once I did a quick chmod 777 on it Android Studio allowed the installation and run of the app. You can also do this procedure through a file explorer that has root capabilities.

REAL O G
  • 693
  • 7
  • 23
  • Can you explain how to do it? I'm having the same issue. Are you on linux? Where's the remote path? – Supa Dec 09 '14 at 02:24
  • The quick and easy way is to get a file manager on the device that can gain root access, find the \data\local\tmp folder and edit it's properties to give full read write and execute permissions. – REAL O G Dec 09 '14 at 02:39
  • The problem is I don't even have that path. I have a tmp/data folder but there's not much in it. – Supa Dec 09 '14 at 03:00
  • What kind of device is it? Do you have root access? – REAL O G Dec 09 '14 at 03:22
  • it's an htc one as well. do. – Supa Dec 09 '14 at 07:13
  • But yeah.. once I figure out how to give access to that folder... http://i.imgur.com/rFFrqzP.png – Supa Dec 09 '14 at 18:37
  • Try to use adb from cmd prompt. Make sure you have root access. Cd into /data/local and then type chmod 777 tmp – REAL O G Dec 09 '14 at 19:13
  • 3
    G D, you the man! Just to supplement Skye's answer with yours as well: 1) Open terminal on desktop 2) adb shell 3) su 4) cd /data/local 5) chmod 777 tmp – Mark Lapasa Apr 29 '15 at 19:25
6

You can also do this in Terminal Emulator. Download the app from this link: https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=pl Of course you need to have root.

Open it and enter:

su

cd /data/local

chmod 777 tmp

And try run app now

Skye
  • 1,469
  • 3
  • 14
  • 25