Command Reference
Everything you need to orchestrate the Android SDK straight from your terminal. All commands can be prefixed with either ktroid or the alias ktd.
# Global Flags
You can append --help to any command to see inline terminal documentation. Use --verbose for detailed gradle logs.
# Offline Support
Once ktd setup has downloaded the necessary SDKs and build tools, subsequent project creation and compilation runs 100% offline.
create
Generates a complete Android Studio-compatible project structure with Gradle wrappers, AndroidManifest, and default Kotlin activities.
❯ktd create <project_name> [package_name]Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| project_name | string | Req | Name of your app. |
| package_name | string | Opt | Application ID (e.g., com.example.app). |
Examples
ktd create MyApp com.mycorp.appinit
Populates the current working directory with an Android project structure. Warns if the directory is not empty.
❯ktd initExamples
ktd initinfo
Parses the app/build.gradle file and prints the Application ID, version codes, and target/min SDKs.
❯ktd infoExamples
ktd infobuild
Runs gradlew assembleDebug, assembleRelease, or bundleRelease. For release builds, it automatically verifies the APK signature.
❯ktd build [action]Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| action | string | Opt | Build type. Valid options are debug, release, bundle. Default is debug. |
Examples
ktd build releaserun
Automatically builds the debug APK, asks you to select a connected device, installs the APK via ADB, and launches the MainActivity.
❯ktd runExamples
ktd runclean
Executes ./gradlew clean to remove previous build outputs.
❯ktd cleanExamples
ktd cleansigning
Generates a signing.properties file. If you don't have a keystore, it automatically uses keytool to generate an RSA 2048-bit release keystore.
❯ktd signingExamples
ktd signingemulator
Wraps avdmanager and emulator commands. list shows available AVDs. start boots the emulator in the background. create interactively builds a new AVD.
❯ktd emulator <action> [name]Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| action | string | Req | list, start, or create. |
| name | string | Opt | Name of the emulator to start. |
Examples
ktd emulator start Pixel_API_35logs
Reads your applicationId from build.gradle, finds the running PID on the device, and strictly filters logcat output so you only see your app's logs.
❯ktd logsExamples
ktd logsinstall
Prompts for device selection (if multiple exist) and uses adb install to push the APK to the device.
❯ktd install <apk_path>Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| apk_path | string | Req | Path to the APK file. |
Examples
ktd install app/build/outputs/apk/release/app-release.apkuninstall
Uninstalls the application. If no package is provided, it reads the current project's package name from build.gradle.
❯ktd uninstall [package_name]Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| package_name | string | Opt | Package to remove. |
Examples
ktd uninstall com.mycorp.appdep
Automatically injects an implementation block into your app/build.gradle. Supports shortcuts for common libraries. Leave empty to see the list of shortcuts.
❯ktd dep <name>Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| name | string | Opt | Dependency shortcut or full Maven coordinates. |
Examples
ktd dep retrofitktd dep "com.google.code.gson:gson:2.10.1"dep-list
Parses and neatly lists all implementation, api, and test dependencies currently active in the project.
❯ktd dep-listExamples
ktd dep-listdep-remove
Safely finds and removes the dependency line from app/build.gradle.
❯ktd dep-remove <dep_name>Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| dep_name | string | Req | String matching the dependency to remove. |
Examples
ktd dep-remove retrofitperm
Injects a <uses-permission> tag into the manifest. Supports shortcuts like internet, camera, location, storage. Leave empty to view shortcuts.
❯ktd perm <name>Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| name | string | Opt | Permission shortcut or full string. |
Examples
ktd perm internetperm-remove
Removes the specified permission tag from AndroidManifest.xml.
❯ktd perm-remove <name>Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| name | string | Req | Permission string or shortcut. |
Examples
ktd perm-remove cameralogo
If the Pillow Python library is installed, it intelligently resizes your image into all mipmap formats. Otherwise, copies to drawable.
❯ktd logo <path_to_image>Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| path_to_image | string | Req | Path to your source logo PNG. |
Examples
ktd logo my_design.pngtest
Runs ./gradlew test for local JVM tests, or connectedAndroidTest for instrumented tests on an emulator/device.
❯ktd test [test_type]Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| test_type | string | Opt | unit, instrumented, or all. Default is unit. |
Examples
ktd test instrumentedbump
Auto-increments versionCode and versionName directly inside app/build.gradle.
❯ktd bump [bump_type]Parameters
| Flag / Arg | Type | Status | Description |
|---|---|---|---|
| bump_type | string | Opt | code, name, or both. Default is both. |
Examples
ktd bump bothsetup
Runs the Master Setup Wizard to automatically install Gradle, Android SDK, and configure Paths.
❯ktd setupExamples
ktd setupupdate-config
Interactive configuration updater. Connects to APIs to fetch latest stable versions and verify custom inputs.
❯ktd update-configExamples
ktd update-configconfig
Prints your current default Android ecosystem versions stored in config.json.
❯ktd configExamples
ktd configcheck
Checks java -version, ANDROID_HOME, adb, and gradle paths to ensure your system is ready.
❯ktd checkExamples
ktd checkversion
Show CLI version.
❯ktd --versionExamples
ktd --version