programing

Android Studio-기기가 연결되었지만 '오프라인'

nasanasas 2020. 10. 25. 12:24
반응형

Android Studio-기기가 연결되었지만 '오프라인'


이것은 매우 일반적인 질문이지만 어떤 솔루션도 나를 위해 작동하지 않는 것 같습니다. 처음 질문을 하셨으니 관례를 잘못 이해하면 사과드립니다.

Galaxy S5를 Ubuntu 14.04를 실행하는 컴퓨터에 연결하여 Android 개발을 수행하려고합니다. 최근에 Android Studio와 SDK를 다운로드하여 설치했는데 USB를 통해 연결되었을 때 기기가 감지되지만 기기가 '승인되지 않음'또는 '오프라인'으로 표시됩니다. RSA 키 프롬프트를 예상해야한다는 것을 알고 있지만 나타나지 않습니다.

나는 시도했다 :

  • 디버깅 확인이 활성화되었습니다.
  • adb kill-server 및 adb 장치 실행
  • 다시 시작 (장치, 개발자 옵션, 시스템)
  • USB 케이블을 간단히 뽑았다가 다시 연결
  • 내 adb 버전 확인 (1.0.31)
  • 다른 USB 포트 시도
  • USB 디버깅 인증 취소
  • Android Studio 내에서 ADB 통합 활성화 토글
  • PTP 장치 및 MTP 장치로 연결

나는 페도라를 실행하는 별도의 컴퓨터에서 시도해 보았고 문제없이 잘 작동하며 promopt가 즉시 나타납니다. 따라서 결함이있는 것은 USB 케이블이 아니라고 생각합니다.

어떤 아이디어?


다음을 시도하십시오.

  • USB 케이블을 분리했다가 다시 연결하십시오.
  • 그래도 작동하지 않으면 USB 케이블을 뽑고 장치 설정에서 USB 디버깅을 비활성화 한 다음 활성화하십시오.
  • 위의 두 가지 방법이 실패하면 장치를 재부팅하십시오.
  • 기기 재부팅도 실패하면 Android Studio도 재부팅하십시오.
  • 재부팅 안드로이드 스튜디오가 실패 할 경우, 시도 adb kill-serveradb start-server

도움이 되었기를 바랍니다.


adb adb kill-server죽인 다음 usb 디버깅을 비활성화 한 adb start-server다음 adb를 시작한 다음 usb 디버깅을 활성화하고 전화를 다시 연결하고 프로세스 사이에 전화를 잠들지 마십시오.

편집하다

노트북의 ADB RSA 키에 문제가있는 것으로 나타났습니다. 내 G3가 잘못된 키를 거부하고 랩톱이 ADB를 통해 연결하는 것을 허용하지 않는다고 가정하고 있습니다.

ADB는 Windows 컴퓨터의 여러 위치 중 하나에 키 파일을 저장합니다. 첫 번째는 adb.exe가 (C : \ android) 인 위치에 있고 두 번째는 사용자의> 프로필 (C : \ Users * username *. android), 세 번째 위치는 Windows 시스템 파일 (C : \ Windows \ System32 \ config \ systemprofile.android)이고 파일은> 확장자없이 "adbkey"라는 이름으로 간단하게 이름이 지정됩니다. ADB가 실행될 때 키 파일이 없으면 자동으로 생성됩니다.

내 사용자 폴더 (C : \ Users * username * .android)에 있습니다. 내가해야 할 일은 adbkey 파일을 삭제하고 ( "adbkey.pub"라는 파일도 있었지만> 나는 삭제했습니다) 명령 프롬프트 (adb start-server)에서 adb 서버를 다시 시작한 다음 전화기를 연결했습니다. 두 장치 간의 연결을 허용하는 내> G3의 RSA 지문 키 창을 즉시 받았습니다. 그런 다음 "adb devices"를 입력하면 내 휴대 전화의 일련 번호가 반환 된 다음 "device"가 사용 가능함을 표시합니다. > C : \ Users * username * .android \ 폴더로 돌아가서 새로운 "adbkey"및 "adbkey.pub"파일이 있는지 확인했습니다.

XDA에서 가져옴

2 편집

이 단계도 시도해보세요.

  1. .android가 저장된 위치로 이동
  2. .android를 열고 adbkey 및 adbkey.pub라는 파일을 삭제하십시오.
  3. ADB를 시작한 다음 입력 adb kill-server하고adb start-server

이 문제에 대한 수정 :

  1. Android 설정
  2. 개발자 옵션
  3. USB 디버깅 권한 취소
  4. 장치를 다시 연결하고 평소처럼 승인을 수락합니다.
  5. 이익

1 단계 : 개발자 옵션에서 USB 디버깅 끄기

2 단계 : USB 케이블 제거

3 단계 : USB 디버깅 켜기 (USB 구성에 달려 있음)

4 단계 : 명령 프롬프트에서 adb kill-server를 입력 한 다음 adb start-server를 입력합니다.

5 단계 : USB 케이블 연결

6 단계 : Android Studio에서 실행에 연결된 장치 확인 (목록에있는 장치를 볼 수 있어야 함)

7 단계 : 케이블을 사용하여 계속 실행하려면 이것으로 충분합니다.

(무선 디버깅을하려면 아래 단계를 계속하십시오)

8 단계 : adb tcpip 5555를 입력합니다. 오류가 표시되지 않으면 USB 케이블을 제거합니다.

9 단계 : About abd에서 전화기의 IP 주소를 찾은 다음 adb connect xxx.vvv.bn (사용자 전화기의 IP)을 입력합니다.

