termux

Stars and mentions

Last 30 days, Oct 5 – Nov 3

GitHub stars1,705
mentions28
0275481108Oct 5Oct 19Nov 3
UTC days · repositories termux owns2 repositories

Package downloads

No package download history available yet.

Top repositories

termux’s repositories ranked by new stars, as on trending.

Loading

Contributes to

Repositories outside termux’s account where termux opened or reviewed pull requests in the past 365 days.

Who noticed termux

Everyone who starred or forked termux’s repositories since the archive began in 2011.

Notable accounts

Ordered by the stars their own repositories have received.

Biggest fans

Accounts that starred the most of these repositories.

Breakout weeks

Each repository’s best week of new stars, with the release published around it.

Mentions

28posts
Nov 40 posts
  1. Reddit · · r/flossdroid · u/IiImochidoll · termux/termux-x11

    Try Linux on Android - Termux XFCE Installation (for beginners) Requirements | Resource | Amount | |----------------|--------| | RAM | 4GB | | Storage | 3GB | | Internet Data | 450MB | APK - Termux: termux/termux-app - Termux X11: termux/termux-x11 Permissions - Notification: important to edit preferences and to stop the app - Storage: necessary to read-write files Installation 1. Open Termux, then allow storage access: termux-setup-storage 2. Change repository: termux-change-repo 3. Update & upgrade: pkg update && pkg upgrade -y 4. Hide welcome message: touch ~/.hushlogin 5. Add repositories: pkg in tur-repo x11-repo termux-x11-nightly 6. Install the essentials: pkg in xfce4 ffmpeg ffmpegthumbnailer mousepad ristretto neofetch firefox vlc-qt xfce4-whiskermenu-plugin 7. Start the desktop: termux-x11 :0 -xstartup "dbus-launch --exit-with-session xfce4-session" 8. Open Termux X11 Enjoy Linux!

    35 points · 4 comments
  2. termuxでミラーサイトを更新する方法 termuxでミラーサイトを更新する 問題意識 termuxでパッケージを更新する際、毎回世界中のミラーサイトを巡回してからダウンロードを始めていたのでダウロードが遅かった。 解決方法 ミラーサイトを更新すれば良い。以下の手順でできた。 以下のtermux-tools パッケージの一部のtermux-change-repoスクリプトを実行する。 termux-change-repo 以下の画面が表示されるので Signle mirrorを選択 次の画面が表示されるので お近くのmirrorsを選択。日本の場合はMirrors in Asiaを選択。 参照 公式ドキュメント あとがき 良ければハートやフォロー、X:@w4daka_tterのフォロー、Github:@w4dakaのフォローお願いします。

  3. How to Build Your Own Smart AI Assistant Using Only Your Android Phone (Termux + Python) How to Build Your Own Smart AI Assistant Using Only Your Android Phone (Termux + Python) Have you ever wanted to build your own AI assistant but assumed you needed an expensive computer, powerful graphics card or years of programming experience? What if I told you that you could build a working AI assistant using nothing more than your Android phone? You don't need a laptop. You don't need an expensive development environment. You don't even need to be an experienced programmer. With Termux, Python and an AI API, you can create a personal AI assistant directly from your Android device. In this tutorial, we're going to build one step by step. But we're not going to stop at creating a basic chatbot that simply accepts a question and returns an answer. We'll build an assistant that has: - Its own personality and instructions. - The ability to hold conversations. - Short-term conversational memory. - A customizable name. - The ability to remember previous messages during a session. - Commands to reset conversations and exit. - Basic error handling. - A simple terminal interface. By the end, you'll understand how the different parts work and how to extend the project into something more advanced. You can follow this tutorial even if you've never built an AI application before. Let's get started. 1. First, Understand What We're Building Before installing anything, let's understand how our assistant will work. An AI assistant generally has several components. 1. The interface This is where you communicate with your assistant. In our project, the interface will be the Termux terminal. 2. The programming language We'll use Python to handle the application's logic. Python will receive your messages, organize conversation history and communicate with the AI service. 3. The AI model This is the component responsible for understanding questions and generating intelligent responses. Instead of training a massive AI model ourselves, we'll connect our application to an existing model through an API. 4. Memory We'll create a system that keeps previous messages during the conversation. This allows the assistant to understand follow-up questions. For example: You: My name is Daniel. Assistant: Nice to meet you, Daniel! You: What is my name? Assistant: Your name is Daniel. Without conversation history, the assistant might not understand the second question. 5. Personality and instructions We'll give our assistant specific instructions about how it should communicate, explain things and respond to users. This is what makes it behave more like a personal assistant rather than a generic chatbot. How everything connects Our application will follow this process: 1. You enter a message. 2. Python receives the message. 3. Python adds it to the conversation history. 4. The application sends the conversation to the AI model. 5. The AI generates a response. 6. Python displays the response. 7. The conversation history is updated. That's the basic architecture. An important distinction: Termux and Python will run on your phone, but the AI model will run on a remote server. Therefore, this first version requires an internet connection. Your phone is building and controlling the assistant, not performing the expensive AI inference itself. 2. What You Need Before Starting You only need three main things. A. An Android phone Any reasonably modern Android device supported by the current Termux release should be suitable for this lightweight project. You don't need a flagship phone. Our application will not be running a massive language model locally. B. Termux Termux is an Android terminal emulator and Linux environment. It allows you to run programming languages, install development packages and execute commands directly from your phone. Download it from an official distribution linked by the Termux project. - Termux website: termux.dev - Official GitHub repository: termux/termux-app Avoid mixing Termux installations from different distribution sources. Its companion applications and plugins should come from the same source. C. An AI API key We'll use an AI API to connect our Python application to an existing language model. An API allows one application to communicate with another application or service. For example, instead of building a language model capable of understanding thousands of different questions, we send the question to an existing AI model and receive its response. You can explore available models and API access through: platform.openai.com You may need to create an account and configure API billing. Important: API usage may cost money. Check the current pricing and your account's available access before making requests. Also, an API key is a private credential. Never publish it in your code, GitHub repository or screenshots. 3. Prepare Termux for Development Open Termux. You should see a terminal where you can enter commands. Don't worry if this looks unfamiliar. We'll explain what each command does. First, update the installed package information. Enter: pkg update && pkg upgrade -y This checks for available package updates and installs them. Next, install Python: pkg install python -y Python is the programming language we'll use to build the assistant. Check whether the installation was successful: python --version You should see a Python version displayed. Now install Git: pkg install git -y Git is a version-control tool that helps developers manage changes to their projects. We won't need Git for the basic assistant, but it's useful to have when developing larger applications. Next, upgrade pip: python -m pip install --upgrade pip Pip is Python's package installer. It allows us to install additional libraries. Our development environment is now ready. 4. Create Your AI Assistant Project Let's create a dedicated folder for the project. Enter: mkdir smart-ai This creates a directory called "smart-ai". Move into it: cd smart-ai Your terminal is now working inside the project directory. Let's create a Python virtual environment. python -m venv venv A virtual environment gives your project its own Python package installation space. Activate it: source venv/bin/activate If activation succeeds, you should see something similar to "(venv)" at the beginning of your terminal prompt. This helps keep project dependencies separate from other Python projects. Now install the official OpenAI Python library: python -m pip install openai Wait for the installation to finish. The library allows our Python application to communicate with the OpenAI API without manually constructing every HTTP request. We are now ready to write the actual assistant. 5. Create Your AI API Key Before writing the code, we need to configure access to the AI model. Visit: platform.openai.com Sign in and navigate to the API key section. Create a new secret API key. Copy it somewhere temporarily safe. Do not share it with anyone. Return to Termux. Enter: export OPENAI_API_KEY="YOUR_API_KEY_HERE" Replace "YOUR_API_KEY_HERE" with your actual API key. For example, the command should follow this structure: export OPENAI_API_KEY="sk-your-private-key" The example above is illustrative, not a working key. This command creates an environment variable that Python can access. Why not simply put the API key inside the Python script? Because separating credentials from application code reduces the chance of accidentally exposing them when sharing your project. Remember that environment variables set this way generally apply to the current shell session. You'll need to configure the key again when starting a new session unless you set up a secure alternative. Never upload your real key to GitHub. 6. Create the Main AI Assistant Now comes the exciting part. We're going to create the actual application. Create a Python file: nano assistant.py Nano is a terminal text editor. Paste the following complete code into the editor. import os from openai import OpenAI Check API credentials API_KEY = os.getenv("OPENAI_API_KEY") if not API_KEY: print("Error: OPENAI_API_KEY is not configured.") raise SystemExit(1) Initialize AI client client = OpenAI(api_key=API_KEY) Choose a model available to your account MODEL = os.getenv("OPENAI_MODEL", "gpt-6-luna") Assistant personality SYSTEM_PROMPT = """ You are Nova, a smart and helpful personal AI assistant. Your responsibilities: 1. Give accurate and useful answers. 2. Explain complicated topics in simple language. 3. Be friendly, respectful and conversational. 4. Ask for clarification when a question is unclear. 5. Avoid inventing information. 6. Admit when you do not know something. 7. Help users solve problems step by step. 8. Keep simple questions concise. 9. Provide detailed explanations when necessary. You should behave like a thoughtful personal assistant, not a machine that simply generates random text. """ Conversation history conversation = [ { "role": "system", "content": SYSTEM_PROMPT } ] Display welcome screen def welcome(): print("\n" + "=" * 45) print(" NOVA AI ASSISTANT") print("=" * 45) print("Your personal AI assistant") print("Powered by Python and an AI model") print("\nCommands:") print("/reset - Start a new conversation") print("/exit - Close the assistant") print("=" * 45) Generate AI response def generate_response(user_message): conversation.append({ "role": "user", "content": user_message }) try: response = client.responses.create( model=MODEL, input=conversation ) answer = response.output_text conversation.append({ "role": "assistant", "content": answer }) return answer except Exception as error: conversation.pop() print("\nSomething went wrong:") print(error) return None Main application def main(): welcome() while True: try: user_message = input("\nYou: ").strip() if not user_message: continue # Exit command if user_message.lower() == "/exit": print("\nNova: Goodbye! See you again.") break # Reset conversation if user_message.lower() == "/reset": conversation.clear() conversation.append({ "role": "system", "content": SYSTEM_PROMPT }) print("\nNova: Conversation reset!") continue # Generate answer print("\nNova is thinking...") answer = generate_response(user_message) if answer: print("\nNova:", answer) except KeyboardInterrupt: print("\n\nNova: Assistant stopped.") break if name == "main": main() Save your file If you're using Nano: 1. Press CTRL + O. 2. Press Enter to confirm the filename. 3. Press CTRL + X to exit. Your Python application is now saved. What did we just create? Let's understand the important sections. The API connection client = OpenAI(api_key=API_KEY) This initializes the API client. It allows our application to communicate with the AI service. The assistant's personality SYSTEM_PROMPT = """ You are Nova, a smart and helpful personal AI assistant. """ This defines the assistant's behaviour. You can change the instructions to create a different personality. For example, you could build: - A programming tutor. - A personal study assistant. - A business assistant. - A writing assistant. - A research assistant. The underlying AI model remains the same, but the instructions influence how it responds. The conversation memory conversation = [ { "role": "system", "content": SYSTEM_PROMPT } ] This creates the initial conversation history. Every user message and assistant response is added to this list. When we send the conversation to the model, it receives the available context. This is how our assistant can understand follow-up questions. However, this is short-term conversational memory, not permanent personal memory. The conversation currently exists in the running Python process. Closing the application clears it. The AI response response = client.responses.create( model=MODEL, input=conversation ) This is where the actual AI interaction happens. We send the conversation to the Responses API. The model processes the information and generates a response. We then retrieve the generated text: answer = response.output_text Finally, the application displays it in Termux. 7. Run Your AI Assistant for the First Time Now let's test everything. Make sure you're still inside the "smart-ai" directory and your virtual environment is activated. Run: python assistant.py If everything is configured correctly, you should see: ============================================= NOVA AI ASSISTANT ============================================= Your personal AI assistant Powered by Python and an AI model Commands: /reset - Start a new conversation /exit - Close the assistant ============================================= You: Congratulations! You have created your first AI-powered assistant using only your Android phone. Try asking: Hello, who are you? Then: Explain artificial intelligence to me. Now test its conversational memory: My name is Daniel. Follow that with: What is my name? The assistant should use the previous message to answer. You can also test: /reset This clears the current conversation. And: /exit This closes the application. If the model identifier in the example is not available to your API account, check the provider's current model catalogue and set another supported model: export OPENAI_MODEL="YOUR_AVAILABLE_MODEL" Then run the application again. 8. How to Make Your Assistant Smarter At this stage, you have a functioning AI assistant. But what makes it smart? The language model provides the intelligence. Our Python application controls how that intelligence is accessed and presented. There are several ways to improve the assistant. A. Give It a Better Personality You can change the system instructions. For example, replace the original personality with: SYSTEM_PROMPT = """ You are Atlas, an intelligent learning assistant. Your mission is to help people understand technology, science, programming and everyday problems. Always explain difficult concepts using simple examples. When teaching programming: 1. Explain the concept. 2. Show a practical example. 3. Explain the code. 4. Identify common mistakes. 5. Give the learner a small exercise. Never pretend to know something you do not know. Prioritize understanding over simply giving answers. """ Now you have a learning-focused assistant. B. Give It a Different Name Find: print("NOVA AI ASSISTANT") Replace it with: print("ATLAS AI ASSISTANT") You can also change the name inside the system instructions. C. Limit Conversation History Our current application sends the entire conversation history with every request. This is useful for understanding previous messages, but long conversations can become expensive and eventually exceed the model's context limit. A simple improvement is to retain only the most recent messages. For example, after adding an assistant response, you could use: conversation[:] = [ conversation[0] ] + conversation[-20:] This retains the system instructions and the latest 20 conversation messages. For a production application, history management should be more careful so that user and assistant messages remain properly paired. D. Make It Remember Conversations Between Sessions Currently, closing Termux clears the conversation. You can extend the project by saving conversation history to a local JSON file. Python includes a built-in library for this: import json You could save the conversation using: with open("memory.json", "w") as file: json.dump(conversation, file, indent=4) And load it when the application starts: with open("memory.json", "r") as file: conversation = json.load(file) These are basic examples. A complete implementation should handle missing files, invalid JSON, reset behaviour and private data. Also, understand the distinction between conversation history and long-term memory. Conversation history stores what was said. A more advanced memory system identifies useful information, stores it separately and retrieves relevant details when needed. You could eventually give your assistant the ability to remember a user's preferred programming language, ongoing projects or learning goals. However, users should have control over what is stored and the ability to delete it. 9. Troubleshooting Common Problems If something doesn't work, don't immediately assume your phone is incompatible. Here are some common problems. Problem 1: Python command not found You probably haven't installed Python correctly. Run: pkg install python Then check: python --version Problem 2: No module named openai The Python library may not have been installed in your active environment. Activate your virtual environment: source venv/bin/activate Install the library: python -m pip install openai Problem 3: API key not found Check whether your environment variable exists: echo $OPENAI_API_KEY If it is empty, configure your API key again: export OPENAI_API_KEY="YOUR_API_KEY" Problem 4: Authentication error Check that: - Your API key is correct. - Your key has not been revoked. - Your API account has access. - Your account has the necessary billing configuration. Never share your API key when requesting technical assistance. Problem 5: Model not found The model name might not be available to your account. Check the provider's current model documentation and select an accessible model. Problem 6: Connection errors The application needs internet access. Check your connection and try again. Remember that Termux runs on Android, so Android may also restrict background processes or terminate long-running sessions. For this beginner project, keep Termux open while using the assistant. 10. What Can You Build Next? You now have a basic AI assistant. But this is only the beginning. The interesting part of software development is taking a working foundation and gradually introducing more useful features. Here are some ideas. 1. Voice assistant Add speech recognition so that users can speak instead of typing. You could also add text-to-speech so the assistant can read responses aloud. 2. Web interface Instead of communicating through the terminal, create a browser-based interface using Python and a lightweight web framework. You could build a proper chat interface with message bubbles, a conversation sidebar and a responsive design. 3. Document assistant Allow users to provide documents and ask questions about their contents. For example, a student could provide study notes and ask the assistant to explain particular sections. 4. Programming assistant Create a specialized assistant that explains programming errors, reviews code and helps beginners understand unfamiliar concepts. 5. Long-term memory Develop a system that stores useful information between conversations. You could use SQLite or another database to organize saved information. 6. Tool integration Eventually, your assistant could perform useful actions rather than simply answering questions. For example, it could calculate values, organize information or interact with approved external services. This is an important step towards building an AI agent. An AI chatbot responds to messages. An AI agent can also use tools to complete tasks, subject to the permissions and rules you give it. 11. Can You Build an AI That Works Completely Offline? Yes, but it is a different project. The assistant we created uses a remotely hosted model. If your internet connection disappears, it cannot generate new AI responses. A completely offline assistant requires a language model that can run locally on your Android device. Projects such as llama.cpp explore running language models on different hardware platforms. However, local AI has additional requirements. Your device needs sufficient: - Available storage. - RAM. - Processing power. - Compatible software. - Battery capacity. Larger models generally require more resources. A small quantized model may be practical on some devices, while a larger model might be extremely slow or fail to run because of memory limitations. Termux also has Android-specific compatibility considerations. Don't assume that every Linux AI installation tutorial will work on Android without modification. For a beginner, starting with an API-powered assistant is usually easier. Once you understand how the application works, you can experiment with local inference. 12. Final Thoughts: You Don't Need an Expensive Computer to Start Building AI One of the biggest barriers to learning software development is the belief that you need expensive equipment before you can begin. That's not always true. An Android phone can provide a surprisingly useful development environment. With Termux and Python, you can experiment with programming, create small applications and communicate with powerful AI models. Of course, a phone has limitations. A larger screen and more powerful hardware make complex development easier. But the most important thing is getting started. You now understand how to: - Prepare a Python development environment. - Install programming libraries. - Connect an application to an AI API. - Create an assistant personality. - Manage conversational context. - Handle basic errors. - Extend an AI application with additional features. Don't just copy the code and stop there. Change the assistant's name. Experiment with its personality. Add new commands. Try saving conversations. Break something, investigate it and fix it. The best way to become a developer is not simply to follow tutorials. It is to understand what you're building and gradually become confident enough to create your own solutions. If you managed to build Nova, you've already taken your first practical step. Your phone is not just a device for consuming technology. It can also be a tool for creating it. --- A little more inspiration I believe technology becomes most valuable when it helps people solve real problems. That is also an idea behind AfriWidget, a project focused on building practical digital tools for education, productivity and everyday needs. If you're interested in seeing how relatively simple web technologies can become useful products, take a look at "AfriWidget" (afriwidget.com). You don't always need to build the biggest technology to make a meaningful difference. Sometimes, solving one problem properly is a great place to start. --- Further Reading - "Termux official documentation" (termux.dev) - "Termux GitHub repository" (termux/termux-app) - "Python documentation" (docs.python.org) - "OpenAI API documentation" (platform.openai.com) - "OpenAI API pricing" (platform.openai.com) - "llama.cpp GitHub repository" (ggml-org/llama.cpp) Disclaimer: This tutorial demonstrates an API-powered AI assistant for educational purposes. API availability, model identifiers, account requirements and pricing can change. Keep your API credentials private and review your provider's current terms before using the application.

  4. こっちは未マージ termux-app#5238

    34 views
  5. GNOME Desktop is now available in termux! preview.redd.it termux-packages#32883 Tras muchos intentos, tazas de café y pruebas, y gracias al esfuerzo monumental de la comunidad para integrar GNOME Shell en Termux, ¡lo hemos conseguido! Es 100% funcional; funciona incluso sin aceleración gráfica por hardware, ¡e incluso se ejecuta dentro de una sesión VNC! Puedes descargar los archivos de la solicitud de extracción y probarlos tú mismo. Por fin tenemos otro entorno de escritorio completamente funcional en Termux: una excelente alternativa para quienes no somos especialmente aficionados a KDE.

    15 points · 9 comments
  6. 🚀 TERMUX — TURN YOUR ANDROID PHONE INTO A POWERFUL TERMINAL!💻📱 📥 DOWNLOAD TERMUX FROM THESE SOURCES GitHub Releases: github.com/termux/termux-app/releases F-Droid : f-droid.org #Termux #Android #Linux #Programming #Python #OpenSource #CyberSecurity @Noisbethever t.co

    11 views
  7. AndroidスマホだけでJavaアプリをビルドする:Termux+Ubuntu 24.04環境構築 はじめに PCやGitHub Actionsを使わず、Androidスマートフォン1台でAndroidアプリをビルドできる環境を作りました。 使用したのは Termux+Ubuntu+OpenJDK 17+Android SDK+Gradle。最初はSDKの導入やARM64環境でのビルドにつまずきましたが、最終的にはJava製アプリのDebug APKを作成し、同じスマホへインストールして起動できました。その後、Google Play向けの署名付きAABも作成しています。 この記事では、実際に動いた手順と、エラーが出た箇所を中心に記録します。Android Studioやエミュレーターは使用していません。 ! 2026年10月時点の手順です。Android SDKやGradle、配布されるARM64用ツールの状況は変わるため、バージョンが異なる場合は読み替えてください。 検証環境 項目 環境 端末 Google Pixel 8 OS / CPU Android 17 / ARM64(aarch64) Linux Termux上のUbuntu 24.04(PRoot-Distro) Java OpenJDK 17 Android SDK Platform 37.0、Build Tools 37.0.0 Android Gradle Plugin 9.2.0 Gradle 9.4.1(Gradle Wrapper) ソース管理 Git / GitHub 前提として、Termuxはインストール済みで、ビルドするAndroid/JavaプロジェクトはGitHub上に作成済みとします。以下では「Termuxで実行」と「Ubuntuで実行」を区別します。 1. TermuxにUbuntuを導入 まずTermuxのパッケージを更新し、PRoot-Distroをインストールします。 Termuxで実行(準備): pkg update && pkg upgrade -y pkg install -y proot-distro git 続けて、Ubuntu 24.04をインストールします。これは初回のみ実行します。 Termuxで実行(Ubuntuのインストール): proot-distro install ubuntu:24.04 インストール後は、以下のコマンドでUbuntuにログインします。次回以降も、Ubuntuを使うときはこのコマンドから始めます。 Termuxで実行(Ubuntuへのログイン): proot-distro login ubuntu これでUbuntuのシェルに入ります。Ubuntu内ではrootユーザーとして作業したため、以降のSDKパスは /root/android-sdk としています。 すでに導入済みのUbuntuは proot-distro list で確認できます。再インストールは不要です。 2. UbuntuにJava 17を導入 ここからUbuntuで実行: apt update apt install -y --no-install-recommends \ openjdk-17-jdk-headless git curl unzip ca-certificates java -version javac -version uname -m openjdk version "17..." と aarch64 が表示されれば、JavaとCPUアーキテクチャを確認できます。 AndroidのOSバージョンとJDKのバージョン番号を一致させる必要はありません。今回のプロジェクトではJDK 17を選びました。 3. Android SDK Command-line Toolsを導入 Android Studioを入れずに、Google公式のCommand-line Toolsを使います。 Ubuntuで実行: export ANDROID_HOME=/root/android-sdk mkdir -p "$ANDROID_HOME/cmdline-tools" cd /tmp curl -fL \ dl.google.com \ -o cmdline.zip unzip -q cmdline.zip -d "$ANDROID_HOME/cmdline-tools" mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" \ "$ANDROID_HOME/cmdline-tools/latest" rm cmdline.zip パスを設定します。 cat >> ~/.bashrc <<'EOF_BASHRC' export ANDROID_HOME=/root/android-sdk export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH" EOF_BASHRC source ~/.bashrc sdkmanager --version .bashrc にすでに同じ環境変数がある場合は重複させないようにします。 つまずき:SDK Platformが見つからない 最初に以下を試したところ、パッケージが見つからないという警告が出ました。 sdkmanager "platforms;android-37" "build-tools;37.0.0" 今回の環境では、Platform側の名前が android-37.0 でした。そこで次の指定に変更しています。 sdkmanager --sdk_root="$ANDROID_HOME" --channel=3 \ "platforms;android-37.0" \ "build-tools;37.0.0" sdkmanager --licenses --channel=3 はCanaryを含むチャンネルを対象にします。別バージョンを使用する場合は、いきなり上の名前を使うのではなく、次のコマンドで配布されている名前を確認してください。 sdkmanager --list --channel=3 ls -ld "$ANDROID_HOME/platforms/android-37.0" ls -ld "$ANDROID_HOME/build-tools/37.0.0" ライセンスの内容を確認して同意します。 4. ARM64版Build Toolsを使えるようにする ここが今回の大きな難所でした。 Android SDKの標準Build ToolsにはPC向けのネイティブ実行ファイルが含まれ、ARM64スマホ上ではそのまま動かないものがあります。そこで、コミュニティが配布するARM64向けのBuild Tools実行ファイルを利用しました。 使用した配布元: amirghm/android-sdk-tools-arm64 Ubuntuで実行: mkdir -p /root/android-arm64 cd /root/android-arm64 BASE="github.com/amirghm/android-sdk-tools-arm64/releas…" curl -fLO "$BASE/build-tools-37.0.0-android-arm64.tar.gz" curl -fLO "$BASE/SHA256SUMS" sha256sum --ignore-missing -c SHA256SUMS tar -xzf build-tools-37.0.0-android-arm64.tar.gz ./build-tools/37.0.0/aapt2 version チェックサムとツールの起動を確認します。今回は、Google公式のSDKパッケージを先にインストールしたうえで、次の6つの実行ファイルを差し替えました。 SRC=/root/android-arm64/build-tools/37.0.0 DST=/root/android-sdk/build-tools/37.0.0 BACKUP=/root/android-build-tools-backup/37.0.0 mkdir -p "$BACKUP" for tool in aapt aapt2 aidl zipalign dexdump split-select; do test -f "$SRC/$tool" && test -f "$DST/$tool" || { echo "ERROR: $tool が見つかりません"; break; } test -e "$BACKUP/$tool" || cp -p "$DST/$tool" "$BACKUP/$tool" cp -p "$SRC/$tool" "$DST/$tool" echo "OK: $tool" done "$DST/aapt2" version ! ここで利用したARM64版のバイナリはGoogle公式配布物ではありません。配布元、ライセンス、チェックサムを確認して利用してください。また、SDKを更新すると標準バイナリで上書きされる可能性があります。 5. GradleにARM64版AAPT2を指定 GradleがPC向けのAAPT2を使わないよう、Ubuntu内に設定します。 mkdir -p /root/.gradle cat >> /root/.gradle/gradle.properties <<'EOF_GRADLE' android.aapt2FromMavenOverride=/root/android-sdk/build-tools/37.0.0/aapt2 org.gradle.jvmargs=-Xmx1024m org.gradle.workers.max=2 org.gradle.parallel=false EOF_GRADLE android.aapt2FromMavenOverride が重要な設定です。残りはスマホのメモリ負荷を抑えるためのものです。設定キーがすでに存在する場合は、追記ではなく既存の値を更新してください。 6. GitHubからソースコードを取得 ここではGitHub上にAndroidプロジェクトがある前提です。Ubuntuにログインした状態で、/root/AppProjects にソースをCloneします。別途 /mnt にマウントする操作は必要ありません。 この記事では、リポジトリ名を sampleApp、GitHubアカウント名を (アカウント名) と表記しています。URLは自分のアカウント名に置き換えてください。 Ubuntuで実行: mkdir -p /root/AppProjects cd /root/AppProjects pwd /root/AppProjects git clone 'github.com/(%E3%82%A2%E3%82%AB%E3%82%A6%E3%83%B3%…)/sampleApp.git' cd sampleApp pwd /root/AppProjects/sampleApp TermuxとUbuntuでのディレクトリの見え方 同じプロジェクトフォルダでも、Termuxから見るパスとUbuntuにログインして見るパスは異なります。PRoot-DistroがUbuntuのファイルシステムを別のルート(/)として見せるためです。 どこから見るか プロジェクトディレクトリ Ubuntuにログインした状態 /root/AppProjects/sampleApp Termux側(現在のPRoot-Distroの配置例) $PREFIX/var/lib/proot-distro/containers/ubuntu/rootfs/root/AppProjects/sampleApp Termux側(旧版の配置例) $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu/root/AppProjects/sampleApp これらは、保存形式に応じて同じUbuntu内のフォルダを指します。 ~/AppProjects(Termuxのホーム直下)とは別なので混同しないようにします。実際の保存先はPRoot-Distroのバージョンで変わるため、Termux側のパスは配置例です。 後からGitHubの最新ソースを取り込む場合も、Ubuntu内で実行します。 cd /root/AppProjects/sampleApp git pull --ff-only origin main Gradle Wrapperの動作確認: cd /root/AppProjects/sampleApp bash ./gradlew --version 今回のプロジェクトでは、Gradle WrapperをGitHubへ追加してから git pull して利用しました。Wrapperがあれば、Gradle本体をaptで個別にインストールする必要はありません。 以降のUbuntuでのビルド作業は /root/AppProjects/sampleApp で行います。 7. Debug APKをビルド Ubuntuで実行: cd /root/AppProjects/sampleApp export ANDROID_HOME=/root/android-sdk printf 'sdk.dir=%s\n' "$ANDROID_HOME" > local.properties bash ./gradlew :app:assembleDebug \ --no-daemon \ --max-workers=2 \ --console=plain 初回はGradleや依存ライブラリのダウンロードがあるため、ある程度時間がかかります。 今回の最初の成功時には、次の結果が出ました。 > Task :app:assembleDebug BUILD SUCCESSFUL in 7m 18s 33 actionable tasks: 33 executed APKは以下に生成されます。 ls -lh app/build/outputs/apk/debug/app-debug.apk 最初に作成したDebug APKは約9.6MBでした。Deprecated Gradle features were used という警告も出ましたが、これは今回のビルド失敗ではなく、将来のGradleとの互換性に関する警告でした。 8. APKをスマホにインストール 生成したAPKを、Androidの「ダウンロード」フォルダへコピーします。 今回の環境では、Ubuntuから /sdcard/Download/ にアクセスできました。Ubuntuで実行: cd /root/AppProjects/sampleApp cp app/build/outputs/apk/debug/app-debug.apk \ /sdcard/Download/sampleApp-debug.apk ls -lh /sdcard/Download/sampleApp-debug.apk 今回はUbuntuから直接 /sdcard/Download/ にコピーできたので、Termuxへ戻ってコピーし直す必要はありません。また、プロジェクトは引き続き /root/AppProjects/sampleApp に置いたままで構いません。別の環境で /sdcard/Download/ が見えない場合だけ、Termux側のストレージアクセス許可(termux-setup-storage)と、PRoot-Distroのストレージ共有設定を確認してください。 あとはAndroidのファイル管理アプリで「ダウンロード」を開き、APKをタップしてインストールします。必要なら、ファイル管理アプリに「不明なアプリのインストール」の許可を与えます。 これで同じスマートフォンで作成したAPKを、そのスマートフォンで起動できました。 9. その後:Google Play向けAABも作成 Debug APKの動作確認後、Google Playへのアップロード用に、署名付きのRelease AABも作成しました。 APKは端末に直接インストールできますが、AABはGoogle Play Consoleにアップロードするための形式で、そのままファイル管理アプリからインストールするものではありません。 ここからも、Ubuntuにログインした状態で実行します。AAB生成には、プロジェクト側にRelease署名の設定があり、Google Playに登録するための既存のアップロード鍵(.jks)を用意していることが前提です。初めて公開するアプリなら、事前にアップロード鍵を作成して署名設定を行います。 9-1. ソースコードを最新にする git -C /root/AppProjects/sampleApp pull --ff-only origin main cd /root/AppProjects/sampleApp 9-2. 署名用の環境変数を設定する 今回のapp/build.gradleは、以下の4つの環境変数からアップロード鍵の情報を受け取る構成です。変数名はGradle側の設定と一致させる必要があります。 鍵のファイル名・エイリアスはサンプルなので、実際に使用している値に置き換えてください。 Ubuntuで実行: export PDFEDITOR_UPLOAD_KEYSTORE="$HOME/play-signing/sample-upload.jks" export PDFEDITOR_UPLOAD_KEY_ALIAS="sample-upload" 鍵ファイルの存在を確認 test -f "$PDFEDITOR_UPLOAD_KEYSTORE" && echo "アップロード鍵を確認しました" パスワードは画面に表示せず入力する read -r -s -p 'アップロード鍵のパスワード: ' PDFEDITOR_UPLOAD_STORE_PASSWORD printf '\n' export PDFEDITOR_UPLOAD_STORE_PASSWORD 同じパスワードを使用している場合 export PDFEDITOR_UPLOAD_KEY_PASSWORD="$PDFEDITOR_UPLOAD_STORE_PASSWORD" 鍵自体のパスワードがキーストアと異なる場合は、PDFEDITOR_UPLOAD_KEY_PASSWORD に別の正しい値を設定します。パスワードをソースコード、シェルスクリプト、GitHubへ書き込まないようにします。 9-3. Release AABをビルドする Ubuntuで実行: ./gradlew :app:bundleRelease -PadMode=production --no-daemon -PadMode=production は、今回のプロジェクトで本番広告設定を選ぶために実装したGradleプロパティです。Android標準の指定ではないため、この切替機能がない一般のプロジェクトでは指定しません。 成功するとBUILD SUCCESSFULと表示され、次の場所にAABが作成されます。 ls -lh app/build/outputs/bundle/release/app-release.aab 9-4. AABの署名を検証してダウンロードフォルダへコピーする jarsigner で検証します。終了コードだけでなく、結果に jar verified. が含まれることを確認してからコピーします。 Ubuntuで実行: AAB="app/build/outputs/bundle/release/app-release.aab" VERIFY_LOG="$(mktemp)" if [ -s "$AAB" ] && \ LC_ALL=C jarsigner -verify -verbose -certs "$AAB" > "$VERIFY_LOG" 2>&1 && \ grep -Fq 'jar verified.' "$VERIFY_LOG"; then echo "AABの署名検証に成功しました" cp -f "$AAB" /sdcard/Download/sampleApp-release-production.aab ls -lh /sdcard/Download/sampleApp-release-production.aab else tail -n 25 "$VERIFY_LOG" echo "AABの生成または署名検証に失敗したため、コピーしません" fi rm -f "$VERIFY_LOG" unset PDFEDITOR_UPLOAD_STORE_PASSWORD PDFEDITOR_UPLOAD_KEY_PASSWORD 今回はUbuntuから直接 /sdcard/Download/ にコピーできました。これでAndroidのファイル管理アプリからAABを選択し、Google Play Consoleにアップロードできます。 実際のアップロードでは、以前使用したversionCodeは再利用できないというエラーにも遭遇しました。その場合は未使用のversionCodeに更新し、AABを再ビルドします。 ! 注意: 署名鍵(.jks)とパスワードはGitHubへコミットしません。アプリ更新時は、登録済みのアップロード鍵を継続して使用します。なお、上記の環境変数名と広告モードは今回のプロジェクトの設定に依存します。 まとめ 今回、特につまずいたのは次の3点です。 SDK Platformのパッケージ名は、想定したandroid-37ではなくandroid-37.0だったこと 標準のBuild Toolsの一部がARM64環境では実行できず、ARM64版実行ファイルとGradleのAAPT2指定が必要だったこと Ubuntu内の /root/AppProjects/sampleApp とTermux側から見た保存先が同じフォルダを指すことを理解しておくこと PCやAndroid Studioを使わずにビルドできるのは便利ですが、ARM64版ツールの入手と環境依存の設定が必要で、一般的なPC向けAndroid開発よりも手間はかかりました。 今回は実機でDebug APKの生成・起動まで成功し、その後の署名付きAAB作成にも同じスマホを利用できました。 参考リンク PRoot-Distro(公式リポジトリ) Android SDK Command-line Tools(Android Developers) sdkmanager(Android Developers) ARM64向けAndroid SDK Tools(amirghm) 構築の参考にしたZenn記事 最後のZenn記事も、環境構築を始める際の参考にさせていただきました。

  8. Need a terminal on your Android phone? 📱 Termux gives you a Linux-like environment for Git, SSH and Python. Handy for quick tasks away from your laptop. ⌨️ termux/termux-app #Android #浇朋友 #蓝朋友 #互关 #fo

    1 like · 92 views
  9. 手机上也想用 Git、SSH 和 Python?📱 Termux 给 Android 带来终端与 Linux 环境。出门也能跑命令、连服务器。⌨️ termux/termux-app #Android #浇朋友 #蓝朋友 #互关 #fo

    53 views
  10. How to Distribute Your Own Tools on Termux: A Guide for Developers --- title: "How to Distribute Your Own Tools on Termux: A Guide for Developers" published: true description: "Built a CLI tool that runs on Termux but can't get into termux-packages or TUR? Here are all your options for distributing it to Termux users: official repo, TUR, your own APT repo, and Termux App Store." tags: termux, android, opensource, tutorial cover_image: your-image-url (1000x420 recommended) canonical_url: your-site.com --- You built a CLI tool. It runs great on Termux. Now you want other Termux users to install it with one command instead of git clone, dependency hunting, and "it doesn't compile on my phone." Then you open a pull request to the official repository, and it gets closed. Or you try TUR and the review stalls. You're not alone, and it doesn't mean your tool is bad. It usually means the tool doesn't fit that channel. This guide walks through every realistic way to distribute your own tools on Termux, what each one expects from you, and how to pick the right one. > Disclosure: I maintain Termux App Store, one of the options below. It is an independent community project and is not affiliated with the official Termux project. I'll be upfront about trade-offs for every option, including mine. TL;DR | Option | Best for | Review process | Users install with | |---|---|---|---| | termux-packages (official) | Widely used, stable, general-purpose software | Strict, maintained by the core team | pkg install | | TUR (Termux User Repository) | Packages that don't fit official but still need a curated home | Curated contributor workflow | pkg install (after enabling the repo) | | Your own APT repository | Full control, your own release cadence | None (you are the reviewer) | pkg install (after users add your repo) | | Termux App Store | Niche, experimental, or fast-moving community tools | Pull request with validation tooling | termux-app-store install | | GitHub release + install script | Quick start, small audience | None | curl ... \| bash or manual | If you only read one line: start by asking who your users are and how much control you want over releases, then choose. Why your package may get rejected Official and curated repositories exist to protect users and reduce maintenance load. A few common reasons a new tool doesn't fit: - Scope. The official repo targets software with broad use. A small or niche tool may not meet that bar. - Maintenance burden. Every package needs someone to keep it building across architectures when Termux's toolchain changes. - Build reproducibility. Packages must build from source inside the Termux build environment, not just run on your phone. - Upstream fit. Projects with bundled binaries, unusual licensing, or heavy patching are harder to accept. None of this is a judgement on your code. It's a question of which channel matches your project. Option 1: The official termux-packages repository The build system and primary set of packages for Termux live in termux/termux-packages. Packages are organized into repository channels such as main, root, and x11, and each package is a directory with a build.sh. Choose this if your tool is stable, widely useful, and you're willing to maintain it long term. Do this first: read CONTRIBUTING.md and the Developer's Wiki in that repo. Check whether a similar package already exists, and make sure your project has a clear license and tagged releases. Option 2: TUR (Termux User Repository) TUR is described as the Termux equivalent of the Arch User Repository idea: users install pre-compiled packages instead of building on-device. Packages live under tur/<your-package-name>/build.sh (not packages/), and you build with the Termux build scripts: TERMUX_INSTALL_DEPS=true ./build-package.sh -a <arch> <package-name> Two things to remember: - TUR packages are not official Termux packages. Don't ask the core Termux team for support on them. - TUR has a curated contributor workflow, so expect review. Option 3: Host your own APT repository If you want full control, you can build .deb packages and host them as an APT repository (for example on GitHub Pages). Users add your repository, then install with pkg or apt. Pros: your release schedule, your rules. Cons: you handle signing, hosting, architecture builds (aarch64, arm, x86_64, i686), and user trust. Every user has to add your repo first. This is the most work, but it's the right call for larger projects with their own ecosystem. Option 4: Termux App Store (community package layer) Termux App Store is a community-driven TUI and CLI package manager for Termux. Think of it as an AUR-like layer for tools that are too niche, too experimental, or too fast-moving for the official repository. Packages are described by a build.sh file. Users can install a pre-built .deb (fast path, SHA256-verified) or force a source build. Step 1: Get the tooling git clone https://github.com/djunekz/termux-app-store cd termux-app-store Step 2: Create your build.sh Every package is just one file: packages/<tool-name>/build.sh. It tells Termux App Store what your tool is, where to download it, and how to install it. You don't have to write it by hand. Pick whichever of these three ways fits you: | Way | Best for | Command | |---|---|---| | A. pkg-scaffold.py (wizard) | Beginners. It asks questions and writes the file for you | python pkg-scaffold.py | | B. termux-build | People who want a template or a one-line generator | ./termux-build init <github-url> | | C. Manual | People who already know the format | Copy template/build.sh and edit | Way A: the scaffold wizard (easiest) Run it from inside the cloned repo: python pkg-scaffold.py Or give it your GitHub URL up front so it can pre-fill everything: python pkg-scaffold.py --from https://github.com/yourname/my-awesome-cli The wizard walks you through a few steps: 1. Source repository (optional). Paste your GitHub URL and it fetches the description, license, and latest release or tag automatically. 2. Package info: name (lowercase and hyphens only), description, homepage, license, maintainer, version. 3. SHA256. It can download your source and compute the checksum for you. 4. Build method. It scans your repo and detects whether it's a Python script, pip package, shell script, npm, Cargo (Rust), Go, Makefile, CMake, and more. 5. Entrypoint (for script-type tools) and any extra dependencies. 6. Review, then confirm, and it writes packages/my-awesome-cli/build.sh. If you don't give it a GitHub URL, it just asks you to type everything in manually. Way B: termux-build Generate a blank template: ./termux-build create my-awesome-cli Or auto-create from a GitHub repository: ./termux-build init https://github.com/yourname/my-awesome-cli Both give you packages/my-awesome-cli/build.sh. Note that termux-build is mainly a creation and validation helper. It is not an auto-publish tool, so nothing gets uploaded until you open a pull request yourself. Step 3: Check the metadata (and fix anything the tools missed) Whichever way you used, open the generated file and make sure it looks right. A package definition carries metadata like this: TERMUX_PKG_HOMEPAGE="https://github.com/yourname/my-awesome-cli" TERMUX_PKG_DESCRIPTION="One-line description of what the tool does" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@yourname" TERMUX_PKG_VERSION="1.0.0" TERMUX_PKG_SRCURL="https://github.com/yourname/my-awesome-cli/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz" TERMUX_PKG_SHA256="<sha256 of the source tarball>" Get the checksum with: curl -L <your-source-url> | sha256sum > The exact required fields can evolve, so run ./termux-build guide and ./termux-build template for the current format. Step 4: Validate before you submit ./termux-build lint my-awesome-cli # check the package ./termux-build check-pr my-awesome-cli # check it's ready for a pull request ./termux-build doctor # diagnose your environment Step 5: Open a pull request Push your branch and open a PR with your packages/my-awesome-cli/ directory. After it's merged, users can find and install it: pip install termux-app-store termux-app-store search my-awesome-cli termux-app-store install my-awesome-cli Prefer to compile locally? Users can force a source build with termux-app-store fix-install my-awesome-cli. The whole flow in 4 commands git clone https://github.com/djunekz/termux-app-store && cd termux-app-store python pkg-scaffold.py --from https://github.com/yourname/my-awesome-cli # 1. generate build.sh ./termux-build lint my-awesome-cli # 2. validate it ./termux-build check-pr my-awesome-cli # 3. check PR readiness # 4. commit packages/my-awesome-cli/ and open a Pull Request Trade-off to be aware of: because this is an independent community layer, it is not the official Termux repository and packages aren't installed through plain pkg install. In exchange you get a much lower barrier to entry. Option 5: GitHub releases plus an install script The fastest way to ship: publish release binaries or a script on GitHub and document a one-liner. pkg install git git clone https://github.com/yourname/my-awesome-cli cd my-awesome-cli && ./install.sh It works, but there is no update mechanism, no checksum verification by default, and users have to trust and read your script. Fine for early versions; plan to graduate to one of the options above. Checklist before you distribute anywhere - [x] A clear license file - [x] Tagged releases with a stable source URL - [x] A SHA256 checksum for every release artifact - [x] Tested on at least aarch64, ideally also arm and x86_64 - [x] Declared dependencies (pkg install ...) - [x] No hardcoded /usr/bin. Termux uses $PREFIX (/data/data/com.termux/files/usr) - [x] A README with a copy-pasteable install command - [x] No telemetry or surprising network calls without disclosure FAQ Why was my package rejected from termux-packages? Usually scope, maintenance burden, or build reproducibility. Read the contributing guide, check for existing packages, and consider TUR or a community layer instead. What's the difference between termux-packages and TUR? termux-packages is the official, core-maintained repository. TUR is a separate user repository with its own curated workflow, and its packages are not official Termux packages. Can I distribute a Termux package without asking anyone's permission? Yes. Host your own APT repository or release .deb files yourself. You trade review for responsibility. How do I make a .deb for Termux? Use the Termux build system (build-package.sh with a build.sh) so paths and prefixes are correct for Termux rather than a standard Linux distro. Which architectures should I support? Termux runs on aarch64, arm, x86_64, and i686. aarch64 covers most modern phones. Wrapping up There's no single "right" place to publish a Termux tool. Use the official repo for stable, broadly useful software, TUR for curated extras, your own APT repo when you want total control, and a community layer like Termux App Store when your tool is niche or moving fast. Whichever you choose, ship checksums, document the install command, and test on more than one architecture. Your users will thank you. If you've got a Termux tool you want more people to use, packaging it is the highest-leverage thing you can do. Questions or war stories about getting packages rejected? Drop them in the comments. --- Links - Termux App Store: djunekz/termux-app-store - Termux packages (official): termux/termux-packages - TUR: termux-user-repository/tur

Trending awards, every completed day and week
Gold
01st place finishes
Silver
02nd place finishes
Bronze
03rd place finishes
Awarded repositories
0Owned by termux now

No trending awards yet

None of the repositories termux owns has finished in the top three of a completed trending day or week, by stars, forks or PR authors. See who is trending now.

A repository earns an award for finishing first, second or third in a completed trending day or week, ranked by new stars, new forks or pull request authors. Awards follow a repository through renames and transfers and count toward its current owner. Weeks run Monday to Sunday, UTC.