【求助】使用命令行打包不会自动切换平台

  • Creator 版本: 2.4.12

  • 目标平台: MacOS

  • 重现方式:命令行打包选择不同平台的配置,无法自动切换打包平台

web配置:

   {
        "title": "test_web",
        "platform": "web-mobile",
         "embedWebDebugger": false,
        "sourceMaps": false,
        "debug": false,
        "md5Cache": true
    }

anroid配置:

   {
        "platform": "android",
        "title": "test_android",
        "template": "default",
        "appABIs": [
            "armeabi-v7a",
            "arm64-v8a"
        ],
        "orientation": {
            "landscapeLeft": true,
            "landscapeRight": true
        },
        "embedWebDebugger": true,
        "sourceMaps": false,
        "debug": true,
        "md5Cache": false,
        "encryptJs": true,
        "xxteaKey": "test"
   }

打包命令

/Applications/CocosCreator.app/Contents/MacOS/CocosCreator --path projectPath
--build configPath=android.json

/Applications/CocosCreator.app/Contents/MacOS/CocosCreator --path projectPath
--build configPath=web.json

使用完整路径试一下?

类是 F:/cocosdashboard/cocos-dashboard-editors/Creator/3.7.1/CocosCreator.exe --project D:/creator_p1 --build “configPath=D:/creator_p1/build/buildConfig_web-mobile_debug.json”

使用的是完整路径,手动在编辑器里切换好平台,再跑命令就可以

每当需要打多个平台包,都需要打开编辑器切换下平台… :cold_sweat:

可参考官方文档:https://docs.cocos.com/creator/2.4/manual/zh/publish/publish-in-command-line.html?h=命令行
在参数中加入 platform=平台名

修改bundle设置都要手动打包一次,再命令行打包,感觉这个功能半桶水的