Follow these steps to generate the token.pickle
file on Android using Termux.
Download and install Termux.
Open Termux and run this command to update, install necessary packages, and set up Python:
pkg update && pkg upgrade -y && pkg install git python python-pip -y && python -m pip install --upgrade pip && pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
First, Give Termux storage access:
termux-setup-storage
Now nevigate to the Internal Storage:
cd /sdcard
Run the following to clone the TokenPickle
repository:
git clone https://github.com/rjriajul/TokenPickle
cd TokenPickle
Then Move the credentials.json
file to your phone’s internal storage.
cp /sdcard/credentials.json /data/data/com.termux/files/home/TokenPickle
Navigate to the project folder and run the script:
python3 generate_token.py
Copy the URL displayed, open it in a browser, and log in to your Google account. After successful authentication, you’ll see the message:
“The authentication flow has completed. You may close this window.”
Copy the generated token to your phone's storage:
cp token.pickle /sdcard
You’ll find token.pickle
in your phone’s internal storage.