Merge branch 'tizen' into devel/new_mesh
[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 ## Network setup
40
41 To enable network control on DALi, an environment variable must be set:
42
43 ~~~
44 $ export DALI_NETWORK_CONTROL=1 to enable
45 ~~~
46 Or run the application with the variable set.
47 ~~~
48 $ DALI_NETWORK_CONTROL=1 /usr/apps/com.samsung.dali-demo/bin/dali-demo
49 ~~~
50
51 Check what network port the application is using. It will be from port 3031 onwards.
52   
53 If running DALi on desktop, just type netstat -tlnp. On Tizen log into the device and run netstat. E.g.
54 ~~~
55 $ su
56
57 $ netstat -tlpn
58 ~~~
59
60 ![ ](../assets/img/stage-hand/netstat.png)
61 ![ ](netstat.png)
62
63
64 ## Connecting with Stagehand
65
66 Click the settings icons below
67   
68 ![ ](../assets/img/stage-hand/stagehand-settings.png)
69 ![ ](stagehand-settings.png)
70
71
72 ### Connecting to DALi running on Tizen
73
74 Here we are connecting to a device running SDB
75   
76 ![ ](../assets/img/stage-hand/stagehand-tizen-connection.png)
77 ![ ](stagehand-tizen-connection.png)
78
79 ### Connect to DALi running on Desktop ( Ubuntu )
80   
81 ![ ](../assets/img/stage-hand/stagehand-ubuntu-connection.png)
82 ![ ](stagehand-ubuntu-connection.png)
83
84 ## Using Stagehand
85
86 Click Refresh to load the current scene from the device.
87   
88 ![ ](../assets/img/stage-hand/stagehand-refesh.png)
89 ![ ](stagehand-refesh.png)
90
91 Click screen shot to get overlay current screen
92   
93 ![ ](../assets/img/stage-hand/stagehand-screenshot.png)
94 ![ ](stagehand-screenshot.png)
95
96 To cycle through the actor hierachy, keep clicking the same spot. Alternatively, select using the actor tree.
97
98   
99 ![ ](../assets/img/stage-hand/stagehand-mainscreen.png)
100 ![ ](stagehand-mainscreen.png)
101
102
103 Click the save icon to save the scene
104   
105 ![ ](../assets/img/stage-hand/stagehand-save.png)
106 ![ ](stagehand-save.png)
107
108 Zooming in and out
109   
110 ![ ](../assets/img/stage-hand/stagehand-zoom.png)
111 ![ ](stagehand-zoom.png)
112
113 Modifying the scene
114   
115 ![ ](../assets/img/stage-hand/stagehand-modify.png)
116 ![ ](stagehand-modify.png)
117
118 ## Performance monitoring
119
120 To enable performance option. Edit
121   
122 ~/.stagehand/stagehand.ini
123   
124 Set perfmode=on
125
126 Restart application. Click performance
127   
128 ![ ](../assets/img/stage-hand/stagehand-performance.png)
129 ![ ](stagehand-performance.png)
130
131 ## Trouble shooting
132
133 You can manually check the network is enabled on the DALi application using netcat.
134
135 In the example below we are connecting to a Tizen device using SDB port forwarding.
136   
137 After running nc localhost 3031 we type help
138   
139 ![ ](../assets/img/stage-hand/stagehand-netcat.png)
140 ![ ](stagehand-netcat.png)
141
142
143 ## Tizen smack
144
145
146 If you can't connect to a DALi application, but using netstat you can see a port is open.
147   
148 Check the smack log for errors:
149 ~~~
150 tail -f -n 10 /var/log/audit/audit.log | grep 'internet'
151 ~~~
152
153 If it is being blocked, you temporarily enable it by editing:
154   
155 ~~~
156  /etc/smack/accesses2.d/ your-app-name
157
158 then add: system::user_internet …..app-name rw
159 ~~~
160 ## Tizen Emulator connection problem
161
162
163 Make sure  DALi application is run using launch_app:
164 ~~~
165 launch_app [APP_ID] __AUL_SDK__ DEBUG __DLP_DEBUG_ARG__ :10003
166 ~~~
167
168 @class _Guide_Visual_Debugger