cytle / wechat_web_devtools

微信开发者工具(微信小程序)linux完美支持
2.68k stars 429 forks source link

桌面启动图标 #14

Closed cytle closed 7 years ago

cytle commented 7 years ago

预计有一天会添加桌面启动图标,不定期

有兴趣的同学也可以搞下,提一个PR,😂

viktor-yang commented 7 years ago

Ubuntu16.04 之前试过在/usr/share/applications, 加了个wechat_web_devtools.desktop:

[Desktop Entry]
Encoding=UTF-8
Name=WeChat Web DevTools
Exec=/path/to/wechat_web_devtools/bin/wxdt
Type=Application
Terminal=false
StartupNotify=true

但是启动是报错: screenshot from 2017-06-20 18-30-55 打开后调试区不全只有3个:

screenshot from 2017-06-20 18-29-40

后来就放弃了....反正不是很需要

almas1992 commented 7 years ago

/usr/share/applications/wechat_web_devtools.desktop

[Desktop Entry]
Encoding=UTF-8
Name=WeChat Web DevTools
Comment=The development tools for wechat web develop
Exec=/opt/tencent/wechat_web_devtools/nw %U
Icon=/opt/tencent/wechat_web_devtools/app/images/logo2.png
Categories=Application;WeChat
Version=0.11.122100
Type=Application
Terminal=0

修改 package.json中的

"chromium-args": "--disable-devtools -ignore-certificate-errors -load-extension=/opt/tencent/wechat_web_devtools/app/dist/extensions/",

-load-extension为绝对路径就不会启动报错

{
  "main": "app/html/index.html",
  "name": "微信web开发者工具",
  "appname": "wechatwebdevtools",
  "version": "0.15.152900",
  "window": {
    "title": "微信web开发者工具 v0.15.152900",
    "icon": "./app/images/logo2.png",
    "toolbar": true,
    "width": 600,
    "height": 480,
    "frame": true
  },
  "inject_js_start": "app/dist/inject/jweixindebug.js",
  "inject_js_end": "app/dist/inject/devtools.js",
  "chromium-args": "--disable-devtools -ignore-certificate-errors -load-extension=/opt/tencent/wechat_web_devtools/app/dist/extensions/",
  "node-remote": "http://*.appservice.open.weixin.qq.com/*",
  "webview": {
    "partitions": [
      {
        "name": "trusted",
        "accessible_resources": [
          "<all_urls>"
        ]
      },
      {
        "name": "devtools",
        "accessible_resources": [
          "<all_urls>"
        ]
      },
      {
        "name": "editor",
        "accessible_resources": [
          "<all_urls>"
        ]
      }
    ]
  },
  "devDependencies": {},
  "beta": false
}
cytle commented 7 years ago

桌面图标已经添加,pull 后执行./bin/wxdt install,就可以了