DCloud_HB_WDL
DCloud_HB_WDL
  • 发布:2025-01-08 16:19
  • 更新:2025-04-11 16:39
  • 阅读:5288

【Linux HBuilderX Cli 测试版】,欢迎大家测试反馈。

分类:HBuilderX

说明


Linux HBuilderX Cli 已完成开发,欢迎大家试用反馈。

这个cli的用途是让开发者可以在linux服务器上调用HBuilderX cli,来实现程序化操作打包app、上传unicloud云函数。

为持续集成、自动化发布、类saas业务的自动化给客户部署等业务提供支持。

请注意是cli程序,不是HBuilderX可视化编辑器。仅适用于Linux命令行调用。

目前我们仅在Ubuntu 24.04.1 LTS系统上进行了测试,并没有在其它Linux发行版上测试,如有问题,请在本帖反馈

下载地址


Linux HBuilderX cli 4.55-正式版 下载地址
Linux HBuilderX cli 4.54-Alpha版 下载地址
Linux HBuilderX cli 4.57-Alpha版 下载地址

备注:

  1. 4.53-alpha版,压缩包中缺少amazon-corretto。amazon-corretto下载地址

常见使用命令


1. 安装包下载解压

wget -c https://download1.dcloud.net.cn/download/HBuilderX.4.51.2025010802-dev.linux_x64.full.tar.gz  
tar -zxvf HBuilderX.4.51.2025010802-dev.linux_x64.full.tar.gz

2. 使用cli启动HBuilderX程序

cd HBuilderX目录  
./cli open 

启动后,可使用ps -ef | grep HBuilderX查看HBuilderX是否启动。

3. app打包操作命令

# HBuilderX登录。注意app打包必须登录。原因:国家相关部门要求  
cli user login --username <用户名>  --password <密码>  

# 导入要打包的项目  
cli project open --path <项目路径>  

# android ios打包。文档:https://hx.dcloud.net.cn/cli/pack  
cli pack --config 配置文件

完整的cli文档见:https://hx.dcloud.net.cn/cli/README

报Bug

如果大家遇到问题,请大家到https://issues.dcloud.net.cn/pages/issues/report-req?mid=pluginsCLI.linux报Bug。提交问题,请包含以下内容:

  1. 操作系统信息
  2. 详细的命令示例、截图
5 关注 分享
2***@qq.com 2***@qq.com 1***@qq.com 7***@qq.com 1***@163.com

要回复文章请先登录注册

1***@qq.com

1***@qq.com

回复 y***@yeah.net :
你还能跑起来?我执行命令都一直报超时
2025-03-18 13:55
c***@outlook.com

c***@outlook.com

什么时候出可视化编辑器哦
2025-03-18 13:27
y***@yeah.net

y***@yeah.net

云打包还是不行,Ubuntu Desktop下都不行,获取到云端第一条打包进度信息后就通道被关闭,连接已断开
2025-03-18 13:06
y***@yeah.net

y***@yeah.net

在Ubuntu Desktop下总算导出wgt包成功了,真不容易,并且发现了,如果用shell脚本进行自动化处理的话,在cli project open执行成功后,要sleep个几秒,然后再执行cli publish命令导出wgt包,这样才能保证成功。然而,同样的手法,在Ubuntu Server上依然不成功,命令输出一切正常,wgt文件就是不生成,也是无语了,这玩意儿难道没在Ubuntu Server上测试过么?最终要用肯定是要在jenkins里用的,谁会在Desktop上跑jenkins啊
2025-03-18 11:41
1***@qq.com

1***@qq.com

这玩意儿到底怎么用啊?ubuntu 24.04.2 服务器版与桌面版均有以下问题。
cli open 报错:The rpc request id: "100000" for method: "client verify" occur timeout!
./cli publish --platform MP-WEIXIN --project ../project-client/ 报错:
2025-03-18 11:23:02.809 [WARNING:] [PluginHost] Error Code (PluginHost): -32603
2025-03-18 11:23:02.809 [WARNING:] [PluginHost] Error Stack (PluginHost):
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] Request commands/plugincommand failed with message: TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string. Received undefined
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at new NodeError (node:internal/errors:405:5)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at validateString (node:internal/validators:162:11)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at resolve (node:path:1097:7)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at t.getIsCli (/home/ubuntu/HBuilderX/plugins/uniapp-extension/out/index.js:32:468179)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at new t.default (/home/ubuntu/HBuilderX/plugins/uniapp-extension/out/index.js:32:259124)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at new v (/home/ubuntu/HBuilderX/plugins/uniapp-extension/out/index.js:32:531172)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at new h (/home/ubuntu/HBuilderX/plugins/uniapp-extension/out/index.js:32:526832)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at /home/ubuntu/HBuilderX/plugins/uniapp-extension/out/index.js:32:518597
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at Generator.next (<anonymous>)
2025-03-18 11:23:02.810 [WARNING:] [PluginHost] at /home/ubuntu/HBuilderX/plugins/uniapp-extension/out/index.js:32:517867

