UFO ET IT

openSUSE 13.2에서 실행되는 Android Studio Workspace의 장치에 대한 권한이 부족합니다.

ufoet 2020. 12. 13. 10:00
반응형

openSUSE 13.2에서 실행되는 Android Studio Workspace의 장치에 대한 권한이 부족합니다.


Quarx에서 만든 Cyanogenmod v11 사용자 정의 ROM (야간 빌드)을 실행하는 루팅 된 Motorola Defy +가 있습니다 . Android Studio Workspace (ASW) v.1.1.0을 사용하여이 기기에서 디버깅을 시도하면

????????????[null]

장치 선택 창에 나열되고 Logcat 창이 표시됩니다.

insufficient permissions for device

디버깅 목적으로이 장치와 ROM을 사용하고 싶습니다.

lsusb명령 줄에서 입력하면

Bus 002 Device 002: ID 22b8:431d Motorola PCS

Motorola 장치에 대한 올바른 장치 ID입니다. 51-android.rules 및 71-android.rules /etc/udev/rules.d/를이 파일에 올바른 Motorola ID와 함께 설치했습니다.

또한 장치의 개발자 옵션 에서 USB 디버깅 권한 취소 를 시도했지만 운이 없었습니다.

다른 옵션이있을 수 있기를 바라면서 ASW를 루트로 실행하려고 시도하지 않았습니다. 거기 있어요?

업데이트 : 다음 방법으로 ADB에 액세스 할 수있었습니다.

uvachem-gsmith2:/home/greg/Android/Sdk/platform-tools # ./adb

그런 다음 서버를 죽이고 루트 사용자에게 SU를 수행하고 서버를 다시 시작했습니다. 그런 다음 Android Studio에서 장치에 연결을 시도했습니다. PC에서 RSA 키를 수락한다는 메시지가 장치에 표시되고 "예"라고 답한 다음 장치에 앱을 배포 할 수있었습니다. 내 원래 질문으로 돌아가서, 루트로 로그인하지 않고이 장치에 액세스하는 다른 방법이 있습니까? 전화 파일 시스템에 권한 문제가있는 것 같습니다.

업데이트 # 2 여기서 핵심 문제는 권한 문제였습니다. ADB를 루트로 실행하면 루팅 된 Android 기기에 액세스 할 수 있지만 더 나은 해결책은이 기기의 udev 파일에서 권한을 변경하는 것입니다 ... 664를 666으로 재설정 (아래 답변 참조). 이렇게하면 PC가 장치의 파일 시스템에 액세스 할 수 있습니다.


Android 5.1을 실행하는 Nexus 4와 함께 Linux 시스템을 사용하는 동안이 문제가있었습니다.

수정 사항은 'USB를 통한 디버그'와 'MTP로 연결'을 모두 활성화하는 것이 었습니다. OSX에서 동일한 기기와 Android Studio 및 adb를 사용할 때는 그 반대입니다. Android Studio가 핸드셋을 인식하도록하려면 'connect as MTP'를 비활성화해야합니다.


나를 위해 일한 간단한 대답을 찾았습니다.

adb kill-server
sudo adb start-server
sudo adb devices

그러면 장치를 찾을 수 있습니다. 도움이 되었기를 바랍니다.

참조 : http://itsfoss.com/fix-error-insufficient-permissions-device/


간단 해. USB 모드를 파일 전송 모드로 변경하면 작동합니다.


/etc/udev/rules.d/51-android.rules에서이 줄의 권한 변경,

#Motorola 
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0664", GROUP="plugdev"

에,

#Motorola 
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"

adb를 루트로 실행할 필요가없는 방식으로이 문제를 해결합니다.


MTP는 더 이상 사용할 수 없습니다. 내 안드로이드 8에서 "파일 전송"옵션이 작동하지 않았습니다.

"사진 PTP 전송"이 작동하고 Studio에서 장치 이름이 표시됩니다.

휴대 전화의 단계

  1. 개발자 옵션 열기
  2. USB 디버깅을 활성화합니다.
  3. USB 연결을 PTP로 변경

Linux에서의 단계

  1. 콘솔 실행시 sudo usermod -aG plugdev $LOGNAME

내 전화 Symphony W75 에서 옵션 USB 컴퓨터 연결 -> 미디어 장치 (MTP)로 연결을 선택 하면 문제가 해결되었습니다.


이전에 정상적으로 연결되었던 장치 (Nvidia Shield)를 업데이트했기 때문에 PC 설정이 이미 올바른지 알고있었습니다. 개발자 설정은 Android 7.0에서 새로운 레이아웃을 가진 것 같습니다.

설정> 기본 설정> 개발자 옵션> 네트워킹> USB 구성 선택에 있습니다.

여기에서 PTP를 선택해야했고 모든 것이 다시 정상적으로 작동합니다.

USB 구성 모드 선택


짧게 말하면 Prestigio PMP5570C 태블릿 에서 동일한 문제가 발생했습니다.

