Skip to content

Commit

Permalink
feat: almost everything documented
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedAhkam committed Oct 7, 2023
1 parent 4874057 commit 4aaa768
Show file tree
Hide file tree
Showing 15 changed files with 245 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[book]
title="Android CLI"
authors = ["Syed Ahkam"]
description = "Documentation for the tool android-cli"

language = "en"
multilingual = false
src = "src"
git-repository-url = "https://github.com/SyedAhkam/android-cli"
git-repository-icon = "fa-github"
edit-url-template = "https://github.com/SyedAhkam/android-cli/edit/master/docs/{path}"
26 changes: 25 additions & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# Summary

- [Introduction](./introduction.md)
[Introduction](./introduction.md)

# Get Started

- [Installation](get-started/installation.md)
- [Create or Link Project](get-started/create-or-link.md)

# Commands

- [android build](commands/build.md)
- [android install](commands/install.md)
- [android launch](commands/launch.md)
- [android run](commands/run.md)
- [android devices](commands/devices.md)
- [android shell](commands/shell.md)
- [android emulator](commands/emulator.md)

# Reference

- [.android](reference/dot-android.md)

-----------

[Frequently Asked Questions](faq.md)
[Legal](legal.md)
28 changes: 28 additions & 0 deletions docs/src/commands/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Build Project

```
USAGE:
android build [OPTIONS]
OPTIONS:
-h, --help Print help information
-r, --release Should build in release mode
```

## What it does

For now, it just execs `./gradlew assemble[Debug|Release]`.

## Examples

### Building in Debug mode

```sh
$ android build
```

### Building in Release mode

```sh
$ android build --release
```
19 changes: 19 additions & 0 deletions docs/src/commands/devices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# List Devices

```
USAGE:
android devices
OPTIONS:
-h, --help Print help information
```

## What it does

Executes `adb devices` and returns the output.

## Example

```
$ android devices
```
3 changes: 3 additions & 0 deletions docs/src/commands/emulator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# android emulator

TODO
28 changes: 28 additions & 0 deletions docs/src/commands/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Install App

```
USAGE:
android install [OPTIONS]
OPTIONS:
-h, --help Print help information
-r, --release Should install release APK
```

## What it does

Executes `adb install` under the hood and simply returns the output.

## Examples

### Install in Debug mode

```sh
$ android install
```

### Install in Release mode

```sh
$ android install --release
```
19 changes: 19 additions & 0 deletions docs/src/commands/launch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Launch App

```
USAGE:
android launch
OPTIONS:
-h, --help Print help information
```

## What it does

It requests ADB to launch the configured main activity of the installed app onto the connected device or emulator, effectively running our app.

## Example

```sh
$ android launch
```
28 changes: 28 additions & 0 deletions docs/src/commands/run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Run App

```
USAGE:
android run [OPTIONS]
OPTIONS:
-h, --help Print help information
-r, --release Should build in release mode
```

## What it does

It is a combination of three commands, [`android build`](./build.md), [`android install`](./install.md) and [`android launch`](./launch.md) giving you an illusion of a single operation being executed.

## Examples

### Running in Debug mode

```sh
$ android run
```

### Running in Release mode

```sh
$ android run --release
```
3 changes: 3 additions & 0 deletions docs/src/commands/shell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# android shell

TODO
13 changes: 13 additions & 0 deletions docs/src/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Frequently Asked Questions

## 1. Isn't there already an `android` tool that ships with the android SDK?

Yes, there is an `android` bash script that comes with the Android SDK. However, it has been deprecated, and its functionalities have been absorbed into Android Studio, making it the only supported option for Android development. This decision has frustrated developers who prefer to use a CLI to manage their projects.

## 2. But wait.. Don't I have to install Android Studio to get the SDK?

Not necessarily. If you go to [Android Studio download page](https://developer.android.com/studio) and scroll down enough you'll see a section named 'Command line tools only'. Just grab that and there's no need for Android Studio.

## 3. Is a simple wrapper even enough?

Well yes and no, I eventually intend to build an interface on top of the existing commands in the near future to make actions more controllable and user-friendly as a whole. For example: imagine a prompt which lets you choose which device to run your project on, and even offer launching an emulator right there. there's so many possibilities.
39 changes: 39 additions & 0 deletions docs/src/get-started/create-or-link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Create or Link Project

There are mainly two ways to get started -- either create a new project or link to an existing android project.

## Create

You may create or initialize a project using

```sh
$ android create
```

And then answer a few prompts:

- Destination path
- Project name
- Package identifier

> The template project that this is based upon lives [here](https://github.com/SyedAhkam/android-cli-template). Open for contributions.
After creating the project, you can start editing the source and run the project.

```sh
$ cd <dest>
$ android run
```

## Link an existing project

If you already have an android project bootstrapped, you will need to link it.

```sh
$ android link
```

> You might need to dig into your own source code to figure out the appropriate prompt values. Especially the package identifier and main activity class name.
All this essentially does is create a [.android](../reference/dot-android.md) file which is then relied upon by the CLI for future operations.

21 changes: 21 additions & 0 deletions docs/src/get-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Installation

## Using cargo

### From crates.io (no releases yet)

```sh
$ cargo install android-cli
```

### From git directly

```sh
$ cargo install --git https://github.com/SyedAhkam/android-cli.git
```

## Using github releases

No releases yet

> After installation, you should have access to the `android` binary from your choice of shell.
6 changes: 4 additions & 2 deletions docs/src/introduction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Introduction

Welcome to the documentation for Android CLI.
Android CLI is a powerful tool that simplifies and streamlines the Native Android development process.

Currently in development, stay tuned!
It provides a single interface for developers to create, build, and release Android applications without the need for cumbersome IDEs like Android Studio.

Github Project can be found [here](https://github.com/SyedAhkam/android-cli)
7 changes: 7 additions & 0 deletions docs/src/legal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Legal

The tool itself is forever free. Distributed under the MIT License.

However, the Android SDK is not free. You must accept the Android SDK License Agreement before using the SDK.

Additionally, the Android CLI is not affiliated with Google or the Android Open Source Project. Android is a trademark of Google Inc.
3 changes: 3 additions & 0 deletions docs/src/reference/dot-android.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dot Android

TODO

0 comments on commit 4aaa768

Please sign in to comment.