Setting PATH Environment Variables
Operating systems use the environment variable called PATH to locate executable files on your system. To ensure that the CLI can reference Apksigner, set the PATH environment variable as follows:
Windows
- To set the path to your signing tools via the command line, run the
following command:
set PATH=%path%;<path to Apksigner>Example:set PATH=%path%;C:\Users\<username>\AppData\Local\Android\Sdk\build-tools\33.0.2\lib - To set the path to your signing tools for your system or account,
follow these steps:
- Search for "environment variables" in the Windows start menu.
- Select "Edit environment variables for your account" or "Edit system environment variables."
- Double-click on the "Path" variable.
- Click "New."
- Select "Browse" and choose the path to the signing tool.
- Click "OK" to save the path.
- Click "OK" again to close the dialog.
Linux
- To set the path to your signing tools via the command line, open the
Terminal application and open the ~/.profile file in an editor:
nano ~/.profile - Add the following export definition for the PATH:
export PATH=<Path to Apksigner>Example: export PATH=/path/to/Apksigner
- Press CTRL+X to exit, press Y to save, and press Enter to keep the same file name.
- Execute the new .profile by restarting the Terminal or using the command:
source ~/.profile