당신이해야 할 일은 당신이 컴퓨터로 /로부터 데이터를 복사하고 싶다는 것을 태블릿에서 확인하고 (내가 잊은 것) @portsample이 쓴 두 줄을 추가하는 것입니다.

장치 입력 idVendor찾을 수 있습니다.

lsusb

UBUNTU 12.04에서는 다음을 얻습니다.

버스 001 장치 011 : ID 2207 : 0010,

where 2207 is your vendor id. Summed up the question and answer...


This procedure solves the problem for me:

- On the Android device, drag the top menu and select "USB for file transfer"
- Press "Run" again

What the F... ! :) Note : I have seen it on android 8.1 on a One+5t...

Even we do all of above, it is necessary to make something on your android device .. in addition to go in dev options menu (usb debug) (don't hesitate to reset "cancel authorization" or something like this (I am in french version ;) )

If some people meet the same problem than me, maybe it could be usefull for you too : Don't forget to authorize devices in your phone (each time of usb connect on the android device if you don't select always box). Beside, you can suppress the old authorized devices on your phone and start with proper parameter to authorize clearly your pc on your android device

When you connect the android device, a pop up or notification ask to authorize a mac address or equivalent to the device : authorize it if you want to authorize connection between your linux pc and your android device.

It is necessary to obtain autorisation on your android device when you use connect the usb cable (if you don't accept all the time but if it is the first time this box is going to appear on your devices) if you don't do it, adb devices show unauthorized even all rights are good (666, UDEV etc)

Note : thank you for your precious help. A last thing, sorry for my english


For me and possibly many others the issue is to do with access rights to devices on the machine. Now that this is well documented in the android documentation, I think the best solution is here

On Debian based Systems you can run lsusb or dmesg to get vendor id if your vendor does not exist on the given list


I have face the same problem and i have resolved this by Adding the path of your_android_sdk_path to the environment variable like

sudo export $PATH:/your_android_sdk_path/platform-tools/adb

its your wish how you want to add this to your account or system wide by editing these file ~/.bashrc file or ~/.profile or /etc/profile, /etc/bash.bashrc, or /etc/environment if u want to add to system wide access.

and then create the link of that in bin

sudo ln -s /your_android_sdk_path/platform-tools/adb /bin/adb

if you have used adb devices or any command then first kill the server like

adb kill-server

then start the server like

adb start-server
adb devices

now you can see your devices are listed properly without an issue


As the error message said, it is a permission insufficient problem. In my experience, it only happened on my Linux machine, and works well on MacOS and Windows. Launching your Android Studio with root permission could avoid this problem.

$sudo /your_android_studio_path/bin/studio.sh

I made a script for this error. For me it works fine in Fedora 28, but it should work in many Linux distributions. Just create a file with the content of the selfexpanied script. I called it usbDebbugingAndroidStudio.sh
Give him execution permission with: chmod +x usbDebbugingAndroidStudio.sh

And run it: sudo ./usbDebbugingAndroidStudio.sh

After that check the list displayed by the command lsusb and introduce the Id of your device. For example: My output was: Bus 006 Device 002: ID 05c6:9091 Qualcomm, Inc. So I type 05c6 and press enter.

The script:

#!/usr/bin/env bash


#This script configure Android Debug Bridge permissions to solve the following
#error: com.android.ddmlib.AdbCommandRejectedException: insufficient permissions for device
#This error is produced when you try to install an APK from Android Studio in your device.
#You can check the vendorId here:
#https://developer.android.com/studio/run/device#setting-up
#If your device's brand isn't listed check the info displayed by the command lsusb

lsusb
#My output was:
#Bus 006 Device 002: ID 05c6:9091 Qualcomm, Inc.
#The id for this line is 05c6
echo -n "Enter the id of your mobile device: "
read usbProviderId
cd /etc/udev/rules.d/
sudo touch 51-android.rules
(
sudo cat << _EOF_
SUBSYSTEM=="usb", ATTR{idVendor}=="$usbProviderId", MODE="0666", GROUP="plugdev"
_EOF_
) | sudo tee 51-android.rules

#Give read and write permissions to the file
sudo chmod a+r /etc/udev/rules.d/51-android.rules

#Kill the Android Debug Bridge server to restart it
cd $HOME/Android/Sdk/platform-tools
sudo ./adb kill-server

#If this still doesn't work unplug the usb cable and connect again.
#And repeat the last step Kill the ADB server.

In my situation:

cd /etc/udev/rules.d/
sudo chmod a+r ./*.rules  #the name of your rules files.

Then,I can use adb without this error.


수락 된 답변이 효과가없는 경우 다음 단계를 따르십시오. Android 스튜디오 터미널을 엽니 다.

adb 킬 서버

adb 시작 서버

그것은 나를 위해 일했습니다.


  • 활성화 USB debugging
  • USB를 사용하여 transer file

참고 URL : https://stackoverflow.com/questions/28704636/insufficient-permissions-for-device-in-android-studio-workspace-running-in-opens

반응형