Android Studio on Devuan 4: Install
Tags: android, androidstudio, mobile, devuan
Published: 2023-07-31 11:44:26

## Summary

[Devuan](https://www.debian.org/) [GNU](https://www.gnu.org/)+[Linux](https://kernel.org/) is a fork of [Debian](https://www.debian.org/) without [systemd](https://www.freedesktop.org/wiki/Software/systemd/) and hence [Snaps](https://snapcraft.io/) (Snapd).
Even on it, it's easy to install [Android Studio](https://developer.android.com/studio/) and start to develop [Android](https://www.android.com/) mobile apps.

![android-studio-eyecatch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsa07bp1sb8b00ctog4u.png)

This post shows how to install it.
It is manual installation without Debian package management system (`apt-get` etc.). However, it isn't complicated thanks to the package distributed by Google.

### Environment

- OS: Devuan 4 (Chimaera)
- IDE: Android Studio 2022.3.1.18

## Tutorial

### Install dependencies

Actually, there was nothing to do in my case.

Besides, "[Required libraries for 64-bit machines](https://developer.android.com/studio/install#64bit-libs)" in the official docs failed to locate or find.

### Get Android Studio

Get the "Linux (64-bit)" package in [the official downloads page](https://developer.android.com/studio#android-studio-downloads).

![android-studio-downloads-page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/18106paj7wpzdp0uqvza.png)

Then run to extract:

```console
$ tar xzf android-studio-2022.3.1.18-linux.tar.gz
```

You will have `android-studio` directory and also files inside.

### Set up IDE

Update `PATH` environment variable to add `android-studio`:

```console
$ # case fish 3.1.2 as package distributed in devuan 4:
$ export PATH=(readlink -f android-studio/bin):"$PATH"

$ # (optional) case bash, ksh and latest fish:
$ #export PATH=$(readlink -f android-studio/bin):"$PATH"
```

Now the script below to start Android Studio is available:

```console
$ studio.sh
```

You will see the first confirmation. Well, I didn't have an existing one to import.

![android-studio-first-running.png](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/modakbdd8rb2vcv4j9st.png)

Follow the wizard to set up the IDE.

![ide-setup-01](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvogpr9m82ct9pghj6am.png)

![ide-setup-02](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/48axoti6p5s2yp3vw3yl.png)

I chose "Custom" above. "Standard" setup is, of course, also available.

You can make detailed configuration in "Custom" mode:

![ide-setup-03](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pp9mxx8784wrg7vepxnt.png)

![ide-setup-04](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pn71m3blwege8anxth2q.png)

![ide-setup-05](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5lrk7ufyzp87ftgc1bco.png)

Settings are completed.

Next, agreeing to the licenses for the components is required:

![ide-setup-06](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dv7ixipgkw0na5gmkr6.png)

Clicking "Finish" starts to download:

![ide-setup-07](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qn217vulvabey5oou59a.png)

![ide-setup-08](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f78xbz18223urpvpsm3p.png)

Done:

![ide-setup-09](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kmj74uhqs9vvy82yzo7k.png)

### Create an Android project

Then, the wizard below to create a project will show automatically.

Choose "New Project":

![android-project-create-01](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ekdti6r1wzbjw2vofos5.png)

Choose an app template:

![android-project-create-02](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21risosevuxnk010uvfg.png)

Configure the project:

![android-project-create-03](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kjlqy1rhsz23k41khvgl.png)

The default programming language is [Kotlin](https://kotlinlang.org/) instead of [Java](https://openjdk.org/). Also, Build configuration language is nowadays Kotlin DSL (`build.gradle.kts`) instead of [Groovy](https://groovy-lang.org/) DSL (`build.gradle`), the past default.

![android-project-create-04](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6rnkjsk28azazbpn2mj4.png)

Finished. Your first Android project will be generated and appear.

### Run app on virtual device

It must be exciting to see it actually running.
So open "Device Manager" at right and start the default device by clicking the green triangle button.
It will be shown in "Running Devices".

![android-project-run-01](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3u4qdwd2x2j6d82z1xu.png)

Then run the app by clicking another green triangle button at a little right to the center in the second-top bar.
Alternatively, push Shift + F10, or click [Run] - [Run 'app'] in the top menus.

![android-project-run-02](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/efpwlk8i987zqma67lh7.png)

Building it will start:

![android-project-run-03](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hetb07tw54h3q5tl6jsy.png)

After it finished, the app will come :)

![android-project-run-04](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2xm4qdse5y77xa183pv.png)

#### An editing example

You can modify it as usual development.

For example, edit `<string name="lorem_ipsum">` section in `src/main/res/values/strings.xml`.
It will change the messages in the view as below:

![android-project-edit-01](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1w18geab3cadz730i7e7.png)

### Set up `PATH` at login

It should be useful to add Android Studio to `PATH` environment variable at login.

It's done, for example, by editing `~/.profile` as below:

```sh
PATH="$HOME/(...)/android-studio/bin:$PATH"
```

In addition, you may use a list as below and for-loop statement if you need multiple variables added.

```sh
for x in \
    $HOME/(...)/(something to be added) \
    $HOME/(...)/android-studio
do
    if [ -d "$x" ] ; then
        PATH="$x/bin:$PATH"
    fi
done
```

With `PATH` updated, running `studio.sh` starts Android Studio.

## Conclusion

Now you are ready to develop Android mobile apps with both IDE and the project got.

Besides, there is another way to install Android Studio on Devuan: [Flatpak](https://flatpak.org/). [The package](https://flathub.org/apps/com.google.AndroidStudio) is available.
Moreover, when you use a different Linux distro and can do Snaps, there is also [the package](https://snapcraft.io/android-studio).

🎶 🎵 🎸 Happy development 🥁 🎶 🎵