Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • You should fix your variable names to be consistent. Commented Oct 25, 2022 at 8:09
  • 1
    You are right, thanks for pointing this out.
    – bmaciejm
    Commented Oct 25, 2022 at 8:10
  • i got this error sir .. Cannot run program "adb": error=13, Permission denied
    – Jhon Doe
    Commented Oct 25, 2022 at 9:38
  • 1
    Actually it looks like as long as the approach mentioned above will work for executing shell commands in general it is not that simple when it comes to adb commands specifically. For more detailed explanation it was already answered here stackoverflow.com/a/52682468/4153947 and here stackoverflow.com/questions/44871391/… Thus I would propose that you can mark your question as duplicate and read the above threads.
    – bmaciejm
    Commented Oct 25, 2022 at 14:12
  • 1
    @JhonDoe I think you will need to root your phone in order to execute adb from an app. Commented Oct 26, 2022 at 17:41