[GUIDE]ADB Over Network to Connect Nexus 7 with Nexus 4

Search This thread

DeepPurple15X

Member
Jan 5, 2013
26
8
If you turn on "ADB over Network" on your Nexus 4 and try to connect on your Nexus 7 you will run into a small problem. The device will get connected but you will be unable to use ADB because of the RSA Authorization failing. This guide will help fix that that problem.
I am no hacker/developer. This is just to share my experience. I am not responsible if you mess your device up.

Perquisites (what I used):
Nexus 7 (rooted) Android 4.3.1
Nexus 4 (rooted) OmniRom Android 4.4.2
Windows PC w/ AndroidSDK (you only need adb.exe)
Android Terminal Emulator installed on both devices. Available on Playstore.

Process:

Step 1.
Open Android Terminal Emulator on the Nexus 7.
Code:
su
adb kill-server
HOME=/sdcard adb start-server
This will create two files in the “/sdcard/.android/” directory on the Nexus 7. We need to transfer the “adbkey.pub” to the Nexus 4.

Step 2.
Connect the Nexus 7 to the computer and run the “adb.exe”. The following code will download the key to the “adb.exe” directory.
Code:
adb pull /sdcard/.android/adbkey.pub
Then disconnect the Nexus 7 and connect the Nexus 4. Then we send the file using “adb” using the push command. I am putting the file in the “/sdcard”
Code:
adb push adbkey.pub /sdcard
Step 3:
Now you can either use Android Terminal Emulator on your Nexus 4(which is what I did) or “adb shell” on your computer. Simply append the key to the “adb_key”
Code:
su
cat /sdcard/adbkey.pub  >> /data/misc/adb/adb_key
Step 4.
To start ADB over Network on Nexus 4
Code:
su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
On the Nexus 7 connect to phone ip address. If you don’t know what that is head over to Settings>Wi-fi >Advanced Wi-fi >Scroll down to IP Adress . Lets assume its 192.168.1.100
Code:
adb connect 192.168.1.100
adb devices
If you get a ‘Allow USB Debugging ?’ alert on your phone click ‘OK’. Now you can use adb commands . If you can help me improve this guide let me know in comments. This is my first guide. I am no expert in android but I will try to answer your questions.

Remember to switch off "ADB over Network" on Nexus 4
Code:
su 
setprop service.adb.tcp.port -1
stop adb
start adb

To check "ADB over Network"
Code:
getprop service.adb.tcp.port

More Info
Code:
https://code.google.com/p/android/issues/detail?id=48126
http://xdaforums.com/showthread.php?t=1685736
 
  • Like
Reactions: LeoYL and kirev

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    If you turn on "ADB over Network" on your Nexus 4 and try to connect on your Nexus 7 you will run into a small problem. The device will get connected but you will be unable to use ADB because of the RSA Authorization failing. This guide will help fix that that problem.
    I am no hacker/developer. This is just to share my experience. I am not responsible if you mess your device up.

    Perquisites (what I used):
    Nexus 7 (rooted) Android 4.3.1
    Nexus 4 (rooted) OmniRom Android 4.4.2
    Windows PC w/ AndroidSDK (you only need adb.exe)
    Android Terminal Emulator installed on both devices. Available on Playstore.

    Process:

    Step 1.
    Open Android Terminal Emulator on the Nexus 7.
    Code:
    su
    adb kill-server
    HOME=/sdcard adb start-server
    This will create two files in the “/sdcard/.android/” directory on the Nexus 7. We need to transfer the “adbkey.pub” to the Nexus 4.

    Step 2.
    Connect the Nexus 7 to the computer and run the “adb.exe”. The following code will download the key to the “adb.exe” directory.
    Code:
    adb pull /sdcard/.android/adbkey.pub
    Then disconnect the Nexus 7 and connect the Nexus 4. Then we send the file using “adb” using the push command. I am putting the file in the “/sdcard”
    Code:
    adb push adbkey.pub /sdcard
    Step 3:
    Now you can either use Android Terminal Emulator on your Nexus 4(which is what I did) or “adb shell” on your computer. Simply append the key to the “adb_key”
    Code:
    su
    cat /sdcard/adbkey.pub  >> /data/misc/adb/adb_key
    Step 4.
    To start ADB over Network on Nexus 4
    Code:
    su
    setprop service.adb.tcp.port 5555
    stop adbd
    start adbd
    On the Nexus 7 connect to phone ip address. If you don’t know what that is head over to Settings>Wi-fi >Advanced Wi-fi >Scroll down to IP Adress . Lets assume its 192.168.1.100
    Code:
    adb connect 192.168.1.100
    adb devices
    If you get a ‘Allow USB Debugging ?’ alert on your phone click ‘OK’. Now you can use adb commands . If you can help me improve this guide let me know in comments. This is my first guide. I am no expert in android but I will try to answer your questions.

    Remember to switch off "ADB over Network" on Nexus 4
    Code:
    su 
    setprop service.adb.tcp.port -1
    stop adb
    start adb

    To check "ADB over Network"
    Code:
    getprop service.adb.tcp.port

    More Info
    Code:
    https://code.google.com/p/android/issues/detail?id=48126
    http://xdaforums.com/showthread.php?t=1685736