DEV Community

nabbisen
nabbisen

Posted on • Edited on • Originally published at scqr.net

Android Studio on Devuan 4: Install

Summary

Devuan GNU+Linux is a fork of Debian without systemd and hence Snaps (Snapd).
Even on it, it's easy to install Android Studio and start to develop Android 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

  • 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" in the official docs failed to locate or find.

Get Android Studio

Get the "Linux (64-bit)" package in the official downloads page.

android-studio-downloads-page

Then run to extract:

$ tar xzf android-studio-2022.3.1.18-linux.tar.gz
Enter fullscreen mode Exit fullscreen mode

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

Set up IDE

Update PATH environment variable to add android-studio:

$ # 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"
Enter fullscreen mode Exit fullscreen mode

Now the script below to start Android Studio is available:

$ studio.sh
Enter fullscreen mode Exit fullscreen mode

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

android-studio-first-running.png

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

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 instead of Java. Also, Build configuration language is nowadays Kotlin DSL (build.gradle.kts) instead of Groovy 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

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

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

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

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

PATH="$HOME/(...)/android-studio/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

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

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

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. The package is available.
Moreover, when you use a different Linux distro and can do Snaps, there is also the package.

🎶 🎵 🎸 Happy development 🥁 🎶 🎵

Top comments (0)