./HBuilderX 报错:
2025-03-18 11:14:19.793 [WARNING:] [PluginHost] node:internal/modules/cjs/loader:1143
throw err;
^

Error: Cannot find module '/home/ubuntu/HBuilderX/plugins/hbuilder.fswatcher/index.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
2025-03-18 11:14:23.024 [WARNING:] [PluginHost] Error: ENOENT: no such file or directory, scandir '/home/ubuntu/.local/share/HBuilder X/extensions/uts-development-android/native-file-mixin/5058f1af8388633f609cadb75a75dc9d'
at Object.readdirSync (node:fs:1525:3)
at r (/home/ubuntu/HBuilderX/plugins/uts-development-android/out/index.js:20:35805)
at /home/ubuntu/HBuilderX/plugins/uts-development-android/out/index.js:20:36157
at /home/ubuntu/HBuilderX/plugins/uts-development-android/out/index.js:20:36580
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: '/home/ubuntu/.local/share/HBuilder X/extensions/uts-development-android/native-file-mixin/5058f1af8388633f609cadb75a75dc9d'
}
2025-03-18 11:14:24.264 [WARNING:] [PluginHost] Failed to load single file bundle SyntaxError: Unexpected token ] in JSON at position 638
at JSON.parse (<anonymous>)
at p (/home/ubuntu/HBuilderX/plugins/plugin-manager/out.js:1:372081)
at v (/home/ubuntu/HBuilderX/plugins/plugin-manager/out.js:1:375268)
at Object.<anonymous> (/home/ubuntu/HBuilderX/plugins/uts-development-proxy/extension.js:5:3)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at h._load (/home/ubuntu/HBuilderX/plugins/plugin-manager/out.js:1:98359)
at Module.require (node:internal/modules/cjs/loader:1231:19)
Failed to load message bundle for file /home/ubuntu/HBuilderX/plugins/uts-development-proxy/extension
2025-03-18 11:32
y***@yeah.net

y***@yeah.net

回复 9***@qq.com :
如果系统是ubuntu 24.04,可以试试安装依赖:libharfbuzz0b和libgl1
2025-03-17 11:01
y***@yeah.net

y***@yeah.net

回复 6***@qq.com :
试试安装依赖:libharfbuzz0b和libgl1
2025-03-17 11:00
6***@qq.com

6***@qq.com

系统:
ubuntu:24.04 Linux HBuilderX cli 4.55-正式版
操作:
./cli open
提示:
-1 :open: 操作超时
2025-03-17 10:32
9***@qq.com

9***@qq.com

-1 :open: 操作超时
2025-03-16 08:20
y***@yeah.net

y***@yeah.net

回复 DCloud_HB_WDL :
cli pack --config xxxx.json
xxxx.json为配置文件完整路径
输出:
15:15:18.232 Check the cloud packing status...
15:15:18.530 Check packaging resources...
15:15:18.810 <ul style="margin-left: -30px; margin-top: -30px;"><li>[Warning] For the implementation of "network security law", "consumer rights and interests protects a law" requirements, effective governance App compulsory licensing, excessive SuoQuan, beyond the phenomenon such as collect personal information, ensure the security of personal information, the domestic each big market to strengthen the application review, act requires application must conform to the related policy, the current lack of related configuration, <a href="https://uniapp.dcloud.io/app/android-store"> see how to solve the </a>. No need to deal with domestic application market.</li></ul>
15:15:18.823 Compressing packaging resources...
15:15:22.936 Sending a package request to the cloud...
15:15:24.612 It will return download link automatically after packaging success. You can query packaging status through menu [publish]-[view status]. There is a long queuing line at peak hours on Friday evening. Please be patient. If it is for the 3rd party SDK debugging, use a custom base (menu run - mobile phone or simulator - make a custom base), and don't pack it repeatedly. Project 项目名称 [项目ID] has been successfully submitted to the cloud,Getting packaging status...
15:15:30.145 Package status of project a 项目名称 [项目ID] : Time:2025-03-14 15:15:24 Type:Android own certificate In queue [Output]At present, there are a large number of cloud packaging queues. The current packaging task is in the 309th place in the queue. It is expected to enter the packaging state within 16 minute.
您也可以使用付费独享打包机来减少排队时间,预计1分钟内进入打包状态,[点此链接立即加速](https://dev.dcloud.net.cn/pages/common/redirect?return_url=%2Fpages%2Fcloudbuild%2Fqueue%3Fappid%3D项目ID%26id%3D19234810-00a4-11f0-874e-9531f5b62dcd&token=aade58fb7994dcd08a0ca450958f6393)
-1 :cli: 通道被关闭
-1 :cli: 连接已断开
2025-03-14 15:54