Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio - /system/bin/sh: Permission Denied

In Android Studio, I want to run my app in my device but I have an error message:

$ adb shell pm install -r "/data/local/tmp/my.model" /system/bin/sh: pm: can't execute: Permission denied

(It launch perfectly in emulator with 0 error.)


I have a Samsung S3 Mini rooted phone. My phone is visible with command adb devices.

I have tried: run Android Studio in administrator, add ADB path on environment variable, remove build folder and rebuild project, but I have always this error.

I guess that's why it does not start my Activity.

$ adb push C:\Users\me\AndroidStudioProjects\Model\app\build\outputs\apk\app-debug.apk /data/local/tmp/my.model

$ adb shell pm install -r "/data/local/tmp/my.model"

/system/bin/sh: pm: can't execute: Permission denied

$ adb shell am start -n "my.model/my.model.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

Error while executing: am start -n "my.model/my.model.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=my.model/.MainActivity }

Error type 3

Error: Activity class {my.model/my.model.MainActivity} does not exist.

Error while Launching activity

Where is the issue? Thank you.

like image 555
P. Frank Avatar asked Oct 18 '25 09:10

P. Frank


1 Answers

I have found why it is not working. Because pm manager is disabled.

To resolve this issue:

  1. Connect your phone to the pc
  2. Open a command line and write adb shell and press enter
  3. Write su and press enter
  4. Now write chmod 777 /system/bin/pm

Enjoy!

like image 162
P. Frank Avatar answered Oct 19 '25 22:10

P. Frank



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!