param([string]$CliPath = 'D:\Program Files (x86)\Tencent\微信web开发者工具\cli.bat') $ErrorActionPreference = 'Stop' $workspace = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent $workspace = Split-Path $workspace -Parent $project = Join-Path $workspace '.local-acceptance\mp-local-api-build' if (!(Test-Path -LiteralPath $CliPath)) { throw 'WeChat DevTools CLI not found; pass -CliPath.' } if (!(Test-Path -LiteralPath (Join-Path $project 'project.config.json'))) { throw 'Build the local acceptance project first.' } # GPU flag takes effect only when launching a fresh IDE process. No cache deletion. & $CliPath open --disable-gpu --project $project # CLI can return exit 0 even on permission failure; inspect its printed result.