20

I've recently moved from Eclipse to Android Studio, and it looks great. However, I can't seem to find how to display variables in debugging mode as hexadecimal values instead of decimal values. Any help would be appreciated. Thanks

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
isgooner
  • 231
  • 1
  • 2
  • 5

2 Answers2

19

I was wondering the same thing, especially how to do this by default as @adnako asked. I finally found an answer so I will post here, too.

Manually change a single value

Right click > View as... > Hex

enter image description here

Display all values as hex by default

Right click > Custimize Data Views... > Show hex values for primitives > Apply

enter image description here

(Note: these images are from Android Studio 1.2)

Community
  • 1
  • 1
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
  • 2
    In AS 1.4 (and 2.0) the "customize data views" option is not visible for me when inspecting a variable. There is however a global setting under "Build, Execution, Deployment -> Debugger -> Data Views -> Java -> Show hex value for primitives". Easiest is to just open settings and type "hex" in the search box. – JHH Oct 07 '16 at 07:12
  • Not available for native debugger. – zwcloud Mar 01 '21 at 03:48
4

In the debug window, right click on the value you would like to view in hex and choose View as -> Hex. This can be done in the Variables or Watches views.

free3dom
  • 18,729
  • 7
  • 52
  • 51
  • so in eclipse if we hover over a variable name it shows a tooltip sort of a thing with the value in it. Is there anything in android studio similar to this? Rather than adding all the variables to watches. – CodeShadow Jan 10 '15 at 11:40
  • 1
    If you hold down Ctrl (on windows) while hovering over a variable it shows you the current value. You can even do this when not debugging and it will show you the initialization value of the variable. – free3dom Jan 11 '15 at 07:16
  • 2
    How to do to use this behavior as default? – adnako Jan 12 '15 at 13:05
  • @adnako I don't know if you can, have never seen any setting to that effect. – free3dom Jan 12 '15 at 21:24
  • Thanks. I'm very impressed. Stupid intellij. – adnako Jan 13 '15 at 07:16
  • 1
    Hehe, has a few quirks yes, but I'll take it over Eclipse any day ;) – free3dom Jan 13 '15 at 10:59