GWA environment variables

Use the BROWSER and GWA_TARGET environment variables to control how and where GWA applications are launched.

BROWSER

To specify a different browser to the default one, use the BROWSER environment variable and set it to either chrome, firefox, safari, edge, or none. Setting BROWSER to none does not invoke a particular browser; instead, a message appears on the command line like this:

Copy the following URL into your browser: http://localhost:9101/d/r/index.html

GWA_TARGET

The GWA_TARGET environment variable defines the target platform or environment for the GWA app. It is used to specify where and how the GWA app should be launched.

Value Description Requirements
simulator Starts the GWA app in Safari Mobile in an open iOS Simulator (macOS only). Xcode must be installed.
emulator Starts the GWA app in the default browser of an open Android Emulator. You can specify the browser using the BROWSER variable (for example, BROWSER=chrome or BROWSER=firefox). Android SDK must be installed and commands like adb and emulator must be in the path.
android Starts the GWA app in the default browser of a USB-connected Android device. Same as for emulator, plus the phone must be in developer mode and all interactive USB connection dialogs about allowing debugging must be accepted.

Using GWA_TARGET and BROWSER together

GWA_TARGET BROWSER Result
(not set) chrome Launches Chrome on your local workstation.
android (not set) Launches the default browser on the connected Android device.
android chrome Launches Chrome on the connected Android device (if installed).
emulator (not set) Launches the default browser on the Android Emulator.
emulator firefox Launches Firefox (if installed) on the Android Emulator.
simulator (any) Always launches Safari Mobile on the iOS Simulator. The BROWSER setting is ignored.

If BROWSER is not set, the default browser for the target platform is used. When GWA_TARGET is not set, the application runs on your local workstation.