A tool to automate the manual activation of unity license using puppeteer
This is a fork from MizoTake/unity-license-activate.
This tool is design to use with GameCI and personal license (free version) users. Personal license will expire after some times, then you most likely would have to repeast the step Activation - Personal License in order to keep the CI running. Thankfully, you can use this tool to constantly activate a new license from Unity's licensing system.
You can use this tools with any CI/CD system as long as you have the Node environment set up! Here is an example for GitHub Actions.
It needs Node.js 22.12 or newer.
jobs:
acquire_ulf:
name: Acquire .ulf file π
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install node package, `unity-license-activate`
run: npm install --global unity-license-activate
- name: Activate the license
run: unity-license-activate "${{ secrets.UNITY_EMAIL }}" "${{ secrets.UNITY_PASSWORD }}" "${{ needs.request_alf.outputs.alf }}"
- name: Read ulf
id: ulfRead
uses: juliangruber/read-file-action@v1.1.4
with:
path: ${{ env.ULF_FILE }}
- name: Update secret UNITY_LICENSE
uses: hmanzur/actions-set-secret@v2.0.0
with:
name: 'UNITY_LICENSE'
value: '${{ steps.ulfRead.outputs.content }}'
token: ${{ secrets.ACCESS_TOKEN }}See the full example here.
Unity requires you to enter a 6 digit verification code when signing in. This project supports two types of verification code:
Authenticator App is the preferred option when TFA is explicitly enabled on an account.
To get past this, specify your original authenticator key and unity-license-activate will generate a TOTP automatically.
- name: Activate the license
run: unity-license-activate ... --authenticator-key "${{ secrets.UNITY_TOTP_KEY }}"- Login to Unity account and activate new two factor authentication.
Go to https://id.unity.com/en/settings/tfa/new and click
Start setup
- Select
Authenticator Appand clickNext
- Click
Can't scan the barcode?. Find and save the authenticator key
- Verify activation with Google Authenticator. You can also verify using a QR code

Email is the default option when you have not enabled TFA on your account: after signing in, Unity shows a "Security check" page and emails you a verification code.
This tool reads that code from your inbox over IMAP with unity-verify-code, which is installed along with it. Follow its prerequisites to allow IMAP access to your inbox. It currently knows the IMAP servers of Gmail, Outlook/Hotmail, Yahoo, Foxmail and QQ addresses only.
If your Unity account and your email account have different passwords, pass the
email password with --email-password:
- name: Activate the license
run: unity-license-activate ... --email-password "${{ secrets.EMAIL_PASSWORD }}"You should have 3 ~ 4 GitHub secrets to correctly set up the entire workflow.
UNITY_EMAIL- Email address that you use to login to UnityUNITY_PASSWORD- Password that you use to login to UnityACCESS_TOKEN- Use to update secretUNITY_LICENSE, see hmanzur/actions-set-secret#tokenEMAIL_PASSWORD(optional) - Use to get pass Unity's Two Factor Authentication,UNITY_PASSWORDis used by default assuming your passwords are the same.UNITY_TOTP_KEY(optional) - Use to pass Unity's Two Factor Authentication,
For some reason, if this plugin does not work. Try configure your workflow file like this,
- name: Activate the license
run: unity-license-activate "${{ secrets.UNITY_EMAIL }}" "${{ secrets.UNITY_PASSWORD }}" "${{ needs.request_alf.outputs.alf }}"
# Add the error handling step here!
- name: π©Ί Upload error screenshot
if: failure()
uses: actions/upload-artifact@v7
with:
name: screenshot_error
path: error.pngThe program generates a error.png file if something went wrong. Then you can
download and see what's the last step before the program is exited. It also logs a
short summary of the page (field names, button labels, no values) to the job log.
Note: artifacts of public repositories can be downloaded by anyone, and the screenshot may show your account's email address. Upload it only from private repositories, or rely on the logged page summary instead.
usage : unity-license-activate EMAIL [EMAIL ...] PASSWORD [PASSWORD ...] ALF [ALF ...]
Unity License Activate : Activate Unity license through CLI.
positional arguments:
EMAIL Username or Email you use to register for Unity account
PASSWORD Password to login Unity account
ALF Unity activation license file pathThis repository is Apache 2.0 licensed.
This includes all contributions from the community.

