0

I'm trying to get systrace to provide disk output.

I've rooted my device and I'm able to switch to superuser in adb shell just fine.

python systrace.py -d -o ~/systrace1.html 

produces

'error: tracing disk activity requires root privileges'

If I try to restart adb with root privileges by running

adb root

I get

'adbd cannot run as root in production builds'

It may be that I'm just not understanding what's meant by "production builds". Any insight would be appreciated.

joates
  • 1,103
  • 2
  • 11
  • 22

1 Answers1

1

The adb sources do this:

    property_get("ro.debuggable", value, "");
    if (strcmp(value, "1") != 0) {
        snprintf(buf, sizeof(buf), "adbd cannot run as root in production builds\n");

In other words, if it doesn't see ro.debuggable set to 1 it won't let you run adb root. Check the contents of your /default.prop.

fadden
  • 51,356
  • 5
  • 116
  • 166
  • Thanks, I suspect this is the correct answer. Is there a way to set ro.debuggable to 1? setprop 1 doesn't seem to stick even when I run the command as su. – joates Sep 16 '13 at 19:05
  • The "ro." means "read-only". Once set, it cannot be altered. The way you change it is to edit the property file that sets it (should be `/default.prop`) and reboot. – fadden Sep 16 '13 at 19:25
  • So to be able to edit the property file I had to remount the file system rw (http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html) and change permissions on the default.prop file. 'cat default.prop' now shows ro.debuggable=1 but getprop still shows ro.debuggable 0. How should I re-initialize that property? Stopping and then starting the shell doesn't seem to be enough. Rebooting seems to overwrite my changes. – joates Sep 18 '13 at 19:37
  • Accepting answer. I suspect this will work for others. I'm not sure why the default.prop file is being overwritten on my ASUS Transformer. – joates Sep 20 '13 at 14:56
  • Best guess: it's being loaded from the "boot" partition into a RAM disk at startup, so every time you reboot it resets. If so, you will need to flash a new boot image (`fastboot flash boot `). Easy enough from a full source tree (edit the default.prop and rebuild; image is `out/target/product//boot.img), not sure what to do otherwise. Note that "boot" is not the same as "bootloader". – fadden Sep 20 '13 at 22:23