{"id":13442023,"url":"https://github.com/cytle/wechat_web_devtools","last_synced_at":"2025-09-29T02:32:30.695Z","repository":{"id":41045392,"uuid":"85527373","full_name":"cytle/wechat_web_devtools","owner":"cytle","description":"微信开发者工具(微信小程序)linux完美支持","archived":true,"fork":false,"pushed_at":"2020-09-14T09:36:42.000Z","size":440143,"stargazers_count":2681,"open_issues_count":90,"forks_count":429,"subscribers_count":87,"default_branch":"master","last_synced_at":"2024-09-27T04:41:36.461Z","etag":null,"topics":["linux","nwjs-ide","weapp","wechat-ide","wechat-mini-program","wxapp"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cytle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-20T02:33:13.000Z","updated_at":"2024-09-23T12:15:28.000Z","dependencies_parsed_at":"2022-09-06T03:42:21.856Z","dependency_job_id":null,"html_url":"https://github.com/cytle/wechat_web_devtools","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fwechat_web_devtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fwechat_web_devtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fwechat_web_devtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cytle%2Fwechat_web_devtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cytle","download_url":"https://codeload.github.com/cytle/wechat_web_devtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234583683,"owners_count":18856280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","nwjs-ide","weapp","wechat-ide","wechat-mini-program","wxapp"],"created_at":"2024-07-31T03:01:40.786Z","updated_at":"2025-09-29T02:32:20.685Z","avatar_url":"https://github.com/cytle.png","language":"HTML","funding_links":[],"categories":["HarmonyOS","工具","my-ubuntu"],"sub_categories":["Windows Manager"],"readme":"# Linux微信web开发者工具\n\nlinux 下使用微信web开发者工具.\n\n![wx_dev_tools v1.02.1910121](https://img.shields.io/badge/wx_dev_tools-1.02.1910121-green.svg)\n![nw.js v0.24.4](https://img.shields.io/badge/nw.js-v0.24.4-blue.svg)\n\n## Description\n\n**Linux微信web开发者工具**, 可在 `linux` 桌面环境跑起 `微信开发者工具`,\n原理是 `微信开发者工具` 本质是 `nw.js` 程序, 把它移植到 `linux` 下没大问题.\n负责编译 `wxml` 和 `wxss` 的 `wcc` 和 `wcsc` (可能还有其他功能),\n则利用 `wine` 来跑即可.\n\n## Usage\n\n### 下载项目和初始化\n\n``` bash\ngit clone https://github.com/cytle/wechat_web_devtools.git\ncd wechat_web_devtools\n# 自动下载最新 `nw.js` , 同时部署目录 `~/.config/wechat_web_devtools/`\n./bin/wxdt install\n```\n\n### 启动ide，开发和调试网页\n\n运行准备:\n\n1. `GUI`环境\n\n``` bash\n./bin/wxdt # 启动\n```\n\n### 启动ide，开发和预览小程序\n\n运行准备:\n\n1. `GUI`环境\n2. 需要[安装`wine`](#安装Wine)\n3. 并且已经执行过`./bin/wxdt install`\n\n``` bash\n./bin/wxdt # 启动\n```\n\n### 命令行和HTTP调用\n\n运行准备:\n\n1. `GUI`环境，`命令行和HTTP调用`会自动启动`ide`(服务器没条件的可以使用`docker`)\n2. 并且已经执行过`./bin/wxdt install`\n3. 在`ide`的设置中开启服务端口： 设置 -\u003e 安全 -\u003e 服务端口(开启)\n\n命令行工具所在位置: `\u003c安装路径\u003e/bin/cli`\n\n端口号文件位置：`~/.config/wechat_web_devtools/Default/.ide`\n\n微信文档参考:\n- [命令行 调用 · 小程序](https://developers.weixin.qq.com/miniprogram/dev/devtools/cli.html)\n- [HTTP 调用 · 小程序](https://developers.weixin.qq.com/miniprogram/dev/devtools/http.html)\n\n### Docker\n\n未安装`wine`，仅限`cli`调用\n\n可以直接`run`\n\n``` bash\ndocker run -it \\\n    -v $PWD:/projects \\\n    canyoutle/wxdt \\\n    sh -c \"cli -l \u0026\u0026 cli -p /projects/your-project\"\n```\n\n或是启动一个持久的容器\n\n``` bash\ndocker run -d \\\n    --name wxdt \\\n    -p 6080:80 \\\n    -v $PWD:/projects \\\n    canyoutle/wxdt\n\ndocker exec -it wxdt cli -l # 登录\ndocker exec -it wxdt cli -p /projects/your-project # 预览工程\n\ndocker stop wxdt # 暂停容器\ndocker start wxdt # 下次使用，不用再run，可以直接exec\n```\n\n## 其它说明\n\n### 安装Wine\n\n请参考搜索引擎安装 [Wine](https://wiki.winehq.org/Download)，以下是`Ubuntu`下两种安装\n\n#### 1. 安装`wine-binfmt`\n\n``` bash\nsudo apt-get install wine-binfmt\nsudo update-binfmts --import /usr/share/binfmts/wine\n```\n\n#### 2. 正常安装`wine`\n\n``` bash\ndpkg --add-architecture i386 \\\n  \u0026\u0026 wget -nc https://dl.winehq.org/wine-builds/winehq.key \\\n  \u0026\u0026 apt-key add winehq.key \\\n  \u0026\u0026 apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' \\\n  \u0026\u0026 apt-get update \\\n  \u0026\u0026 apt-get install -y --no-install-recommends --allow-unauthenticated winehq-stable\n```\n\n### `./bin/wxdt install` 报错失败\n\n\u003e ./nw: error while loading shared libraries: libnw.so: cannot open shared object file: No such file or directory\n\n该错误是由 `nw.js` 下载失败所致.\n删除缓存, 重新下载即可.\n\n``` bash\nrm -rf /path/to/wechat_web_devtools/dist\nrm -rf /tmp/wxdt_xsp\n```\n\n``` bash\n# 请务必等待执行完成\n./bin/wxdt install\n```\n\n参考\n\n- https://github.com/cytle/wechat_web_devtools/issues/49#issuecomment-350478295\n\n### `wcc` 和 `wcsc` 编译错误\n\n是`wine`没安装好导致的，或是没有成功替换`wcc` 和 `wcsc`两个二进制文件\n\n- 方案一: 安装`wine`并且执行`./bin/wxdt install`\n- 方案二: 安装`wine-binfmt`\n\n完成后, 点击 \u003ckbd\u003e编译\u003c/kbd\u003e 即可.\n\n参考:\n\n1. https://github.com/cytle/wechat_web_devtools/issues/66#issuecomment-368434141\n2. https://github.com/cytle/wechat_web_devtools/issues/56#issuecomment-371999385\n\n### 更新到最新版\n\n#### 方案一: 直接从当前项目源码 进行 更新 (稳定, 推荐)\n\n``` bash\ngit pull origin\n```\n\n#### 方案二: 使用腾讯原始安装程序 进行 自助复制更新 (及时, 自行折腾)\n\n**注**: 如果抽风了, 可以尝试使用 `git reset --hard` 等操作, 还原到最初的状态.\n\n执行更新, 自动下载最新 `Windows x64` 版开发者工具, 并且使用`7z`解压.  \n\n``` bash\n./bin/update_package_nw.sh\n```\n\n#### 方案三: 同上 手动指定 -l \\\u003c微信开发工具下载地址\\\u003e -v \\\u003c版本号\\\u003e  (可指定预发布版或开发版)\n\n**注**: -l -v 选项**务必同时指定**, 并且版本号 形如1.02.2001191\n\n``` bash\n./bin/update_package_nw.sh -l \u003c微信开发工具下载地址\u003e -v \u003c版本号\u003e\n```\n\n*Tips*\n\n- 运行没问题，欢迎PR\n\n### Ubuntu环境下编辑器字体安装\n\nUbuntu环境下默认没有`Cosolas`字体，同时目前无法修改字体，因此下载安装Consolas字体是较优方案，使得编辑器将显示更舒服。\n\n- 下载`https://github.com/kakkoyun/linux.files/raw/master/fonts/Consolas.ttf` 至`/usr/local/share/fonts` or `~/.fonts`\n- `sudo fc-cache -f`重建字体缓存\n- 确认字体安装成功\n\n``` bash\nsudo fc-list|grep Consol\n.fonts/Consolas.ttf: Consolas:style=Regular\n```\n\n- 重启微信开发者工具\n\n### 卸载\n\n1. 关闭 `微信web开发者工具`\n2. 项目文件夹下运行 `./bin/wxdt uninstall` (删除桌面图标、微信web开发者工具配置目录),\n   **开发者工具配置文件, 所有工程和登录信息均会消失**\n3. 删除项目文件夹\n\n### Arch Linux\n\nArch Linux 及其衍生发行版，如 Manjaro，可以通过 AUR 进行安装：https://aur.archlinux.org/packages/wechat-devtool/\n\n## 截图\n\n![截图1](https://github.com/cytle/wechat_web_devtools/raw/fb84550d2d9b9f40f7a80b896066e1933892eff9/images/截图1.png)\n\n![调试界面](https://github.com/cytle/wechat_web_devtools/raw/fb84550d2d9b9f40f7a80b896066e1933892eff9/images/调试界面.png)\n\n上面项目来自[wechat-v2ex](https://github.com/jectychen/wechat-v2ex)\n\n## 赞赏\n\n\u003cimg width=\"400px\" height=\"400px\" alt=\"赞赏码\" src=\"https://raw.githubusercontent.com/cytle/wechat_web_devtools/master/images/%E5%BE%AE%E4%BF%A1%E8%B5%9E%E8%B5%8F%E7%A0%81.jpeg\"/\u003e\n\n## Changelog\n\n- [更新日志](CHANGELOG.md)\n- [腾讯官方更新日志](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html)\n\n## 免责声明\n\n微信开发者工具版权归腾讯公司所有，本项目旨在交流学习之用。如有不当之处，请联系本人，邮箱：canyoutle@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcytle%2Fwechat_web_devtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcytle%2Fwechat_web_devtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcytle%2Fwechat_web_devtools/lists"}