Android

From Void Linux Wiki
Jump to: navigation, search

Android udev Rules

The Android udev Rules are needed to use the Android Debug Bridge (ADB). The plainest way is to use this Github Repo.

Installing udev Rules

Note: You must update the rules by yourself!

Go to the /opt folder

# cd /opt

Clone the repo

# git clone https://github.com/M0Rf30/android-udev-rules.git

Copy the rules file

# cp android-udev-rules/51-android.rules /usr/lib/udev/rules.d/51-android.rules

Change file permission

# chmod a+r /usr/lib/udev/rules.d/51-android.rules

Add the adbusers group if it's doesn't already exist

# groupadd adbusers

Add your user to the adbusers group

# usermod -a -G adbusers USERNAME

Restart UDEV

# udevadm control --reload-rules

Restart ADB

# adb kill-server && adb devices

Now your device should show up. When it didn't restart your computer.

Creating udev Rules

When you only want create one rule for your phone/tablet, then first we nee to no the the vendor_id:product_id pair.

# lsusb

Then create the rule, like this

# echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="[VENDOR ID]", MODE="0666", OWNER="abusers"'  > /usr/lib/udev/rules.d/51-android.rules

Change file permission

# chmod a+r /usr/lib/udev/rules.d/51-android.rules

Add the adbusers group if it's doesn't already exist

# groupadd adbusers

Add your user to the adbusers group

# usermod -a -G adbusers USERNAME

Restart UDEV

# udevadm control --reload-rules

Restart ADB

# adb kill-server && adb devices

Now your device should show up. When it didn't restart your computer.

Android Debug Bridge (ADB)

Android Debug Bridge is a versatile command-line tool that lets you communicate with a device.

Installing Android Debug Bridge & Fastboot

# xbps-install -S android-tools

Using adb & fastboot

To use adb and fastboot you must install the udev rules.

Android Studio

Android Studio is the official integrated development environment (IDE) for Google's Android operating system, built on JetBrains' IntelliJ IDEA software and designed specifically for Android development. It is available for download on Windows, macOS and Linux based operating systems. It is a replacement for the Eclipse Android Development Tools (ADT) as primary IDE for native Android application development.

Installing Android Studio

To install Android Studio firstly you need to enable the nonfree repository if you haven't yet.

# xbps-install -Sy void-repo-nonfree && xbps-install -Suv

Next, install the android-studio package hosted by this repos:

# xbps-install -S android-studio