|
|
# Setting Up Kaidan on Android
|
|
|
|
|
|
This page describes how to set up Kaidan for Android on Linux.
|
|
|
|
|
|
## Build Kaidan
|
|
|
|
|
|
There are two ways for building Kaidan in a Docker container:
|
|
|
|
|
|
A: The first one creates, starts and removes a new container every time you use it.
|
|
|
|
|
|
B: The second one creates a container once and reuses it every time the build script is executed on the running container.
|
|
|
That reduces the time which is needed to create a new container.
|
|
|
|
|
|
For the following commands you have to be in the repository directory:
|
|
|
```bash
|
|
|
cd <Kaidan repository directory>
|
|
|
```
|
|
|
|
|
|
### A: Use a Temporary Docker Container
|
|
|
|
|
|
Create and start the container, run the build script and remove the container afterwards:
|
|
|
```bash
|
|
|
docker run --rm --volume $(pwd):/kaidan --workdir /kaidan kdeorg/android-arm-sdk utils/build-android-docker.sh
|
|
|
```
|
|
|
|
|
|
### B: Use a Persistent Docker Container
|
|
|
|
|
|
1. Create and start the Docker container:
|
|
|
```bash
|
|
|
docker run --interactive --detach --name kaidan_android --volume $(pwd):/kaidan kdeorg/android-arm-sdk
|
|
|
```
|
|
|
1. Run the build script in the container:
|
|
|
```bash
|
|
|
docker exec --workdir /kaidan kaidan_android utils/build-android-docker.sh
|
|
|
```
|
|
|
|
|
|
#### Start the Docker Container
|
|
|
|
|
|
To use the persistent container after stopping it (e.g. after a system restart), you have to start it again before:
|
|
|
```
|
|
|
docker container start kaidan_android
|
|
|
```
|
|
|
|
|
|
## Android Virtual Device (AVD)
|
|
|
|
|
|
If you want to debug Kaidan on an AVD, you need to execute the following steps:
|
|
|
|
|
|
1. Download [Android Studio](https://developer.android.com/studio#downloads).
|
|
|
1. Follow the [setup instructions](https://developer.android.com/studio/install).
|
|
|
1. Create an Android AVD via *Configure* -> *AVD Manager* -> *Create Virtual Device...*.
|
|
|
1. Start the created AVD via the play button.
|
|
|
|
|
|
## Debug Kaidan
|
|
|
|
|
|
1. Install the built Android Package (APK):
|
|
|
```bash
|
|
|
adb install kaidan_build_apk-debug.apk
|
|
|
```
|
|
|
1. Analyze the logging output:
|
|
|
```bash
|
|
|
adb logcat -v color kaidan '*:S'
|
|
|
```bash
|
|
|
That line is the short form of `adb logcat -v color kaidan:V '*:S'` where *V* meaning *Verbose* is used to show the output for Kaidan and *S* meaning *Silent* for hiding the remaining output.
|
|
|
1. Modify the logging output with the following options if necessary:
|
|
|
* `:V`: Verbose (default)
|
|
|
* `:D`: Debug
|
|
|
* `:I`: Info
|
|
|
* `:W`: Warning
|
|
|
* `:E`: Error
|
|
|
* `:S`: Silent
|
|
|
* See the [Logcat documentation](https://developer.android.com/studio/command-line/logcat#filteringOutput) for further information.
|
|
|
1. Start Kaidan.
|
|
|
|
|
|
## Uninstall Kaidan to Reinstall It
|
|
|
|
|
|
After an installation of Kaidan, you must uninstall it before installing it again:
|
|
|
```adb uninstall im.kaidan.kaidan
|
|
|
```
|
|
|
|
|
|
## Issues
|
|
|
|
|
|
* Currently, Kaidan is only built for the ARM architecture with the current Docker image because it does not contain dependencies for that. |