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.
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.
Then run to extract:
$ 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
:
$ # 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:
$ studio.sh
You will see the first confirmation. Well, I didn't have an existing one to import.
Follow the wizard to set up the IDE.
I chose "Custom" above. "Standard" setup is, of course, also available.
You can make detailed configuration in "Custom" mode:
Settings are completed.
Next, agreeing to the licenses for the components is required:
Clicking "Finish" starts to download:
Done:
Create an Android project
Then, the wizard below to create a project will show automatically.
Choose "New Project":
Choose an app template:
Configure the project:
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.
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".
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.
Building it will start:
After it finished, the app will come :)
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:
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"
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
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)