UFO ET IT

루팅되지 않은 전화의 경우 USB 케이블없이 무선을 통한 Adb

ufoet 2020. 12. 9. 20:58
반응형

루팅되지 않은 전화의 경우 USB 케이블없이 무선을 통한 Adb


이 질문에 이미 답변이 있습니다.

내 휴대폰 (LG nexus 4)에서 Android 앱을 디버깅하고 싶습니다. 여행 중에 USB 케이블을 잊어 버렸습니다. 집에서 일할 때는 USB 케이블을 연결하고 'adb tcpip 5555'명령을 실행하기 만하면됩니다. 그런 다음 USB 케이블을 분리하고 'adb connect IP'를 통해 연결할 수 있습니다.

하지만 이제는 케이블이 없기 때문에 첫 번째 명령을 실행할 수 없습니다. 이전에 이미 'adb tcpip'명령을 실행했기 때문에 매번 수행해야하는 이유를 이해할 수 없습니다.

내가 지금 시도한 것 :

내 Android에 터미널 애플리케이션을 설치하고 해당 명령을 실행하려고했지만 "장치를 찾을 수 없음"오류가 발생했습니다. 아마도 그는 자신을 볼 수 없을 것입니다 ...

"Android 개발 옵션"에서 합리적인 옵션을 검색하고 모든 것이 Wifi와 관련이있는 것처럼 보이게했습니다. 하지만 도움이되지 않았습니다.

StackOverflow를 검색했지만 이전에 USB 케이블을 통한 연결과 관련된 모든 답변을 찾았습니다. 케이블없이이 연결을 할 수있는 방법이 있습니까?

일부 정보 : 내 Nexus 4가 루팅되지 않았습니다. 안드로이드 버전은 5.1.1입니다.


같은 문제가 있었지만 USB-c 만있는 Macbook Pro (2016)를 사용하고 있으며 집에서 어댑터를 잊어 버렸습니다.

내 개발 컴퓨터에서 adb를 전혀 실행할 수 없기 때문에 다른 접근 방식을 찾았습니다.

USB 케이블로 전화를 다른 컴퓨터 (동일한 WiFi)에 연결하고 거기에서 실행 adb tcpip를 활성화합니다.

Master-machine : 개발이 진행되는 컴퓨터, USB-C 커넥터 만 사용

슬레이브 머신 : USB가 있고 동일한 WiFi에있는 다른 컴퓨터

단계 :

  1. 전화기를 다른 컴퓨터 (슬레이브 머신)에 연결
  2. adb usb && adb tcpip 5555거기에서 실행
  3. 마스터 머신에서

    deko$: adb devices
    List of devices attached
    
    deko$: adb connect 10.0.20.153:5555
    connected to 10.0.20.153:5555
    
  4. 이제 Android Studio 또는 Xamarin이 휴대폰에 앱을 설치하고 실행할 수 있습니다.


사이드 노트 :

또한 전화에서 마스터 컴퓨터로의 Bluetooth 테 더링을 테스트하고 성공적으로 전화에 연결했습니다. Android Studio와 Xamarin은 모두 잘 작동했지만 Xamarin의 업로드 프로세스는 시간이 오래 걸렸습니다. 하지만 작동합니다.


문제는 루팅되지 않은 장치에 관한 것이지만 루팅 된 경우 가장 간단한 방법은 다음과 같습니다.

전화기의 터미널에서 다음을 수행하십시오.

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

자세한 내용은 이 답변참조 하십시오.


귀하의 질문에

루팅되지 않은 전화의 경우 USB 케이블없이 무선 통한 Adb

 You can't do it for now without USB cable.

하지만 다음과 같은 옵션이 있습니다.

참고 : 다음을 수행하려면 USB를 한 번 이상 넣어야합니다.

USB 케이블을 통해 장치를 컴퓨터에 연결해야합니다. USB 디버깅이 작동하는지 확인하십시오. 실행할 때 나타나는지 확인할 수 있습니다 adb devices.

