Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Samsung adb run-as problem (Operation not permitted) #92

@jknoxville

Description

@jknoxville

There's an issue on some samsung builds where inside adb shell, the run-as command doesn't work.
You get an 'Operation not permitted' error.

You can test if your device works by running the following inside a terminal, when the device is connected by usb.
adb shell
run-as com.my.app.package

Where com.my.app.package is replaced with the package name of your app. Note that the app has to be marked "debuggable" in the manifest for this to be allowed.

https://stackoverflow.com/questions/37413667/run-as-could-not-set-capabilities-operation-not-permitted

I've seen this happen on two samsung S8 devices on Android 7. However on Android 8, from anecdotal results it appears to work.

It would be good to:
a) Find out whether upgrading to android 8 consistently fixes the issue.
b) Find a workaround. We use this feature to securely write the sonar CA certificate to the app's internal data directory over usb. I'm not aware of any other way to do this at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions