How to open “adb shell” in context of application being debugged (on non-rooted device)?

后端 未结 3 899
北海茫月
北海茫月 2021-01-03 15:36

When I just run adb shell, I get shell running from uid=2000(shell) gid=2000(shell), without ptrace access to my application.

How to open a

3条回答
  •  孤独总比滥情好
    2021-01-03 16:07

    From this answer:

    • The packages.xml file present in /data/system
    • The packages.list file present in /data/system

    Contain the list of applications installed and their corresponding UID's.

    Another answer in the same question suggests:

    adb shell dumpsys package com.example.myapp | grep userId=
    

    You can then open your shell as normal and run:

    $ su 
    

    You should then have the same access and privileges as the app that uses that UID.

提交回复
热议问题