... \ AppData \ Local \ Android \ sdk \ platform-tools에서 cmd를 엽니 다.

1 단계 : 실행 adb devices

예 : C : \ pathToSDK \ platform-tools> adb devices

adb 기기를 실행할 때 표시되는지 확인할 수 있습니다.

2 단계 : 실행 adb tcpip 5555

예 : C : \ pathToSDK \ platform-tools> adb tcpip 5555

장치를 분리합니다 (USB 케이블 제거).

3 단계 : 설정-> 전화기 정보-> 상태로 이동하여 전화기의 IP 주소를 확인합니다.

.

4 단계 :`adb connect 실행

예 : C : \ pathToSDK \ platform-tools> adb connect 192.168.0.2

Step5: Run adb devices again, you should see your device.

Now you can execute adb commands or use your favourite IDE for android development - wireless!

Now you might ask, what do I have to do when I move into a different work space and change WiFi networks? You do not have to repeat steps 1 to 3 (these set your phone into WiFi-debug mode). You do have to connect to your phone again by executing steps 4 to 6.

Unfortunately, the android phones lose the WiFi-debug mode when restarting. Thus, if your battery died, you have to start over. Otherwise, if you keep an eye on your battery and do not restart your phone, you can live without a cable for weeks!

See here for more

Happy wireless coding!

Ref: https://futurestud.io/tutorials/how-to-debug-your-android-app-over-wifi-without-root

UPDATE:

If you set C:\pathToSDK\platform-tools this path in Environment variables then there is no need to repeat all steps, you can simply use only Step 4 that's it, it will connect to your device.

To set path : My Computer-> Right click--> properties -> Advanced system settings -> Environment variables -> edit path in System variables -> paste the platform-tools path in variable value -> ok -> ok -> ok


This might help:

If the adb connection is ever lost:

Make sure that your host is still connected to the same Wi-Fi network your Android device is. Reconnect by executing the "adb connect IP" step. (IP is obviously different when you change location.) Or if that doesn't work, reset your adb host: adb kill-server and then start over from the beginning.


If usb is not working you should checkout debugging over bluetooth (Without Rooting)

http://zcourts.com/2013/07/19/android-debugging-over-bluetooth-without-root/#sthash.hVCLtWSk.dpbs


There are actually apps on the Play store to enable wifi connections automatically. You'll need root though to do it without a cable. The top choices in https://play.google.com/store/search?q=adb%20wireless all have root and non-root options. Without root you'll need to connect your cable as before; with root you can just enable the app. That saves you having to mess with the Bluetooth option.

If you also add adb to your system path on windows it makes connecting via wifi very quick and easy. Enable the app and type one line in any terminal window and you're connected.


type in Windows cmd.exe

    cd %userprofile%\.android
    dir
    copy adbkey.pub adb_keys
    dir

copy the file adb_keys to your phone folder /data/misc/adb. Reboot the phone. RSA Key is now authorized.

from: How to solve ADB device unauthorized in Android ADB host device?

now follow the instructions for adb connect, or use any app for preparing. i prefer ADB over WIFI Widget from Mehdy Bohlool, it works without root.

from: How can I connect to Android with ADB over TCP?


Connect android phone without using USB cable except XIAOMI PHONES
== MAKE SURE THAT YOUR PHONE HAS USB DEBUGGING ENABLED ==
== IP Address series should NOT be '0' like 192.168.0.10
1. Connect your PC (Laptop) and Android phone to same wifi network.
2. Go to the Android SDK folder > platform-tools and open command prompt by holding the shift key and right clicking on the folder.
3. Type the command "adb tcpip 5555", and hit Enter, sometimes it gives an error but ignore it and go ahead.
4. Type "adb connect [YOUR PHONE IP]". example: "adb connect 192.168.1.34" and hit enter, your phone will be connected to PC.

참고URL : https://stackoverflow.com/questions/31327839/adb-over-wireless-without-usb-cable-at-all-for-not-rooted-phones

반응형