Update install docs for curl bootstrap
This commit is contained in:
@@ -0,0 +1,67 @@
|
|||||||
|
# Android Builder
|
||||||
|
|
||||||
|
Android Builder is a Termux-oriented shell tool for bootstrapping simple Android app projects, installing the required Android SDK pieces, and building/exporting APKs from the command line.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Before installing:
|
||||||
|
|
||||||
|
- optionally run `termux-change-repo`
|
||||||
|
- run `pkg update`
|
||||||
|
- run `pkg upgrade -y`
|
||||||
|
- install `curl` if it is not already present: `pkg install -y curl`
|
||||||
|
|
||||||
|
Then run the bootstrap installer inside Termux:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pkg update
|
||||||
|
pkg upgrade -y
|
||||||
|
pkg install -y curl
|
||||||
|
curl -fsSL http://192.168.1.46:8085/Dark98/Termux-Android-Builder/raw/branch/main/install.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
The bootstrapper will:
|
||||||
|
|
||||||
|
- install the required Termux packages
|
||||||
|
- clone or update the Android Builder checkout
|
||||||
|
- add `~/android-builder/bin` to your `PATH`
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
After installation, the main command is:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
android-builder help
|
||||||
|
```
|
||||||
|
|
||||||
|
Available commands:
|
||||||
|
|
||||||
|
- `android-builder setup`
|
||||||
|
- `android-builder doctor`
|
||||||
|
- `android-builder new MyApp`
|
||||||
|
- `android-builder new MyApp --template empty`
|
||||||
|
- `android-builder build`
|
||||||
|
- `android-builder export`
|
||||||
|
|
||||||
|
## Command Layout
|
||||||
|
|
||||||
|
The CLI is now split into smaller scripts for readability and maintenance:
|
||||||
|
|
||||||
|
- `bin/android-builder` is the command dispatcher
|
||||||
|
- shared helpers live in `lib/common.sh`
|
||||||
|
- individual command implementations live in `lib/commands/`
|
||||||
|
|
||||||
|
## Project Generation
|
||||||
|
|
||||||
|
`android-builder new` creates a basic Android app skeleton with:
|
||||||
|
|
||||||
|
- Gradle settings and properties
|
||||||
|
- a single `app` module
|
||||||
|
- a minimal `MainActivity`
|
||||||
|
- a simple default theme and string resources
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- The project is designed around Termux.
|
||||||
|
- `android-builder setup` installs the SDK command-line tools and platform packages into `~/android-sdk`.
|
||||||
|
- `android-builder export` copies the built APK into `~/storage/documents` after storage permission is granted.
|
||||||
+7
-4
@@ -36,15 +36,18 @@ fi
|
|||||||
|
|
||||||
echo "==> Adding AndroidBuilder to PATH"
|
echo "==> Adding AndroidBuilder to PATH"
|
||||||
PROFILE="$HOME/.bashrc"
|
PROFILE="$HOME/.bashrc"
|
||||||
PATH_LINE="export PATH=\$HOME/android-builder/bin:\$PATH"
|
PATH_LINE="export PATH=$INSTALL_DIR/bin:\$PATH"
|
||||||
|
LEGACY_PATH_LINE='export PATH=$HOME/android-builder/bin:$PATH'
|
||||||
|
|
||||||
touch "$PROFILE"
|
touch "$PROFILE"
|
||||||
|
|
||||||
grep -qxF "$PATH_LINE" "$PROFILE" || {
|
if grep -qxF "$LEGACY_PATH_LINE" "$PROFILE"; then
|
||||||
|
sed -i "s#^export PATH=\\\$HOME/android-builder/bin:\\\$PATH$#$PATH_LINE#" "$PROFILE"
|
||||||
|
elif ! grep -qxF "$PATH_LINE" "$PROFILE"; then
|
||||||
echo "" >> "$PROFILE"
|
echo "" >> "$PROFILE"
|
||||||
echo "# AndroidBuilder" >> "$PROFILE"
|
echo "# AndroidBuilder" >> "$PROFILE"
|
||||||
echo "$PATH_LINE" >> "$PROFILE"
|
echo "$PATH_LINE" >> "$PROFILE"
|
||||||
}
|
fi
|
||||||
|
|
||||||
export PATH="$INSTALL_DIR/bin:$PATH"
|
export PATH="$INSTALL_DIR/bin:$PATH"
|
||||||
|
|
||||||
@@ -62,4 +65,4 @@ echo " or run: source ~/.bashrc"
|
|||||||
echo
|
echo
|
||||||
echo "Next step:"
|
echo "Next step:"
|
||||||
echo " android-builder setup"
|
echo " android-builder setup"
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user