Last active
May 14, 2018 10:13
-
-
Save SolarLiner/74421110ca78f3c3fc4c8e4b098dede5 to your computer and use it in GitHub Desktop.
Ubuntu: Add udev rules for Android from upstream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIR=`mktemp -d` | |
# Clone the repository | |
git clone https://github.com/M0Rf30/android-udev-rules.git $DIR | |
cd $DIR | |
echo "Copying files" | |
sudo cp 51-android.rules /etc/udev/rules.d/51-android.rules | |
# Change file permissions | |
sudo chmod a+r /etc/udev/rules.d/51-android.rules | |
echo "(Re)creating adbusers group" | |
groupdel adbusers > /dev/null | |
sudo mkdir -p /usr/lib/sysusers.d/ && sudo cp android-udev.conf /usr/lib/sysusers.d/ | |
sudo systemd-sysusers | |
echo "Adding user to group" | |
sudo usermod -a -G adbusers $(whoami) | |
echo "Restarting udev" | |
sudo udevadm control --reload-rules | |
sudo service udev restart | |
echo "Restarting ADB server" | |
adb kill-server | |
read -n1 -r -p "(Re-)plug your device and press any key to continue..." key | |
echo "You should see your device below:" | |
adb devices |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment