??????在Ubuntu中没有Android开发权限

时间:2023-01-20 21:30:55

I used this answer for fixing this problem - set up device for development (?????? no permissions), and it has helped me. But there is the following problem - after rebooting the system I must execute the following commands:

我用这个答案来解决这个问题 - 设置开发设备(??????无权限),它帮助了我。但是存在以下问题 - 重新启动系统后,我必须执行以下命令:

sudo service udev restart
sudo killall adb
sudo ~/android-sdk-linux/platform-tools/adb start-server

After it all is good. But how can I fix it? I don't want to execute it each time after rebooting my system.

一切都很好。但是我该如何解决呢?我不希望每次重启系统后都执行它。

1 个解决方案

#1


0  

First open terminal and enter gksudo gedit /etc/rc.local and modify the file as shown below

首先打开终端并输入gksudo gedit /etc/rc.local并修改文件,如下所示

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

PASSWORD='yourPasswordHere'

echo $PASSWORD | sudo -S service udev restart
echo $PASSWORD | sudo -S killall adb
echo $PASSWORD | sudo -S ~/android-sdk-linux/platform-tools/adb start-server

exit 0

Now try adb devices after restarting your system. Make sure you replace yourPasswordHere with your login password. I haven't tested it. Hope this helps.

现在,请在重新启动系统后尝试使用adb设备。确保用您的登录密码替换yourPasswordHere。我没有测试过。希望这可以帮助。

#1


0  

First open terminal and enter gksudo gedit /etc/rc.local and modify the file as shown below

首先打开终端并输入gksudo gedit /etc/rc.local并修改文件,如下所示

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

PASSWORD='yourPasswordHere'

echo $PASSWORD | sudo -S service udev restart
echo $PASSWORD | sudo -S killall adb
echo $PASSWORD | sudo -S ~/android-sdk-linux/platform-tools/adb start-server

exit 0

Now try adb devices after restarting your system. Make sure you replace yourPasswordHere with your login password. I haven't tested it. Hope this helps.

现在,请在重新启动系统后尝试使用adb设备。确保用您的登录密码替换yourPasswordHere。我没有测试过。希望这可以帮助。