Android Studio on Devuan 4: Install

Table of contents

Summary Summary

Devuan (opens in a new tab) GNU (opens in a new tab)+Linux (opens in a new tab) is a fork of Debian (opens in a new tab) without systemd (opens in a new tab) and hence Snaps (opens in a new tab) (Snapd). Even on it, it’s easy to install Android Studio (opens in a new tab) and start to develop Android (opens in a new tab) mobile apps.

android-studio-eyecatch

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 Environment

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

Tutorial Tutorial

Install dependencies Install dependencies

Actually, there was nothing to do in my case.

Besides, “Required libraries for 64-bit machines (opens in a new tab)” in the official docs failed to locate or find.

Get Android Studio Get Android Studio

Get the “Linux (64-bit)” package in the official downloads page (opens in a new tab).

android-studio-downloads-page

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 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.

The “Import Android Studio Settings” dialog at first launch, with “Do not import settings” selected.

Follow the wizard to set up the IDE.

ide-setup-01

ide-setup-02

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

You can make detailed configuration in “Custom” mode:

ide-setup-03

ide-setup-04

ide-setup-05

Settings are completed.

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

ide-setup-06

Clicking “Finish” starts to download:

ide-setup-07

ide-setup-08

Done:

ide-setup-09

Create an Android project Create an Android project

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

Choose “New Project”:

android-project-create-01

Choose an app template:

android-project-create-02

Configure the project:

android-project-create-03

The default programming language is Kotlin (opens in a new tab) instead of Java (opens in a new tab). Also, Build configuration language is nowadays Kotlin DSL (build.gradle.kts) instead of Groovy (opens in a new tab) DSL (build.gradle), the past default.

android-project-create-04

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

Run app on virtual device 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

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

Building it will start:

android-project-run-03

After it finished, the app will come :)

android-project-run-04

An editing example 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

Set up PATH at login 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 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 (opens in a new tab). The package (opens in a new tab) is available. Moreover, when you use a different Linux distro and can do Snaps, there is also the package (opens in a new tab).

🎶 🎵 🎸 Happy development 🥁 🎶 🎵

More on: Build mobile apps

Scqr [secureal]

Scqr [secureal]: the engineering practice of Reflerd Inc. (opens in a new tab)

Comments and feedback are welcome.