10 단계 : Android Studio에서 기기를 다시 체크인하면 기기 목록에 기기가 표시됩니다. 경우 예,


Windows에서 동일한 문제가 발생한 경우 adb.exe작업 관리자 에서 프로세스를 종료 한 다음 앱을 다시 실행 해보십시오.


Samsung Note II (N7100)를 연결할 수 없습니다.

1 단계. 위의 user4847410의 답변을 따릅니다 . 다음에 휴대 전화를 연결하면 인증 메시지가 표시되고 연결됩니다.

2 단계. 케이블도 교체했습니다.

3 단계. 특정 포트에 설치 한 것처럼 USB 포트를 확인하면 다른 포트가 적합하지 않을 수 있습니다.

참고 : 두 개의 배치 파일을 만들었습니다

adb-fix.bat

adb kill server
adb start server
pause

adb-devices.bat

adb devices
pause   

-정답에 투표했지만 좋아요가 부족하여 삭제되었습니다! -


I had a long white cable. Just wouldnt stay connected. Switched to another, shorter, black cable and it works 100% of the time.


A shorter cable did the trick.

It turns out that the wire thickness used inside the cable impacts on the resistance of the cable assembly – this resistance causes energy loss inside the cable when an attached load draws a current, and causes a voltage drop which can reduce the voltage to the end device to a point where it is not possible to charge quickly or completely.

http://goughlui.com/2014/10/01/usb-cable-resistance-why-your-phonetablet-might-be-charging-slow/


Change the USB cable !!!! I can't explain this technically, however after a lot of trial and error, this what have worked for me.


Disabling and Enabling the Developer options and debug mode on the Android phone settings fixed the issue.


You can try this:

  1. Go to tools/enable adb integration and uncheck it.

  2. now check it and run again. Next time, android studio will restart adb and it may find your device.


  • Restart adb by issuing these commands in cmd

    adb kill-server to kill existing adb session

    followed by adb start-server to start a new adb session
  • Disable and re-enable USB debugging on the phone and accept RSA fingerprints if asked by phone
  • Rebooting the phone if it still doesn't work.

If all above don't solve your problem, you may try delete environment variable named "ANDROID_SDK_HOME". It really solved my problem. Hope it Help you!


To fix this, use USB2 instead of USB3


This problem is because you have used an old adb version and not support on your device. or you have more than one adb

The key is:

  • make sure you have a latest adb executable on your SDK
  • Make sure to run adb command from "SDK_DIR/platform-tools/" because this should be the latest version (type command "which adb" to check) if u have more than one adb file, you can rename another one.

in my case, on my Windows 7 i have one more adb on "C:\Windows\adb.exe" and its an old version, so my adb command always run from that file. I fixed the problem by running adb form my sdk directory "SDK_DIR/platform-tools/adb.exe"


On windows--> Launch your terminal from the platform-tools folder inside android sdk.

Then use the following commands

adb kill server
adb start server

it should work


Earlier for almost 3hrs I did:

  1. I tried everything given in several sites and my android device never came online.
  2. when I was running adb kill-server and then adb-startserver the "Device File Explorer" on the right bottom of the android studio showed "Device is not online (DISCONNECTED)".

Here is how solve this:

  1. Revoked all USB debugging authorization on the device under "Develop options"
  2. And I added sudo to command "sudo adb kill-server" and then " sudo adb start-server".
  3. After this the message in "Device File Explorer" in android studio changed to "device is pending authentication please accept debugging session on the device". But no message appeared on the device. Tried stopping-restarting adb, connect reconnet usb cable, stop-start usb debugging but nothing worked.
  4. Went back to device and changed the device usb settings from usb charging to "PTP", and, restarted the Android studio. And, boom, the message appeared on the phone to accept the debugging session on device.

Try upgrade your Android SDK Platform as below steps:

  1. Run the SDK Manager

  2. Execute "Install packages…"

  3. Restart the SDK Manager

I tried and it's ok for me.

ref: link


You maybe having an older version of the ADB, Update the tools package and that should bring down the latest ADB.


I also recently had this problem and I solved it by rebooting Android Studio. But my friend had to have the original cable for his device, no other cables worked.


In my case (same problem - that Nexus 5 is connected but with "offline" status) the problem was solved by "Invalidate caches and Restart" in Android Studio. Suppose that problem was in adb and restarting Android Studio causes to adb restart.


Download and Install your device driver manually through visiting manufacturer website like :Samsung,micromax,intex etc.


In my case the problem was that I used a USB extension cable. As soon as I plug the microUSB cable right into the PC the device has detected.


In my case, turned out that you need to be logged as owner of device to properly accept the USB debugging.

Tried the "Disable and re-enable USB debugging on the phone" step but didn't get the RSA prompt on "normal" user, switched to owner and tried again and got it.


I had this issue on a device with USB-C using a microUSB cable with a USB-C adapter. After switching to a USB-C cable without any adapter it worked. I only saw this issue on a LeEco.


I tried most of the things on this page and none of them worked for my Samsung S5. However, when I switched the cable to a USB-C type the problem seemed to be solved...until next time.


Besides the solution mentioned above, try to download Samsung's Android USB Driver for your platform. Here is a link to the Windows one:

https://developer.samsung.com/galaxy/others/android-usb-driver-for-windows


If your app doesn't manipulate WiFi connections - another slightly different solution, which bypasses USB issues entirely - enabling a wireless debugging connection - ADB over WiFi/TCP/IP.


Reboot the your mobile this will fix it.

참고URL : https://stackoverflow.com/questions/30964854/android-studio-device-is-connected-but-offline

반응형