Showing posts with label Termux. Show all posts
Showing posts with label Termux. Show all posts

Monday, September 2, 2024

Installing and Using twine in Termux on Android

The guide provided outlines how to set up and use `twine` in Termux on an Android device. Here's a summary of the steps involved:

1. **Install Termux**: Obtain and install Termux from the Google Play Store or F-Droid.
2. **Update Termux Packages**: Open Termux and update the package list with `pkg update` and upgrade all packages with `pkg upgrade`.
3. **Install Python**: Use Termux’s package manager to install Python with `pkg install python`.
4. **Install Rust (Optional)**: If required by dependencies, install Rust using `pkg install rust`.
5. **Install `twine`**: Install `twine` using pip with `pip install twine`.
6. **Use `twine`**: Upload packages to PyPI with `twine upload dist/*`.
7. **Configure Python Environment (Optional)**: For multiple projects, set up a virtual environment using `pip install virtualenv` and `virtualenv myenv`, then activate it with `source myenv/bin/activate`.
8. **Install Additional Dependencies**: Install any additional dependencies as needed.

### Notes:
- Termux may have different package behavior compared to standard Linux distributions.
- Compiling packages can be resource-intensive, so ensure your device has adequate resources.

This setup allows for managing Python packages and dependencies on an Android device using Termux.

Saturday, August 3, 2024

How to Access Shared Storage on Android Using Termux

Access Android Storage in Termux – Complete Step-by-Step Guide

๐Ÿ“ฑ Access Android Storage Using Termux (Step-by-Step Guide)

Imagine turning your Android phone into a mini Linux system. With Termux, you can do exactly that—and even access your phone’s internal storage like a pro.


๐Ÿ“š Table of Contents


๐Ÿค” Why Access Storage?

Accessing shared storage allows you to:

  • Edit files directly from terminal
  • Run scripts stored on your phone
  • Manage downloads efficiently
  • Use Linux tools on Android files

๐Ÿ” Step 1: Grant Storage Permission

termux-setup-storage

This command:

  • Requests permission from Android
  • Creates a storage folder
  • Adds shortcuts to common directories

๐Ÿ“‚ Step 2: Access Shared Storage

cd /storage/emulated/0

This takes you to your phone’s internal storage root.

Think of it as “C:\ drive” but for Android.

๐Ÿ“Œ Practical Example

Go to Downloads Folder

cd /storage/emulated/0/Download

Now you can:

  • List files → ls
  • Edit files → nano file.txt
  • Run scripts → bash script.sh

⚡ Using Termux Shortcuts

After setup, a shortcut directory is created:

cd ~/storage

Inside you’ll find:

  • downloads → Download folder
  • dcim → Camera images
  • music → Audio files
These are symbolic links (shortcuts), not actual folders.

๐Ÿ–ฅ️ CLI Output Example

Click to Expand
$ termux-setup-storage
Storage permission granted.

$ cd ~/storage
$ ls
downloads  dcim  music  pictures

$ cd downloads
$ ls
file1.txt  script.sh  image.png 

๐Ÿ› ️ Pro Tips

  • Always run termux-setup-storage once after install
  • Use shortcuts (~ /storage) for faster navigation
  • Avoid deleting system files
  • Use pwd to confirm location

๐Ÿ’ก Key Takeaways

  • Termux can access Android storage easily
  • Permissions are required once
  • Shortcuts simplify navigation
  • You can fully manage files via terminal

๐ŸŽฏ Final Thoughts

Once you unlock storage access in Termux, your Android device becomes far more powerful.

You’re no longer limited to apps—you’re working like a true Linux user.

Featured Post

How HMT Watches Lost the Time: A Deep Dive into Disruptive Innovation Blindness in Indian Manufacturing

The Rise and Fall of HMT Watches: A Story of Brand Dominance and Disruptive Innovation Blindness The Rise and Fal...

Popular Posts