21

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?

CodesInChaos
  • 106,488
  • 23
  • 218
  • 262
Green Ho
  • 881
  • 3
  • 14
  • 27
  • 1
    Did you build / export a release version? http://stackoverflow.com/questions/4580595/what-would-happen-if-android-app-is-released-with-debuggable-on – zapl Nov 14 '12 at 19:35
  • 1
    no I am not making a release build. – Green Ho Nov 14 '12 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 '20 at 13:09

4 Answers4

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"

Prudhvi
  • 2,276
  • 7
  • 34
  • 54
4

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.

Michael Chinen
  • 17,737
  • 5
  • 33
  • 45
  • 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? – user9802913 Feb 20 '20 at 03: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. – Michael Chinen Sep 20 '21 at 16:11
1

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

enter image description here

O-9
  • 1,626
  • 16
  • 15
-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.

Binoy Babu
  • 16,699
  • 17
  • 91
  • 134