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