1page.title=Device Setup for Hierarchy Viewer
2meta.tags="android, performance, profiling, tools, rendering, hierarchyviewer"
3page.tags="android", "performance", "profiling", "tools", "rendering", "hierarchyviewer"
4page.metaDescription=Set up your mobile device to work with Hierarchy Viewer.
5page.image=tools/performance/thumbnails/tools_hierarchy_viewer.png
6page.article=true
7
8@jd:body
9
10<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
11
12<h2>You should also read</h2>
13<ul>
14  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/index.html">
15    Hierarchy Viewer Walkthrough</a></li>
16  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/profiling.html">
17    Profiling with Hierarchy Viewer</a></li>
18</ul>
19
20</div>
21
22    <p>To run Hierarchy Viewer, you must enable Developer Options on your mobile device and perform
23      some setup on your computer.</p>
24
25    <h2>Configuring Devices</h2>
26
27    <ol>
28      <li><p>Enable <a href=
29    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
30    on your mobile device.</p></li>
31
32    <li>Depending on the type of device you have, do one of the following:
33      <ul>
34        <li>If you have a locked device running Android 4.0 or lower, follow the instructions
35          for <a href=
36               "https://github.com/romainguy/ViewServer">installing and configuring ViewServer</a>.
37        </li>
38        <li>If you have an unlocked device running Android 4.0 or lower,
39          no further configuration is needed.</li>
40        <li>If you have a device running Android 4.1 or higher, you must set an environment
41          variable on your development machine. For more information,
42          see <a href="#hvproto-variable">Setting the ANDROID_HVPROTO variable</a>
43      </ul>
44    </li>
45    </ol>
46
47
48    <h2 id="hvproto-variable">Setting the ANDROID_HVPROTO variable</h2>
49
50    <h3>Windows</h3>
51
52    <ol>
53      <li>Click <b>My Computer &gt; Property &gt; Advanced &gt; Environment Variables.</b></li>
54
55      <li>Click <b>New.</b></li>
56
57      <li>In variables name put: <code>ANDROID_HVPROTO</code></li>
58
59      <li>In variable value put: <code>ddm</code></li>
60
61      <li>Click <b>OK</b><./li>
62    </ol>
63
64    <h3>Mac</h3>
65
66    <ol>
67      <li>Edit <code>~/.bash_profile</code></li>
68
69      <li>Add:
70        <br><code>#Hierarchy Viewer Variable
71        <br>export ANDROID_HVPROTO=ddm</code>
72      </li>
73
74      <li><code>source ~/.bash_profile</code></li>
75    </ol>
76
77    <h3>Linux</h3>
78
79    <ol>
80      <li>Edit <code>~/.bash_profile</code></li>
81
82      <li>Add:
83
84        <br><code>#Hierarchy Viewer Variable
85        <br>export ANDROID_HVPROTO=ddm</code>
86      </li>
87
88    <li><code>source ~/.bash_profile</code></li>
89  </ol>
90