Merge "Text improvement 1. Text - Layout text & icons. * Feature added to layout...
[platform/core/uifw/dali-toolkit.git] / docs / content / shared-javascript-and-cpp-documentation / stage-hand.md
1 <!--
2 /**-->
3
4 # Stagehand Visual Debugger for DALi {#stagehand}
5
6 ![ ](../assets/img/stage-hand/blocks.png)
7 ![ ](blocks.png)
8
9 ## Introduction
10
11 Stagehand  is an open source tool that allows a developer to:
12
13 - Connect to a DALi application running on:
14  - Tizen
15  - Ubuntu
16 - View a wireframe of the current scene on top of a screen shot
17 - Modify properties in the scene
18 - Monitor performance of the application
19
20   
21 Full source code is available from http://github.com/gamoeba/stagehand.git
22
23 Stagehand is released under the Apache 2 licence.
24
25 ## Installing StageHand on Ubuntu
26
27 http://www.gamoeba.com/stagehand/
28
29 Install both files on the website. Start with the QT dependencies first.
30
31
32 ## How it works
33
34 Stagehand connects to DALi via the network using a TCP/IP connection.
35   
36 ![ ](../assets/img/stage-hand/inner-workings.png)
37 ![ ](inner-workings.png)
38
39 ## Connecting Stagehand to your DALi application
40
41 ### Preparing DALi
42
43 Stagehand connects to DALi via network using a TCP/IP connection, to enable this, your dali-adaptor RPM must be built with a configure option: `--enable-networklogging`
44
45 Here is an example dali-adaptor configure line:
46 ~~~
47 $ CXXFLAGS="-g -O0 -Wno-unused-local-typedefs" CXX="ccache g++" ./configure --prefix=$DESKTOP_PREFIX --enable-debug=yes --enable-profile=UBUNTU --enable-gles=20 --enable-networklogging
48 ~~~
49
50 Once this RPM is installed, you can run your DALi application and connect Stagehand to it.
51   
52
53 ### Network setup
54
55 To enable network control on DALi, an environment variable must be set:
56
57 ~~~
58 $ export DALI_NETWORK_CONTROL=1 to enable
59 ~~~
60 Or run the application with the variable set.
61 ~~~
62 $ DALI_NETWORK_CONTROL=1 /usr/apps/com.samsung.dali-demo/bin/dali-demo
63 ~~~
64
65 Check what network port the application is using. It will be from port 3031 onwards.
66   
67 If running DALi on desktop, just type netstat -tlnp. On Tizen log into the device and run netstat. E.g.
68 ~~~
69 $ su
70
71 $ netstat -tlpn
72 ~~~
73
74 ![ ](../assets/img/stage-hand/netstat.png)
75 ![ ](netstat.png)
76
77
78 ### Connecting with Stagehand
79
80 Click the settings icons below
81   
82 ![ ](../assets/img/stage-hand/stagehand-settings.png)
83 ![ ](stagehand-settings.png)
84
85
86 ### Connecting to DALi running on Tizen
87
88 Here we are connecting to a device running SDB
89   
90 ![ ](../assets/img/stage-hand/stagehand-tizen-connection.png)
91 ![ ](stagehand-tizen-connection.png)
92
93 ### Connect to DALi running on Desktop ( Ubuntu )
94   
95 ![ ](../assets/img/stage-hand/stagehand-ubuntu-connection.png)
96 ![ ](stagehand-ubuntu-connection.png)
97
98 ## Using Stagehand
99
100 Click Refresh to load the current scene from the device.
101   
102 ![ ](../assets/img/stage-hand/stagehand-refesh.png)
103 ![ ](stagehand-refesh.png)
104
105 Click screen shot to get overlay current screen
106   
107 ![ ](../assets/img/stage-hand/stagehand-screenshot.png)
108 ![ ](stagehand-screenshot.png)
109
110 To cycle through the actor hierarchy, keep clicking the same spot. Alternatively, select using the actor tree.
111
112   
113 ![ ](../assets/img/stage-hand/stagehand-mainscreen.png)
114 ![ ](stagehand-mainscreen.png)
115
116
117 Click the save icon to save the scene
118   
119 ![ ](../assets/img/stage-hand/stagehand-save.png)
120 ![ ](stagehand-save.png)
121
122 Zooming in and out
123   
124 ![ ](../assets/img/stage-hand/stagehand-zoom.png)
125 ![ ](stagehand-zoom.png)
126
127 Modifying the scene
128   
129 ![ ](../assets/img/stage-hand/stagehand-modify.png)
130 ![ ](stagehand-modify.png)
131
132 ## Performance monitoring
133
134 To enable performance option. Edit
135   
136 ~/.stagehand/stagehand.ini
137   
138 Set perfmode=on
139
140 Restart application. Click performance
141   
142 ![ ](../assets/img/stage-hand/stagehand-performance.png)
143 ![ ](stagehand-performance.png)
144
145 ## Trouble shooting
146
147 You can manually check the network is enabled on the DALi application using netcat.
148
149 In the example below we are connecting to a Tizen device using SDB port forwarding.
150   
151 After running nc localhost 3031 we type help
152   
153 ![ ](../assets/img/stage-hand/stagehand-netcat.png)
154 ![ ](stagehand-netcat.png)
155
156
157 ## Tizen smack
158
159
160 If you can't connect to a DALi application, but using netstat you can see a port is open.
161   
162 Check the smack log for errors:
163 ~~~
164 tail -f -n 10 /var/log/audit/audit.log | grep 'internet'
165 ~~~
166
167 If it is being blocked, you temporarily enable it by editing:
168   
169 ~~~
170  /etc/smack/accesses2.d/ your-app-name
171
172 then add: system::user_internet …..app-name rw
173 ~~~
174 ## Tizen Emulator connection problem
175
176
177 Make sure  DALi application is run using launch_app:
178 ~~~
179 launch_app [APP_ID] __AUL_SDK__ DEBUG __DLP_DEBUG_ARG__ :10003
180 ~~~
181
182 @class _Guide_Visual_Debugger