blob: 839c51d6d7c95871cfc9a1f4c46509987a672b23 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Introduction | WEEX</title>
<meta name="description" content="Weex">
<link rel="icon" href="//gw.alicdn.com/tps/TB1XNqxPXXXXXcSXVXXXXXXXXXX-64-63.png">
<script src="//g.alicdn.com/alilog/mlog/aplus_v2.js"></script>
<meta name="data-spm" dataSpmProtocol="i" content="a2c7j">
<meta name="aplus-ajax" content="chksum">
<meta name="aplus-waiting" content="MAN">
<meta name="google-site-verification" content="FbH8DPHpxdDJlfkKLKXuXWOu69DI8ZRRP8O2Phg8UKw">
<meta name="baidu-site-verification" content="WRr1iWvsYK">
<link rel="preload" href="/assets/css/styles.0ff943f0.css" as="style"><link rel="preload" href="/assets/js/app.0ff943f0.js" as="script"><link rel="preload" href="/assets/js/98.384bebd6.js" as="script"><link rel="prefetch" href="/assets/css/1.styles.aa72e838.css"><link rel="prefetch" href="/assets/css/10.styles.1fff5b86.css"><link rel="prefetch" href="/assets/css/11.styles.a03faa50.css"><link rel="prefetch" href="/assets/css/2.styles.fc5d9892.css"><link rel="prefetch" href="/assets/css/21.styles.9ebad2b1.css"><link rel="prefetch" href="/assets/css/3.styles.6b94323a.css"><link rel="prefetch" href="/assets/css/36.styles.6dbb9d8c.css"><link rel="prefetch" href="/assets/css/4.styles.706a5607.css"><link rel="prefetch" href="/assets/css/7.styles.469d3b64.css"><link rel="prefetch" href="/assets/css/8.styles.b36167bf.css"><link rel="prefetch" href="/assets/css/9.styles.5bed6ebe.css"><link rel="prefetch" href="/assets/js/10.1fff5b86.js"><link rel="prefetch" href="/assets/js/100.09076a87.js"><link rel="prefetch" href="/assets/js/101.71fa3538.js"><link rel="prefetch" href="/assets/js/102.8a9926d6.js"><link rel="prefetch" href="/assets/js/103.d6c3649e.js"><link rel="prefetch" href="/assets/js/104.adb2425b.js"><link rel="prefetch" href="/assets/js/105.a063ca34.js"><link rel="prefetch" href="/assets/js/106.620e227f.js"><link rel="prefetch" href="/assets/js/107.1c97d156.js"><link rel="prefetch" href="/assets/js/108.d1f236a9.js"><link rel="prefetch" href="/assets/js/109.10a909cc.js"><link rel="prefetch" href="/assets/js/11.a03faa50.js"><link rel="prefetch" href="/assets/js/110.6f9200c8.js"><link rel="prefetch" href="/assets/js/111.9c1831b3.js"><link rel="prefetch" href="/assets/js/112.e5c0d546.js"><link rel="prefetch" href="/assets/js/113.b1c17feb.js"><link rel="prefetch" href="/assets/js/114.c24b95ed.js"><link rel="prefetch" href="/assets/js/115.d7e38c3b.js"><link rel="prefetch" href="/assets/js/116.1aaa95ab.js"><link rel="prefetch" href="/assets/js/117.1a9e5539.js"><link rel="prefetch" href="/assets/js/118.8d915477.js"><link rel="prefetch" href="/assets/js/119.77f0a126.js"><link rel="prefetch" href="/assets/js/12.16a9b730.js"><link rel="prefetch" href="/assets/js/120.3cf0ba10.js"><link rel="prefetch" href="/assets/js/121.47fefbf1.js"><link rel="prefetch" href="/assets/js/122.3dd022e8.js"><link rel="prefetch" href="/assets/js/123.84abc63f.js"><link rel="prefetch" href="/assets/js/124.2568e233.js"><link rel="prefetch" href="/assets/js/125.5b665f24.js"><link rel="prefetch" href="/assets/js/126.25b58a0a.js"><link rel="prefetch" href="/assets/js/127.d62a58c6.js"><link rel="prefetch" href="/assets/js/128.e5774a02.js"><link rel="prefetch" href="/assets/js/129.9a813c06.js"><link rel="prefetch" href="/assets/js/13.f8bde866.js"><link rel="prefetch" href="/assets/js/130.edddc316.js"><link rel="prefetch" href="/assets/js/131.760aa65c.js"><link rel="prefetch" href="/assets/js/132.559d5ba7.js"><link rel="prefetch" href="/assets/js/133.cbdd35c7.js"><link rel="prefetch" href="/assets/js/134.c02d92e1.js"><link rel="prefetch" href="/assets/js/135.e6d5496a.js"><link rel="prefetch" href="/assets/js/136.8826af60.js"><link rel="prefetch" href="/assets/js/137.28b4573d.js"><link rel="prefetch" href="/assets/js/138.d370fc15.js"><link rel="prefetch" href="/assets/js/139.8d9150fc.js"><link rel="prefetch" href="/assets/js/14.a98602cc.js"><link rel="prefetch" href="/assets/js/140.f0a9b5e1.js"><link rel="prefetch" href="/assets/js/141.297fa6fe.js"><link rel="prefetch" href="/assets/js/142.82bbcbaa.js"><link rel="prefetch" href="/assets/js/143.2d1ed3b2.js"><link rel="prefetch" href="/assets/js/144.69a9bc6a.js"><link rel="prefetch" href="/assets/js/145.74d52c12.js"><link rel="prefetch" href="/assets/js/146.12ecdaf4.js"><link rel="prefetch" href="/assets/js/147.daad4b96.js"><link rel="prefetch" href="/assets/js/148.bb356182.js"><link rel="prefetch" href="/assets/js/149.56fdaace.js"><link rel="prefetch" href="/assets/js/15.ea6e5024.js"><link rel="prefetch" href="/assets/js/150.ee9c4994.js"><link rel="prefetch" href="/assets/js/151.2feae618.js"><link rel="prefetch" href="/assets/js/152.c7703521.js"><link rel="prefetch" href="/assets/js/153.3b555eab.js"><link rel="prefetch" href="/assets/js/154.c6329253.js"><link rel="prefetch" href="/assets/js/155.334c4ea4.js"><link rel="prefetch" href="/assets/js/156.1a29657f.js"><link rel="prefetch" href="/assets/js/157.ba8f07bc.js"><link rel="prefetch" href="/assets/js/158.a60a60ba.js"><link rel="prefetch" href="/assets/js/159.9ce96d49.js"><link rel="prefetch" href="/assets/js/16.14acc638.js"><link rel="prefetch" href="/assets/js/160.2a970224.js"><link rel="prefetch" href="/assets/js/161.a26e2b53.js"><link rel="prefetch" href="/assets/js/162.73535662.js"><link rel="prefetch" href="/assets/js/163.7518a0a5.js"><link rel="prefetch" href="/assets/js/164.17367778.js"><link rel="prefetch" href="/assets/js/165.46c8f055.js"><link rel="prefetch" href="/assets/js/166.1cc22037.js"><link rel="prefetch" href="/assets/js/167.3fbcb5c6.js"><link rel="prefetch" href="/assets/js/168.a3f80f1e.js"><link rel="prefetch" href="/assets/js/169.a6565c29.js"><link rel="prefetch" href="/assets/js/17.d6f2f3b8.js"><link rel="prefetch" href="/assets/js/170.566ddeda.js"><link rel="prefetch" href="/assets/js/171.4fd97bee.js"><link rel="prefetch" href="/assets/js/172.5295c6b9.js"><link rel="prefetch" href="/assets/js/173.ff25fd05.js"><link rel="prefetch" href="/assets/js/174.22ea6a1b.js"><link rel="prefetch" href="/assets/js/175.c6a04367.js"><link rel="prefetch" href="/assets/js/176.d3810924.js"><link rel="prefetch" href="/assets/js/177.facd2802.js"><link rel="prefetch" href="/assets/js/178.f4c6fbe9.js"><link rel="prefetch" href="/assets/js/179.1a3a2c12.js"><link rel="prefetch" href="/assets/js/18.83f6b39a.js"><link rel="prefetch" href="/assets/js/180.b54c8e90.js"><link rel="prefetch" href="/assets/js/181.88495b4c.js"><link rel="prefetch" href="/assets/js/182.8341d23c.js"><link rel="prefetch" href="/assets/js/183.332bcfe2.js"><link rel="prefetch" href="/assets/js/184.d8996a56.js"><link rel="prefetch" href="/assets/js/185.b8584f07.js"><link rel="prefetch" href="/assets/js/186.fa89e23f.js"><link rel="prefetch" href="/assets/js/187.90340eeb.js"><link rel="prefetch" href="/assets/js/188.efe631f8.js"><link rel="prefetch" href="/assets/js/189.72897b1a.js"><link rel="prefetch" href="/assets/js/19.94f071c0.js"><link rel="prefetch" href="/assets/js/190.1ec691ee.js"><link rel="prefetch" href="/assets/js/2.fc5d9892.js"><link rel="prefetch" href="/assets/js/20.13f7bbff.js"><link rel="prefetch" href="/assets/js/21.9ebad2b1.js"><link rel="prefetch" href="/assets/js/22.764b643d.js"><link rel="prefetch" href="/assets/js/23.f533737e.js"><link rel="prefetch" href="/assets/js/24.4eaa533c.js"><link rel="prefetch" href="/assets/js/25.e9877e57.js"><link rel="prefetch" href="/assets/js/26.8905d6a0.js"><link rel="prefetch" href="/assets/js/27.b199a955.js"><link rel="prefetch" href="/assets/js/28.524af0cf.js"><link rel="prefetch" href="/assets/js/29.b772949f.js"><link rel="prefetch" href="/assets/js/3.6b94323a.js"><link rel="prefetch" href="/assets/js/30.f5bcac64.js"><link rel="prefetch" href="/assets/js/31.c55e03aa.js"><link rel="prefetch" href="/assets/js/32.e575600a.js"><link rel="prefetch" href="/assets/js/33.3fff5656.js"><link rel="prefetch" href="/assets/js/34.82598567.js"><link rel="prefetch" href="/assets/js/35.8e1290ba.js"><link rel="prefetch" href="/assets/js/36.6dbb9d8c.js"><link rel="prefetch" href="/assets/js/37.d27fdc88.js"><link rel="prefetch" href="/assets/js/38.f8fc7b20.js"><link rel="prefetch" href="/assets/js/39.bf967d40.js"><link rel="prefetch" href="/assets/js/4.706a5607.js"><link rel="prefetch" href="/assets/js/40.e1864fd6.js"><link rel="prefetch" href="/assets/js/41.61bd3b64.js"><link rel="prefetch" href="/assets/js/42.34d8d61d.js"><link rel="prefetch" href="/assets/js/43.1aee493f.js"><link rel="prefetch" href="/assets/js/44.22177e9b.js"><link rel="prefetch" href="/assets/js/45.5c743d2f.js"><link rel="prefetch" href="/assets/js/46.4feffac9.js"><link rel="prefetch" href="/assets/js/47.367f9103.js"><link rel="prefetch" href="/assets/js/48.0c246d45.js"><link rel="prefetch" href="/assets/js/49.ee354be9.js"><link rel="prefetch" href="/assets/js/5.7d9779f7.js"><link rel="prefetch" href="/assets/js/50.bd81c7f0.js"><link rel="prefetch" href="/assets/js/51.a5f432dd.js"><link rel="prefetch" href="/assets/js/52.537aded4.js"><link rel="prefetch" href="/assets/js/53.84814584.js"><link rel="prefetch" href="/assets/js/54.5f780e97.js"><link rel="prefetch" href="/assets/js/55.9d44c91d.js"><link rel="prefetch" href="/assets/js/56.fc164b43.js"><link rel="prefetch" href="/assets/js/57.959b2d44.js"><link rel="prefetch" href="/assets/js/58.bd5c38e0.js"><link rel="prefetch" href="/assets/js/59.3eaece52.js"><link rel="prefetch" href="/assets/js/6.49a49457.js"><link rel="prefetch" href="/assets/js/60.4b8cb735.js"><link rel="prefetch" href="/assets/js/61.b54b9195.js"><link rel="prefetch" href="/assets/js/62.0116614c.js"><link rel="prefetch" href="/assets/js/63.85b1247d.js"><link rel="prefetch" href="/assets/js/64.8f1be6b5.js"><link rel="prefetch" href="/assets/js/65.6a241647.js"><link rel="prefetch" href="/assets/js/66.08c8bd13.js"><link rel="prefetch" href="/assets/js/67.002e0071.js"><link rel="prefetch" href="/assets/js/68.6c6a7c94.js"><link rel="prefetch" href="/assets/js/69.64d90e5d.js"><link rel="prefetch" href="/assets/js/7.469d3b64.js"><link rel="prefetch" href="/assets/js/70.b2c287c9.js"><link rel="prefetch" href="/assets/js/71.b7ad1135.js"><link rel="prefetch" href="/assets/js/72.7391b5c2.js"><link rel="prefetch" href="/assets/js/73.c5c77d81.js"><link rel="prefetch" href="/assets/js/74.96f80ffd.js"><link rel="prefetch" href="/assets/js/75.2920c7b7.js"><link rel="prefetch" href="/assets/js/76.a90bd3c9.js"><link rel="prefetch" href="/assets/js/77.3a0eeccd.js"><link rel="prefetch" href="/assets/js/78.6791678c.js"><link rel="prefetch" href="/assets/js/79.8b0c78e4.js"><link rel="prefetch" href="/assets/js/8.b36167bf.js"><link rel="prefetch" href="/assets/js/80.2641b89d.js"><link rel="prefetch" href="/assets/js/81.03d1925e.js"><link rel="prefetch" href="/assets/js/82.71061708.js"><link rel="prefetch" href="/assets/js/83.df220a8f.js"><link rel="prefetch" href="/assets/js/84.99fbef8f.js"><link rel="prefetch" href="/assets/js/85.dee8bcae.js"><link rel="prefetch" href="/assets/js/86.5200e4ce.js"><link rel="prefetch" href="/assets/js/87.96df0d82.js"><link rel="prefetch" href="/assets/js/88.e9171a32.js"><link rel="prefetch" href="/assets/js/89.53987bbc.js"><link rel="prefetch" href="/assets/js/9.5bed6ebe.js"><link rel="prefetch" href="/assets/js/90.8da0ff06.js"><link rel="prefetch" href="/assets/js/91.4bcce2cd.js"><link rel="prefetch" href="/assets/js/92.aca18707.js"><link rel="prefetch" href="/assets/js/93.93fdf568.js"><link rel="prefetch" href="/assets/js/94.e893b256.js"><link rel="prefetch" href="/assets/js/95.cb1d62b6.js"><link rel="prefetch" href="/assets/js/96.5529545c.js"><link rel="prefetch" href="/assets/js/97.d01eda68.js"><link rel="prefetch" href="/assets/js/99.fa349b8f.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.aa72e838.js">
<link rel="stylesheet" href="/assets/css/styles.0ff943f0.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container vuepress-theme-fast"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div><a href="/" class="home-link router-link-active"><img src="/logo@2x.svg" alt="WEEX" class="logo"></a><span class="version"><a href="/download/download.html" class="version-bg"><img src="/assets/img/version-bg.ab65ded9.svg" alt="v0.28"><span class="version-no">v0.28</span></a></span><div class="links"><form id="search-form" class="algolia-search-wrapper search-box"><input id="algolia-search-input" class="search-query"></form><nav class="nav-links can-hide"><div class="nav-item"><a href="/guide/" class="nav-link router-link-active">Guide</a></div><div class="nav-item"><a href="/docs/" class="nav-link">Docs</a></div><div class="nav-item"><a href="/tools/" class="nav-link">Third Party Tools</a></div><div class="nav-item"><a href="/download/" class="nav-link">Download</a></div><div class="nav-item"><a href="/community/" class="nav-link">Community</a></div><div class="nav-item"><a href="/blog/" class="nav-link">Blog</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">Languages</span><span class="arrow right"></span></a><ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----><a href="/guide/develop/weex_cli.html" class="nav-link router-link-exact-active router-link-active">English</a></li><li class="dropdown-item"><!----><a href="/zh/guide/develop/weex_cli.html" class="nav-link">简体中文</a></li></ul></div></div></nav><a href="https://github.com/apache/incubator-weex" target="_blank" rel="noopener noreferrer" class="repo-link"><img src="/assets/img/github.7cb484a9.svg" alt="github" class="github-icon"></a></div></header><div class="sidebar-mask"></div><div class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/guide/" class="nav-link router-link-active">Guide</a></div><div class="nav-item"><a href="/docs/" class="nav-link">Docs</a></div><div class="nav-item"><a href="/tools/" class="nav-link">Third Party Tools</a></div><div class="nav-item"><a href="/download/" class="nav-link">Download</a></div><div class="nav-item"><a href="/community/" class="nav-link">Community</a></div><div class="nav-item"><a href="/blog/" class="nav-link">Blog</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">Languages</span><span class="arrow right"></span></a><ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----><a href="/guide/develop/weex_cli.html" class="nav-link router-link-exact-active router-link-active">English</a></li><li class="dropdown-item"><!----><a href="/zh/guide/develop/weex_cli.html" class="nav-link">简体中文</a></li></ul></div></div></nav><ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading"><span>Getting Started</span><!----></p><ul class="sidebar-group-items"><li><a href="/guide/introduction.html" class="sidebar-link">Introduction</a></li><li><a href="/guide/front-end-frameworks.html" class="sidebar-link">Front-End Frameworks</a></li><li><a href="/guide/platform-difference.html" class="sidebar-link">Platform Difference</a></li><li><a href="/guide/use-vue-in-weex.html" class="sidebar-link">Use Vue in Weex</a></li><li><a href="/guide/use-rax-in-weex.html" class="sidebar-link">Use Rax in Weex</a></li><li><a href="/guide/playground.html" class="sidebar-link">Playground App</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading open"><span>Develop</span><!----></p><ul class="sidebar-group-items"><li><a href="/guide/develop/setup-develop-environment.html" class="sidebar-link">Setup Develop Environment</a></li><li><a href="/guide/develop/create-a-new-app.html" class="sidebar-link">Create a New App</a></li><li><a href="/guide/develop/weex_cli.html" class="active sidebar-link">Weex CLI</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide/develop/weex_cli.html#system-components" class="sidebar-link">System Components</a></li><li class="sidebar-sub-header"><a href="/guide/develop/weex_cli.html#installation" class="sidebar-link">Installation</a></li><li class="sidebar-sub-header"><a href="/guide/develop/weex_cli.html#commands" class="sidebar-link">Commands</a></li></ul></li><li><a href="/guide/develop/integrate-to-android-app.html" class="sidebar-link">Integrate to Android</a></li><li><a href="/guide/develop/integrate-to-iOS-app.html" class="sidebar-link">Integrate to iOS</a></li><li><a href="/guide/develop/weex_error_code.html" class="sidebar-link">WeexErrorCode</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Debug</span><!----></p><ul class="sidebar-group-items"><li><a href="/guide/debug/integrate-devtool-to-android.html" class="sidebar-link">Integrate Devtool to Android</a></li><li><a href="/guide/debug/integrate-devtool-to-ios.html" class="sidebar-link">Integrate Devtool to iOS</a></li><li><a href="/guide/debug/debug.html" class="sidebar-link">Debug</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Extend</span><!----></p><ul class="sidebar-group-items"><li><a href="/guide/extend/extend-android.html" class="sidebar-link">Extend Android</a></li><li><a href="/guide/extend/extend-ios.html" class="sidebar-link">Extend iOS</a></li><li><a href="/guide/extend/extend-ios-with-swift.html" class="sidebar-link">Extend iOS with Swift</a></li><li><a href="/guide/extend/extend-web.html" class="sidebar-link">Extend Web Renderer</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Advanced</span><!----></p><ul class="sidebar-group-items"><li><a href="/guide/advanced/asset-path.html" class="sidebar-link">Asset Path</a></li><li><a href="/guide/advanced/downgrade.html" class="sidebar-link">Downgrade</a></li><li><a href="/guide/advanced/use-vuex-and-vue-router.html" class="sidebar-link">Use Vuex and vue-router</a></li><li><a href="/guide/advanced/multi-size-screen.html" class="sidebar-link">Fit for multi-size screen</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Contribute</span><!----></p><ul class="sidebar-group-items"><li><a href="/guide/contribute/how-to-contribute.html" class="sidebar-link">Join Weex community</a></li><li><a href="/guide/contribute/thanks.html" class="sidebar-link">Thanks</a></li></ul></div></li></ul></div><div class="page"><div class="content"><h1 id="introduction"><a href="#introduction" class="header-anchor">#</a> Introduction</h1><div class="warning custom-block"><p class="custom-block-title">warning</p><p>This document is for the <code>Weex CLI</code><strong>2.x</strong> version. For the old version of the <code>Weex CLI</code> documentation, please go to <a href="https://github.com/apache/weex-cli/blob/v1.0/README.md" target="_blank" rel="noopener noreferrer">here<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>.</p></div><p><a href="https://github.com/apache/weex-cli" target="_blank" rel="noopener noreferrer">Weex CLI<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> is dedicated to standardizing the tool base in the Weex ecosystem. It ensures that various build tools can be seamlessly connected based on smart default configuration, so you can focus on writing applications without having to spend days tangling configuration issues.</p><h2 id="system-components"><a href="#system-components" class="header-anchor">#</a> System Components</h2><p><a href="https://github.com/apache/weex-cli" target="_blank" rel="noopener noreferrer">Weex CLI<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> split each function module into separate parts, if you see our <a href="https://github.com/apache/weex-cli/tree/master/packages/%40weex" target="_blank" rel="noopener noreferrer">source code<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> , you will find that we manage multiple separate releases in the repository via <a href="https://lernajs.io/" target="_blank" rel="noopener noreferrer">Lerna<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Package, providing the following functional modules:</p><ul><li>The <code>@weex-cli/core</code>:
<ul><li>upgradeable;</li><li>Ability to customize through plugins and extensions;</li><li>Provide globally configurable files;</li></ul></li><li>The <code>@weex-cli/generator</code> module can quickly init the official project.</li><li>The <code>@weex-cli/compile</code> module can quickly configuration compile Weex file.</li><li>The <code>@weex-cli/preview</code> module can quickly preview the Weex page.</li><li>The <code>@weex-cli/debug</code> module compiles and debugs the Weex page.</li><li>The <code>@weex-cli/doctor</code> module quickly checks the user's local development environment.</li><li>The <code>@weex-cli/lint</code> module performs quality diagnostics on local <code>.vue</code> files.</li><li>The <code>@weex-cli/device</code> module quickly manages user local devices.</li><li>The <code>@weex-cli/run</code> module runs the <code>iOS/Android/Web</code> project quickly.</li></ul><h1 id="how-to-use"><a href="#how-to-use" class="header-anchor">#</a> How to use</h1><div class="warning custom-block"><p class="custom-block-title">Warning</p><p>If you don't have node.js installed locally, you can go to <a href="https://nodejs.org/en/" target="_blank" rel="noopener noreferrer">Nodejs official website<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> to download and install, and make sure your node version is <code>&gt;=7.6.0</code>, you can use <a href="Https://github.com/tj/n">n</a> to perform version management of node.</p></div><h2 id="installation"><a href="#installation" class="header-anchor">#</a> Installation</h2><p>If you have problems during the installation process, you can do a question search and feedback at <a href="https://github.com/apache/weex-cli/issues" target="_blank" rel="noopener noreferrer">here<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>.</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ <span class="token function">npm</span> <span class="token function">install</span> weex-toolkit -g
</code></pre></div><h2 id="commands"><a href="#commands" class="header-anchor">#</a> Commands</h2><h3 id="create-a-project"><a href="#create-a-project" class="header-anchor">#</a> Create a project</h3><div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># Create a project from the official template</span>
$ weex create my-project
</code></pre></div><p>The <code>@weex-cli/generator</code> module uses <a href="https://github.com/flipxfx/download-git-repo" target="_blank" rel="noopener noreferrer"><code>download-git-repo</code><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> to download the template file. The <code>download-git-repo</code> tool allows You specify a specific branch and remote repository address for project download, and the specified branch is separated by the (<code>#</code>) symbol.</p><p>The template format under the download specific branch is as follows:</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex create <span class="token string">'&lt;template-name&gt;#&lt;branch-name&gt;'</span> <span class="token operator">&lt;</span>project-name<span class="token operator">&gt;</span>
</code></pre></div><p>E.g:</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex create weex-templates/webpack<span class="token comment">#v1.0 my-project</span>
</code></pre></div><p>This command will initialize the project via the <code>v1.0</code> branch of the <a href="https://github.com/weex-templates/webpack/tree/v1.0" target="_blank" rel="noopener noreferrer">weex-templates/webpack<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> project.</p><p>You can create project templates from official templates or remote sources, or you can create your own <code>weex</code> project templates. For more details you can see [How to create your own templates](https://github.com/weex-templates /How-to-create-your-own-template).</p><h3 id="compile-page"><a href="#compile-page" class="header-anchor">#</a> Compile page</h3><p>The <code>@weex-cli/compile</code> module provides the ability to compile <code>.vue</code> files in Weex projects. You can use them in official projects, or you can directly compile sandboxes with zero configuration for a single <code>.vue</code> file, use as follows:</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex compile <span class="token punctuation">[</span>resource file<span class="token punctuation">]</span> <span class="token punctuation">[</span>product address<span class="token punctuation">]</span> <span class="token operator">&lt;</span>options<span class="token operator">&gt;</span>
</code></pre></div><p>E.g:</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex compile src build
</code></pre></div><p>or</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex compile src/index.vue build
</code></pre></div><h4 id="options"><a href="#options" class="header-anchor">#</a> Options</h4><table><thead><tr><th>Options</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td><code>-w, --watch</code></td><td style="text-align:left">Listen for file changes and compile in real time [Default: <code>true</code>]</td></tr><tr><td><code>-d,--devtool [devtool]</code></td><td style="text-align:left">Set the devtool option for webpack compilation</td></tr><tr><td><code>-e,--ext [ext]</code></td><td style="text-align:left">Set the default build file [Default: <code>.vue</code>]</td></tr><tr><td><code>-m, --min</code></td><td style="text-align:left">Code obfuscation and compression of the product [Default: <code>false</code>]</td></tr><tr><td><code>-c, --config</code></td><td style="text-align:left">Incoming webpack configuration file [Default: <code>false</code>]</td></tr><tr><td><code>-b, --base</code></td><td style="text-align:left">Set the base path [Default: <code>process.cwd()</code>]</td></tr></tbody></table><h3 id="preview-page"><a href="#preview-page" class="header-anchor">#</a> Preview page</h3><p>The <code>@weex-cli/preview</code> module provides the ability to compile and preview <code>.vue</code> files in Weex projects. You can use them in official projects, or you can directly perform a sandbox preview of zero configuration for a single <code>.vue</code> file, use as follows:</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex preview <span class="token punctuation">[</span>file <span class="token operator">|</span> folder<span class="token punctuation">]</span> <span class="token operator">&lt;</span>options<span class="token operator">&gt;</span>
</code></pre></div><p>The browser will automatically open the preview page and you can see the layout and effects of your weex page. If you have <a href="/tools/">Weex Playground App</a> installed on your device, you can also view the page by scanning the QR code on the page.</p><p>Using the command below, you will be able to preview the <code>.vue</code> file in the entire folder.</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex src --entry src/foo.vue
</code></pre></div><p>You need to specify the folder path to be previewed and the entry file (passed in <code>--entry</code>).</p><h4 id="options-2"><a href="#options-2" class="header-anchor">#</a> Options</h4><table><thead><tr><th>Options</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td><code>-d,--devtool [devtool]</code></td><td style="text-align:left">Set the devtool option for webpack compilation</td></tr><tr><td><code>-m, --min</code></td><td style="text-align:left">Code obfuscation and compression of the product [Default: <code>false</code>]</td></tr><tr><td><code>-c, --config</code></td><td style="text-align:left">Incoming webpack configuration file [Default: <code>false</code>]</td></tr><tr><td><code>-b, --base</code></td><td style="text-align:left">Set the base path [Default: <code>process.cwd()</code>]</td></tr></tbody></table><h3 id="add-ios-android-project"><a href="#add-ios-android-project" class="header-anchor">#</a> Add iOS/Android project</h3><p>The <code>@weex-cli/generator</code> module provides the ability to add Weex official iOS/Android engineering features.</p><p>Use the <code>weex platform [add|remove] [ios|android]</code> command to add or remove the <code>iOS/Android</code> project template.</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex platform <span class="token function">add</span> ios
$ weex platform remove ios
</code></pre></div><p>This command is only valid in the official <code>weex</code> project. Please note the project structure. You can use <code>weex platform list</code> to view the supported platforms in your project.</p><h3 id="running-ios-android-project"><a href="#running-ios-android-project" class="header-anchor">#</a> Running iOS/Android Project</h3><p>The <code>@weex-cli/run</code> module provides the ability to add and run Weex official iOS/Android project functions, which you can use with the following commands:</p><div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># Run iOS Simulator Preview</span>
$ weex run ios
<span class="token comment"># Run Android Simulator / Real Machine Preview</span>
$ weex run android
<span class="token comment"># Run web preview</span>
$ weex run web
</code></pre></div><h3 id="debugging-page"><a href="#debugging-page" class="header-anchor">#</a> Debugging page</h3><p>The <code>@weex-cli/debug</code> module provides debugging capabilities for Weex pages, which can be started with the following command:</p><div class="language-bash extra-class"><pre class="language-bash"><code>$ weex debug <span class="token punctuation">[</span>we_file<span class="token operator">|</span>bundles_dir<span class="token punctuation">]</span> <span class="token punctuation">[</span>options<span class="token punctuation">]</span>
</code></pre></div><h4 id="options-3"><a href="#options-3" class="header-anchor">#</a> Options</h4><table><thead><tr><th>Options</th><th style="text-align:left">Description</th></tr></thead><tbody><tr><td><code>-p, --port [port]</code></td><td style="text-align:left">Set the port of the debug server, [default: <code>8088</code>]</td></tr><tr><td><code>--manual</code></td><td style="text-align:left">When this option is enabled, the browser will not open automatically, [Default: <code>false</code>]</td></tr><tr><td><code>--channelid</code></td><td style="text-align:left">Specify debug channel ID</td></tr><tr><td><code>--remote-debug-port [port]</code></td><td style="text-align:left">Set the debug server port number, [default: <code>9222</code>]</td></tr></tbody></table><h4 id="how-to-integrate-debugging-tools-into-your-own-app"><a href="#how-to-integrate-debugging-tools-into-your-own-app" class="header-anchor">#</a> How to integrate debugging tools into your own app</h4><p>Reference documentation:</p><ul><li>[1] <a href="/guide/debug/integrate-devtool-to-android.html">Integrated Weex Debugging Tool (Android)</a></li><li>[2] <a href="/guide/debug/integrate-devtool-to-ios.html">Integrated Weex Debugging Tool (iOS)</a></li></ul><h3 id="code-quality-check"><a href="#code-quality-check" class="header-anchor">#</a> Code Quality Check</h3><p>The <code>@weex-cli/lint</code> module provides a Weex code quality check function that can be started with the following command:</p><div class="language-base extra-class"><pre class="language-text"><code>$ weex lint [file | folder] &lt;options&gt;
</code></pre></div><h4 id="options-4"><a href="#options-4" class="header-anchor">#</a> Options</h4><p><code>@weex-cli/lint</code> The built-in <code>eslint</code> module is used for code quality verification. For options, please refer to <a href="https://eslint.org/docs/user-guide/command-line-interface" target="_blank" rel="noopener noreferrer">ESLint CLI<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>.</p><p>If you want to add the <code>weex</code> code quality check to your project, you can also add the eslint plugin <a href="https://www.npmjs.com/package/eslint-plugin-weex" target="_blank" rel="noopener noreferrer">eslint-plugin-weex<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Way to use.</p><h3 id="development-environment-check"><a href="#development-environment-check" class="header-anchor">#</a> Development Environment Check</h3><p>The <code>@weex-cli/doctor</code> module provides a check for the local development environment and can be started with the following command:</p><div class="language-base extra-class"><pre class="language-text"><code>$ weex doctor
</code></pre></div><p>This command will check your local development environment, you can adjust your development environment according to the prompts, in order to develop the weex page.</p></div><div class="page-nav"><p class="inner"><span class="prev">
<a href="/guide/develop/create-a-new-app.html" class="prev">
Create a New App
</a></span><span class="next"><a href="/guide/develop/integrate-to-android-app.html">
Integrate to Android
</a>
</span></p></div><div class="page-edit"><div class="last-updated"><span class="prefix">Last Updated: </span><span class="time">12/10/2020</span></div><div class="edit-link"><a href="https://github.com/apache/incubator-weex-site/edit/master/docs/guide/develop/weex_cli.md" target="_blank" rel="noopener noreferrer">Edit this page</a><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><a href="https://github.com/apache/incubator-weex-site/issues/new?body=https%3A%2F%2Fweex.io%2F" target="_blank" rel="noopener noreferrer" class="issueText">Suggest</a><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div><div class="score"><span class="choice"><img src="https://img.alicdn.com/tfs/TB1h7TSqpYqK1RjSZLeXXbXppXa-20-18.svg" class="score-icon">Excellent doc</span><span class="choice"><img src="https://img.alicdn.com/tfs/TB1h7TSqpYqK1RjSZLeXXbXppXa-20-18.svg" class="score-icon bad">Unusable doc</span></div></div><div class="license-wrap" style="display:none;"><footer class="footer-container" data-v-0ad13d84><div class="footer-body" data-v-0ad13d84><img src="/logo@2x.svg" class="logo" data-v-0ad13d84><img src="//img.alicdn.com/tfs/TB11BRiIW6qK1RjSZFmXXX0PFXa-365-365.png" class="apache" data-v-0ad13d84><div class="cols-container" data-v-0ad13d84><div class="col col-12" data-v-0ad13d84><h3 data-v-0ad13d84>Disclaimer</h3><p data-v-0ad13d84>Apache Weex is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the
Incubator. Incubation is required of all newly accepted projects until a further review indicates that the
infrastructure, communications, and decision making process have stabilized in a manner consistent with
other successful ASF projects. While incubation status is not necessarily a reflection of the completeness
or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</p></div><div class="col col-4" data-v-0ad13d84><dl data-v-0ad13d84><dt data-v-0ad13d84>ASF</dt><dd data-v-0ad13d84><a href="http://www.apache.org" target="_self" data-v-0ad13d84>Foundation</a></dd><dd data-v-0ad13d84><a href="http://www.apache.org/licenses/" target="_self" data-v-0ad13d84>License</a></dd><dd data-v-0ad13d84><a href="http://www.apache.org/events/current-event" target="_self" data-v-0ad13d84>Events</a></dd><dd data-v-0ad13d84><a href="http://www.apache.org/foundation/sponsorship.html" target="_self" data-v-0ad13d84>Sponsorship</a></dd><dd data-v-0ad13d84><a href="http://www.apache.org/foundation/thanks.html" target="_self" data-v-0ad13d84>Thanks</a></dd></dl></div><div class="col col-4" data-v-0ad13d84><dl data-v-0ad13d84><dt data-v-0ad13d84>Documentation</dt><dd data-v-0ad13d84><a href="/guide/develop/create-a-new-app.html" target="_self" data-v-0ad13d84>Quick start</a></dd><dd data-v-0ad13d84><a href="/guide/develop/setup-develop-environment.html" target="_self" data-v-0ad13d84>Developer guide</a></dd></dl></div><div class="col col-4" data-v-0ad13d84><dl data-v-0ad13d84><dt data-v-0ad13d84>Resources</dt><dd data-v-0ad13d84><a href="/blog/write-a-blog.html" target="_self" data-v-0ad13d84>Blog</a></dd><dd data-v-0ad13d84><a href="/community/" target="_self" data-v-0ad13d84>Community</a></dd><dd data-v-0ad13d84><a href="/guide/contribute/thanks.html" target="_self" data-v-0ad13d84>Thanks by Weex</a></dd><dd data-v-0ad13d84><a href="https://www.apache.org/security/" target="_self" data-v-0ad13d84>Security</a></dd></dl></div></div><div class="copyright" data-v-0ad13d84><span data-v-0ad13d84>Copyright © 2018-2019 The Apache Software Foundation. Apache and the Apache feather
logo are trademarks of The Apache Software Foundation.</span></div></div></footer></div></div><!----></div></div>
<script src="/assets/js/app.0ff943f0.js" defer></script><script src="/assets/js/98.384bebd6.js" defer></script>
</body>
</html>