UNPKG

6.3 kBMarkdownView Raw
1Weex-devtool
2============
3
4[Weex Devtools] (http://alibaba.github.io/weex/doc/tools/devtools.html) is a set of weex debugging tool. The weex-devtool works as a debugging server, it cooperates with the inspect modules on [Android] (https://github.com/weexteam/weex_devtools_android) and [iOS] (https://github.com/weexteam/weex-devtool-iOS) to help user to inspect/debug weex source codes and project:
5
6 1.support android and ios;
7 2.could debug on device and emulator;
8 3.could inspect native Elements, vdom, Network, Console, Resources;
9 4.could debug on source files like JS/weex/Rx... files;
10 5.could breakpoint and debug both JS files and native Java(Android)/C(IOS) files in the same active session.
11 6.support remote debugging, don't need USB connecting to PC.
12 7.support screencast and select element
13 8.support inspect/debug multiple app the same time
14
15
16## Install
17```
18$npm install -g weex-toolkit
19```
20suggest to use weex-toolkit which will call weex-devtool.
21
22## usage
23
24 weex debug [options] [we_file|bundles_dir]
25
26 Options:
27
28 -h, --host [host] set the host ip of debugger server
29 -H, --help display help
30 -V, --verbose display logs of debugger server
31 -v, --version display version
32 -p, --port [port] set debugger server port, default is 8088
33 -M, --manual manual mode,this mode will not auto open chrome
34 -e, --entry [entry] set the entry of bundle file when debugging a directory, the url of the bundle will show on chrome as a QR code.
35
36#### start debugger
37```
38$weex debug
39```
40this command will start debug server and launch a chrome opening `AppList` page.
41this page will display a qrcode ,you can use `Playground App` scan it for starting debug.
42
43#### start debugger with a we file
44```
45$weex debug your_weex.we
46```
47this command will compile `your_weex.we` to `your_weex.js` and start the debug server as upon command.
48`your_weex.js` will deploy on the server and displayed in `AppList` page as another qrcode contain the url of your_weex.js
49
50
51#### start debugger with a directory of we files
52```
53$weex debug your/we/path -e index.we
54```
55this command will build every file in your/we/path and deploy them on the bundle server. your directory will mapping to http://localhost:port/weex/
56use -e to set the entry of these bundles. and the url of "index.we" will display on device list page as another qrcode
57
58## How to access devtools in native
59
60 Android: pls refer to [Weex Devtool Android](https://github.com/weexteam/weex_devtools_android/blob/master/README.md)
61
62 IOS: pls refer to [Weex Devtool IOS](https://github.com/weexteam/weex-devtool-iOS/blob/master/README-zh.md)
63
64### chrome extension
65devtool chrome extension support you can inpect dom tree on debugger page and validate dom tree deep.
66see [weex devtool chrome extension](https://github.com/weexteam/weex-devtool-extension)
67
68
69# 中文版
70
71[Weex Devtools](http://alibaba.github.io/weex/doc/tools/devtools.html) 是一套调试工具。weex-devtool和客户端inspect模块[Android] (https://github.com/weexteam/weex_devtools_android) 和 [iOS] (https://github.com/weexteam/weex-devtool-iOS) 一起,帮助用户调试weex代码和工程:
72
73 1.支持安卓和iOS调试
74 2.支持真机和模拟器
75 3.可以检查native Elements, vdom, network, Console, Resource;
76 4.可以调试js/wx/Rx等前端源码文件
77 5.支持同时在前端文件和native(安卓/iOS)文件上断点调试
78 6.支持远程调试,不需要真机USB连接电脑
79 7.支持screencast和select element功能
80 8.支持同时调试多个应用和客户端
81
82## 安装
83```
84$npm install -g weex-toolkit
85```
86(建议用weex-toolkit这个入口。weex debug其实就是调用的weex-devtool)
87## usage
88
89 weex debug [options] [we_file|bundles_dir]
90
91 options:
92
93 -h, --host [host] 指定debug服务器的ip地址(必须是本机有效的地址)
94 -H, --help 显示帮助
95 -V, --verbose 显示debug服务器运行时的各种log
96 -v, --version 显示版本
97 -p, --port [port] 设置debug服务器端口号 默认为8088
98 -M, --manual 手动模式 这个模式不会自动打开浏览器
99 -e, --entry [entry] debug一个目录时,这个参数指定整个目录的入口bundle文件,这个bundle文件的地址会显示在debug主页上(作为二维码)
100
101#### 开启调试
102```
103$weex debug
104```
105单纯启动一个调试服务器,并同时唤起chrome浏览器打开`调试主页`.
106这个`调试主页`上会有一个二维码,使用Playground App扫这个二维码可以开启Playground调试.
107开启调试后,设备列表中会出现您的设备,根据提示进行后续的调试操作
108
109#### 调试 we文件
110```
111$weex debug your_weex.we
112```
113这个命令会将your_weex.we编译成bundlejs文件 部署到debug服务器
114并启动debug服务器如上述命令那样.打开的`调试主页`会多显示一个二维码,使用playground app
115扫这个码可以加载your_weex.we.(注意要先扫描开启调试的那个码)
116这个命令会自动检测your_weex.we文件变动,如果发现内容被修改则立即重新编译部署,并刷新debugger页面
117.
118#### 调试整个bundle/we文件夹
119```
120$weex debug your/we/path -e index.we
121```
122这个命令会编译你指定目录下的所有的we文件,并把编译好的bundlejs部署到debug服务器,他们的地址会映射到 http://lcoalhost:8088/weex/ 下
123比如 your/we/path/`index.we` 可以通过http://lcoalhost:8088/weex/index.js访问
124your/we/path/`demo/test.we` 可以通过http://lcoalhost:8088/weex/demo/index.js
125
126-e参数可以指定一个入口的we文件,这个文件的地址会显示在`调试主页`上(作为二维码)
127
128
129### Native端调试器接入
130调试weex需要引入native端的devtool
131
132 Android: 请参考 [Weex Devtool Android](https://github.com/weexteam/weex_devtools_android/blob/master/README.md)
133
134 IOS: 请参考 [Weex Devtool IOS](https://github.com/weexteam/weex-devtool-iOS/blob/master/README-zh.md)
135
136### chrome extension
137devtool chrome extension提供了在debugger页面下查看页面dom结构以及对dom节点深度检查的功能
138具体使用方法请参照[weex devtool chrome extension](https://github.com/weexteam/weex-devtool-extension)
\No newline at end of file