20

I explicitly set my app debuggable to true in the AndroidManifest.xml and deployed it to my device through eclipse, but I still get the

run-as: Package 'com.mypackage' is not debuggable

when I run the command:

adb -d shell 'run-as com.mypackage cat /data/data/com.mypackage/databases/mydb.db > /sdcard/mydb.db'

What do I need to change to be able to debug my application?

3
  • 1
    Did you build / export a release version? stackoverflow.com/questions/4580595/…
    – zapl
    Nov 14, 2012 at 19:35
  • 1
    no I am not making a release build.
    – Green Ho
    Nov 14, 2012 at 19:49
  • I am having a similar problem but more curious about other aspect of the issue. I have my device logs in data/data/package-name which I need for investigation. I can access this file on device-1 and cannot on device-2 even though I am using the same apk for both. In the device file explorer it shows run-as package not debuggable for device-2. It makes me think we can access this area by somehow changing device settings. Any idea?
    – Fatih
    Apr 23, 2020 at 13:09

4 Answers 4

6

Are you using release apk or debug apk for testing? If you use release version of the apk you wouldn't get the access. I would suggest you to build the application directly from Android Studio (remember that your Build Variant must be debug in Android Studio) and try using the command run-as "your.package.name"

3

If you are sure you built with and AndroidManifest.xml with debuggable=true, then uninstalling the package may work (caution: this will also wipe this apps' data).

adb uninstall your.package.name

It seems that AndroidManifest.xml is sticky, for reasons I don't fully understand. I would encounter this case when I had a non-debug APK as my initial install, and then sideload a debuggable APK later.

2
  • Hi, sorry for this off topic comment. I saw your profile pic on mathematics chatroom (a flying sheep? :D) May I know where is it from? Feb 20, 2020 at 3:23
  • Hi, I changed my profile, but it is a tardigrade - a micro animal also known as a 'water bear' that can survive the vacuum of space for a little while. Sep 20, 2021 at 16:11
1

Like @ prudhvi said, this an be solved by settings build variant to debug

enter image description here

-4

Try changing your package name to com.my.pack.age because there seems to be an issue with packages names less than 4 levels. Also make sure that the package is mentioned in /data/system/packages.list. Information taken from here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.