美文网首页
Weex之helloworld

Weex之helloworld

作者: RookieRun | 来源:发表于2019-03-01 16:08 被阅读0次

1.创建weex工程
搭建好环境以后,进入命令行创建weex工程

weex create helloWeex;//新建工程

后面会紧跟一系列的要你确认的步骤,比如工程名,作者,是否使用lint等,一个个的选就行了
选完之后会提示:

Success! Created helloWeex at /Users/rookie/WorkFile/workspace/WeexProjects/DemoSpace/helloWeex
Inside that directory, you can run several commands:
npm start
Starts the development server for you to preview your weex page on browser
You can also scan the QR code using weex playground to preview weex page on native
npm run dev
Open the code compilation task in watch mode
npm run ios
(Mac only, requires Xcode)
Starts the development server and loads your app in an iOS simulator
npm run android
(Requires Android build tools)
Starts the development server and loads your app on a connected Android device or emulator
npm run pack:ios
(Mac only, requires Xcode)
Packaging ios project into ipa package
npm run pack:android
(Requires Android build tools)
Packaging android project into apk package
npm run pack:web
Packaging html5 project into web/build folder
npm run test
Starts the test runner
To get started:
cd helloWeex
npm start
Enjoy your hacking time!

看到这个提示,你的工程就算创建ok,然后,进入项目目录
cd helloWeex
npm start

以上,就会在默认的浏览器打开demo页面了,如下图:


weex初运行.png

2.添加平台支持
weex可以添加Android或者ios支持,语法如下:

weex platform add android;//添加Android平台
weex platform add ios;//添加ios平台

添加ok后,运行如下命令即可分别在ios或者Android平台上面运行了

weex run ios;
weex run android;
android效果.png

相关文章

  • Weex之helloworld

    1.创建weex工程搭建好环境以后,进入命令行创建weex工程 后面会紧跟一系列的要你确认的步骤,比如工程名,作者...

  • Weex系列(2)-HelloWorld.we

    一、前言 上一篇文章:Weex系列(1)- Weex环境安装,了解了Weex的开发环境安装,接下来简单实现下Hel...

  • Docker之helloworld镜像运行

    Docker之helloworld镜像运行

  • 无标题文章

    helloworld helloworld helloworld helloworld helloworld he...

  • 2019-01-05

    HelloWorld HelloWorld HelloWorld HelloWorld HelloWorld He...

  • Weex开发之-Hello Weex

    上一篇写了Weex的开发环境搭建Weex开发之-开发环境搭建[https://www.jianshu.com/p/...

  • weex 环境搭建一 weex-toolkit

    weex开发, 安装nodejs 、weex-toolkit 、weex-pack weex官网文档:http:/...

  • weex

    weex 原理weexBoxweex 全部weex实战分享weex渲染机制渲染流程weex 解读 weexUI 详...

  • CMake —— 获取环境变量

    $ENV{HELLOWORLD} 注意事项:set(HELLOWORLD $ENV{HELLOWORLD}) 这是...

  • wxWidget之HelloWorld

    wxWidgets工程配置 参考wxWidgets官方Hello World in wxWidgets编写一个简单...

网友评论

      本文标题:Weex之helloworld

      本文链接:https://www.haomeiwen.com/subject/cwgduqtx.html