npm run build,再执行 npx electron-builder --win --arm64(或 --x64)。dist\win-arm64-unpacked(或 dist\win-unpacked)。dist\win-arm64-unpacked\AndroidRemoteController.exe。win-arm64-unpacked 文件夹打包发过去即可,开包即用。前端资源(dist/index.html、dist/assets/)已打进该目录下的 resources\app.asar.unpacked\dist\,exe 会从这里加载页面,无需再带项目里的 dist。directories.output
打包输出目录。例如 "dist" 时,产物在 dist\win-arm64-unpacked 或 dist\win-unpacked。
files
打进 asar 的内容。当前为 ["dist/**","electron/**","configs/**","nodejs/**","python/**","lib/**"],不要漏掉运行时用到的目录。不要把 static 放进 files,static 不打包。
asarUnpack
不压进 asar、解出到 app.asar.unpacked 的目录。当前为 dist/**、nodejs/**、configs/**、lib/**、python/**。dist/** 保证前端页面和 assets(JS/CSS)在 win-arm64-unpacked\resources\app.asar.unpacked\dist\ 下,exe 从该路径加载,包可拷贝到任意电脑使用。
win.target
target: "dir":只输出目录,不打安装包。arch: ["arm64"] 或 ["x64"]:架构,与命令行 --arm64 / --x64 一致。window 窗口宽高、是否隐藏菜单栏。
adbPath.path
相对项目根的 adb 路径,默认 lib/scrcpy-adb/adb.exe。打包后以 app.asar.unpacked 为根解析,一般不用改。
pythonPath.path
Python 运行时目录,按 process.arch 用 python/arm64 或 python/x64,打包后同上。
static/(沙盒目录,不打包)
应用数据与工作流等存放目录。不列入 build.files,打包后不会在 asar 内。运行时使用与 exe 同级的 static 目录(即 dist\win-arm64-unpacked\static),首次运行会自动创建;主进程通过 STATIC_ROOT 环境变量传给子进程。
lib/scrcpy-adb/
需存在 adb.exe、scrcpy.exe 及 scrcpy 依赖 dll/bat;会被 files 打进包,在 unpacked 中供主进程和 node 脚本调用。
python/arm64 或 python/x64
按打包架构保留对应目录(内含嵌入式 Python 或 venv),仅在使用图像匹配/裁剪等流程时需要。打 arm64 包需有 python/arm64,打 x64 需有 python/x64。
base: './'
打包后的 exe 从“本地文件”打开页面。不设为 './' 时,js/css 链接会指到错误位置,白屏或报错;设为 './' 后为相对路径“当前目录下的 assets/xxx”,可正常加载。不要删或改成别的。
server 只影响开发时的地址和端口,与打 exe 无关。
构建产物
npm run build 会生成 dist 文件夹(index.html + assets 等)。打 exe 时会把 dist 打进包,exe 启动时加载此处的 index.html。
npm install、npm run build 时会按 package-lock.json 安装依赖,保证各环境版本一致、构建可复现。build.files 里),只用于本地/CI 的安装与构建。