Find amplify.yml in root of your repository and add command in your build phase:
Make env variable in your terminal. For example, if you use PowerShell:
$Env:TESTZG="some value"
Then run npx ampx sandbox
npx ampx sandbox