ADB over network
Moderator: Martin
ADB over network
Is there (maybe indirect) action for the toggling ADB over network? If not, this is a FR.
I've tried System Setting Changed: <All categories> *, but it triggering only for the ADB option itself, but not for the ADB over network.
I've tried System Setting Changed: <All categories> *, but it triggering only for the ADB option itself, but not for the ADB over network.
Re: ADB over network
No need for additional feature, this is niche function, can be done via root command. You must have root to toggle the adb over wifi. You can do it without root via adb over USB debugging, but it will be reset on every restart. Since you are using AICP, I assume you have root already. Simply use Execute root command :
After you paste the command, it seems there is no newline, but no problem, it is just the visual. Execute it, it will turn on the adb over wifi. To connect to your phone, use
replace the IP with the IP of your phone
After you have finished, to reduce security risk, you can turn off the adb over wifi again. Use the same execute root command, simply set the port to -1
This will disable adb over wifi and return back to adb over usb mode.
You can create it in toggle mode by using shortcut and switch over each mode. Or you can simply control it using Trigger HTTP request, just like what I have been using it for.
Code: Select all
setprop service.adb.tcp.port 5555
stop adbd
start adbd
Code: Select all
adb connect 192.168.1.100
After you have finished, to reduce security risk, you can turn off the adb over wifi again. Use the same execute root command, simply set the port to -1
Code: Select all
setprop service.adb.tcp.port -1
stop adbd
start adbd
You can create it in toggle mode by using shortcut and switch over each mode. Or you can simply control it using Trigger HTTP request, just like what I have been using it for.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: ADB over network
Thanks, Desmanto.
I've already tried this method from a terminal and it worked, but there is one minor issue – corresponding UI toggle not switching (at least on my device). Not a real problem, but inaccurate. Though if there is no another way...
I've already tried this method from a terminal and it worked, but there is one minor issue – corresponding UI toggle not switching (at least on my device). Not a real problem, but inaccurate. Though if there is no another way...
Re: ADB over network
upd:
Another (not so small) problem is that setting port/restarting service not affecting status bar notification. So, there is no way to see actual ADB over network status after playing the service.
Another (not so small) problem is that setting port/restarting service not affecting status bar notification. So, there is no way to see actual ADB over network status after playing the service.
Re: ADB over network
Yes, the quick setting seems not synced properly to the current state, after being changed by Automagic. Other quick settings value too, such as some report it is bluetooth. For me it is the language and this adb over wifi.
Sometimes we have no way to really force the system to reread the system value we have changed. As in demo mode, where I can't force the system to enter demo UI mode, I ended up using am broadcast with root, to put it into demo mode.
We can use the built-in quick setting tile and adjust our icon accordingly. So we don't use built-in one from android, but create our own version instead. Of course you have to remove built-in one and add the automagic version. There are 5 tiles you can use. Toggle the icon everytime you change the adb over wifi state.
BTW, I just know AICP is based on LOS too. So you can try to use Set LineageOS system setting to see if there is anything you can change to trigger this. At mine, RR 6.2, change the adb port to 5555 via this action, cause error.
I tried to edit the database using MiXplorer, at /data/user_de/0/org.lineageos.lineagesettings/databases/lineagesettings.db, at the secure db, adb_port to 5555, still doesn't trigger the adb over wifi state. So it seems root command is the only way.
Sometimes we have no way to really force the system to reread the system value we have changed. As in demo mode, where I can't force the system to enter demo UI mode, I ended up using am broadcast with root, to put it into demo mode.
We can use the built-in quick setting tile and adjust our icon accordingly. So we don't use built-in one from android, but create our own version instead. Of course you have to remove built-in one and add the automagic version. There are 5 tiles you can use. Toggle the icon everytime you change the adb over wifi state.
BTW, I just know AICP is based on LOS too. So you can try to use Set LineageOS system setting to see if there is anything you can change to trigger this. At mine, RR 6.2, change the adb port to 5555 via this action, cause error.
Although I have granted Automagic root access and write LOS permissionch.gridvision.ppam.androidautomagiclib.util.m: Root functions must be enabled in the settings or secure settings permission must be granted by adb (see help)
at ch.gridvision.ppam.androidautomagic.model.a.ex$1.a(SourceFile:207)
at ch.gridvision.ppam.androidautomagic.model.a.ex$1.c(SourceFile:157)
at ch.gridvision.ppam.androidautomagiclib.util.ci$1.run(SourceFile:40)
at java.lang.Thread.run(Thread.java:764)
Code: Select all
adb shell pm grant ch.gridvision.ppam.androidautomagic lineageos.permission.WRITE_SECURE_SETTINGS
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: ADB over network
Thanks for a detailed explanation.
Interesting, but I've got different error when trying to set LOS Settings secure/adbPort value:
Of course, AM granted root and WRITE_SECURE_SETTINGS.
upd: BTW, what is a proper name for this setting? ADB_PORT, adbPort, adb_port or whatever?
Interesting, but I've got different error when trying to set LOS Settings secure/adbPort value:
Code: Select all
ch.gridvision.ppam.androidautomagiclib.util.m: The settings have not been verified yet. Please verify first.
upd: BTW, what is a proper name for this setting? ADB_PORT, adbPort, adb_port or whatever?
Last edited by beelze on 05 Nov 2018 18:21, edited 1 time in total.
Re: ADB over network
You have to check I have verified the setting everytime you change the value. Or you can disable the warning in the Settings > General > Hide setting confirmation.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: ADB over network
Well, I've ended with the same «Root functions must be enabled…». All 3 name variants – the same exception.
Re: ADB over network
So this is considered a bug then. Granting it lineageos permission and root, still can't set the value. But choosing category system, the value set fine. Only secure and global have this error as posted above.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.