Interact with notification action from ADB shell - Android Q&A, Help & Troubleshooting

I have an Android(7) phone and a Linux pc. By enabling USB debugging and using the terminal of my pc, I am able to read the notifications of my phone using the command:
Code:
adb shell dumpsys notification --noredact
Now, there are some notifications in android in which we can interact with the app directly from the notification. For example, in a Whatsapp notification, there are usually two buttons: Reply & Mark as read. In YouTube, there are options like Play, Turn off, Watch later. In the output of the above command, these options are visible in the following form:
actions={
[0] "Reply" -> PendingIntent{6becf48: PendingIntentRecord{87b8050 com.whatsapp startService (whitelist: +30s0ms)}}
[1] "Mark as read" -> PendingIntent{c1661e1: PendingIntentRecord{b8e3249 com.whatsapp startService (whitelist: +30s0ms)}}
}
Click to expand...
Click to collapse
I have two questions:
Can we interact with these options from adb shell? For example, is there any command like
Code:
adb shell <SOME COMMAND> 'Message to be sent in whatsapp with reply option'
which will send the text as a reply in whatsapp without opening the app?
Is it possible to swipe the notifications using any adb command? (Not the
Code:
adb shell input swipe x0 y0 x1 y1
, it requires to unlock the phone each time)
Some comments:
Here is what I found that may be relevant to this question.
I think that I have to somehow launch the specific intent linked to the mentioned PendingIntent id (in this case 6becf48 or 87b8050)
Using the command
Code:
adb shell dumpsys activity intents > output.txt
and then searching for 87b8050 in output.txt, I found the name of the intent. It was as follows:
* PendingIntentRecord{87b8050 com.whatsapp startService (whitelist: +30s0ms)}
uid=10104 packageName=com.whatsapp type=startService flags=0x0
requestIntent=act=com.whatsapp.intent.action.DIRECT_REPLY_FROM_MESSAGE dat=content://com.whatsapp.provider.contact/contacts/2256 cmp=com.whatsapp/.notification.DirectReplyService (has extras)
whitelistDuration=+30s0ms
Click to expand...
Click to collapse
Now I think that it may be possible to launch the intent
Code:
com.whatsapp.intent.action.DIRECT_REPLY_FROM_MESSAGE
using adb shell am command, and passing the intent id and message as some parameters.
(Just like we can launch Whatsapp from adb with am command, it should be possible to launch the pendingIntent also.)

I'm searching for something similar.. Did you figure this out or still exploring?

bump !

Related

[Q] send sms via adb shell

hi ,
is it possible to send sms via adb shell from pc to android phone (via usb) ??
thegodfather13 said:
hi ,
is it possible to send sms via adb shell from pc to android phone (via usb) ??
Click to expand...
Click to collapse
Not sure why you would like to do this aside for just bragging rights or whatever BUT I think this is what you might be looking for.....
http://code.google.com/p/desktopsms/
mazdarider23 said:
Not sure why you would like to do this aside for just bragging rights or whatever BUT I think this is what you might be looking for.....
http://code.google.com/p/desktopsms/
Click to expand...
Click to collapse
Bumping this for great justice.
Have a remote server out in the boonies that I have to monitor... I can pay 10k for a cellular monitoring package or I can stick an android on it (already tested for signal and amazingly enough has it) and have it spit out console commands to ADB with it's status.
Anyone have any ideas?
---------- Post added at 10:47 PM ---------- Previous post was at 10:20 PM ----------
combustiblemonkey said:
Bumping this for great justice.
Have a remote server out in the boonies that I have to monitor... I can pay 10k for a cellular monitoring package or I can stick an android on it (already tested for signal and amazingly enough has it) and have it spit out console commands to ADB with it's status.
Anyone have any ideas?
Click to expand...
Click to collapse
Fixed my own question with a shell script (win32/64):
Code:
@echo off
adb shell am start -a android.intent.action.SENDTO -d sms:%1 --es sms_body %2 --ez exit_on_sent true
ping -n 2 localhost>nul
adb shell input keyevent 22
ping -n 2 localhost>nul
adb shell input keyevent 66
this is adapted from the linux shell version listed here:
http://webcache.googleusercontent.c...s-using-android-adb+&cd=6&hl=en&ct=clnk&gl=us
Use the country code & use quotes around your message if you have more than one word. For example:
smsScript.cmd 15551234 FUBAR!
smsScript.cmd 15551234 "zomg, the server is FUBAR!"
Hello,
I was trying your script on my phone and it gives me an error:
Code:
Error: Activity not started, unable to resolve Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=android.intent.action.SENDTO }
I'm I doing something wrong?
Thank you
Some time ago I sucessful use Linux smstools to send SMS from PC using Android phone connected via USB.

[Q] Possible to execute ADB commands from a C# Form?

Basically I have been working on a Boot animation changer for the Nexus 7 and the program so far is coded in a C# form for windows.
I have coded everything fine up till now. And I'm a little stuck.
I need to run a ADB command to push a file from my Program files x86 to the nexus 7 and write over the original Boot file.
But is there a simple and easy solution for writing this code? Or do I need to make a console application which does this process when started?
Thanks.
( I can push files manually via ADB, but the point is to make the tool " one click " If you get my drift. )
QuantumCipher said:
Basically I have been working on a Boot animation changer for the Nexus 7 and the program so far is coded in a C# form for windows.
I have coded everything fine up till now. And I'm a little stuck.
I need to run a ADB command to push a file from my Program files x86 to the nexus 7 and write over the original Boot file.
But is there a simple and easy solution for writing this code? Or do I need to make a console application which does this process when started?
Thanks.
( I can push files manually via ADB, but the point is to make the tool " one click " If you get my drift. )
Click to expand...
Click to collapse
Simply execute adb via shell command?
cakebomb said:
Simply execute adb via shell command?
Click to expand...
Click to collapse
Oh so I can actually run the command from the C# application instead of the console? Just write the argument?
QuantumCipher said:
Oh so I can actually run the command from the C# application instead of the console? Just write the argument?
Click to expand...
Click to collapse
I don't know, how to do it in C#, I just know VB.
But you should be able to run adb (shell) with process.start or something and then just type the commands behind adb (shell), like if you want to run 'cmd.exe shutdown -s'.
And if not let your program create and run a batch file, which starts adb and copys the files to the phone, this is definitely possible.
Sent from my GT-I9100 using xda app-developers app
QuantumCipher said:
Oh so I can actually run the command from the C# application instead of the console? Just write the argument?
Click to expand...
Click to collapse
not 100% sure but should be something like
this is just an example and may be wrong, better check out exact arguments or google
using System;
using System.Diagnostics;
namespace adb.test
{
class ProcessStart
{
static void Main(string[] args)
{
Process adb = new Process();
adb.StartInfo.FileName = "adb.exe";
adb.StartInfo.Arguments = "shell";
adb.Start();
}
}
}
hopefully this will help you.
ADB VB Express 2008 - WM-Explorer
Hi,
this function is maked by my for WM-Explorer (WM8850 tablets - nanospic.ro ) in VB Express 2008
Dim CurrentPath As String = Environment.CurrentDirectory & "\"
Public Function ADB_Send_Cmd(ByVal cmd As String, ByVal timeout As Integer) As String
Dim dos_out As String = "dos_out.pms"
Dim bat_file As String = "getcmd.bat"
Dim sir As String
sir = "adb.exe " & cmd & " > " & dos_out
System.IO.File.WriteAllText(CurrentPath & bat_file, sir)
Shell(CurrentPath & bat_file, AppWinStyle.Hide, True, timeout)
Application.DoEvents()
Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("adb")
For Each p As Process In pProcess
p.Kill()
p.WaitForExit()
Next
Application.DoEvents()
Dim sr As StreamReader = File.OpenText(CurrentPath & dos_out)
Dim out As String = sr.ReadToEnd
sr.Close()
System.IO.File.Delete(CurrentPath & bat_file)
System.IO.File.Delete(CurrentPath & dos_out)
ADB_Send_Cmd = out
End Function
and how to use this function :
cmd = "devices"
rezultat = ADB_Send_Cmd(cmd, 20000)
'rezultat' may be :
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
xxxxxxxxx
cakebomb said:
I don't know, how to do it in C#, I just know VB.
But you should be able to run adb (shell) with process.start or something and then just type the commands behind adb (shell), like if you want to run 'cmd.exe shutdown -s'.
And if not let your program create and run a batch file, which starts adb and copys the files to the phone, this is definitely possible.
Sent from my GT-I9100 using xda app-developers app
Click to expand...
Click to collapse
Xadder said:
not 100% sure but should be something like
this is just an example and may be wrong, better check out exact arguments or google
using System;
using System.Diagnostics;
namespace adb.test
{
class ProcessStart
{
static void Main(string[] args)
{
Process adb = new Process();
adb.StartInfo.FileName = "adb.exe";
adb.StartInfo.Arguments = "shell";
adb.Start();
}
}
}
hopefully this will help you.
Click to expand...
Click to collapse
diabetu said:
Hi,
this function is maked by my for WM-Explorer (WM8850 tablets - nanospic.ro ) in VB Express 2008
Dim CurrentPath As String = Environment.CurrentDirectory & "\"
Public Function ADB_Send_Cmd(ByVal cmd As String, ByVal timeout As Integer) As String
Dim dos_out As String = "dos_out.pms"
Dim bat_file As String = "getcmd.bat"
Dim sir As String
sir = "adb.exe " & cmd & " > " & dos_out
System.IO.File.WriteAllText(CurrentPath & bat_file, sir)
Shell(CurrentPath & bat_file, AppWinStyle.Hide, True, timeout)
Application.DoEvents()
Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("adb")
For Each p As Process In pProcess
p.Kill()
p.WaitForExit()
Next
Application.DoEvents()
Dim sr As StreamReader = File.OpenText(CurrentPath & dos_out)
Dim out As String = sr.ReadToEnd
sr.Close()
System.IO.File.Delete(CurrentPath & bat_file)
System.IO.File.Delete(CurrentPath & dos_out)
ADB_Send_Cmd = out
End Function
and how to use this function :
cmd = "devices"
rezultat = ADB_Send_Cmd(cmd, 20000)
'rezultat' may be :
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
xxxxxxxxx
Click to expand...
Click to collapse
Thanks for the effort guys I found a way round it all and learnt a few new things about the android system ways and file permissions Ill be posting the app on here today or tomorrow may add a few more features to make it more worth while for users.
(Y)
QuantumCipher said:
Thanks for the effort guys I found a way round it all and learnt a few new things about the android system ways and file permissions Ill be posting the app on here today or tomorrow may add a few more features to make it more worth while for users.
(Y)
Click to expand...
Click to collapse
I am attempting a similar feat and I was wondering what your work around is?
My batch file terminates issues cmd commands at the shell prompt.
I am merely using a "Unlock" and "Lock" Form button to issue several commands to ADB Shell to Change the HTC One Max Flag for Locked Bootloader status. I would like to hard code the shell commands to execute with form button press but I have yet to find a way. Below are 2 sequenced events i need to occur on button press. I am using Visual Studio 2013
Mark Boot loader as Locked Code is:
Code:
adb shell
su
(if needed to get a # prompt)
echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796
exit
exit
adb reboot bootloader
(This is for the user to verify the Bootloader flag has changed)
Mark Boot loader as Unlocked Code is:
Code:
adb shell
su
(if needed to get a # prompt)
echo -ne "HTCU" | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796
exit
exit
adb reboot bootloader
Thanks for your help
DeadPhoenix said:
I am attempting a similar feat and I was wondering what your work around is?
My batch file terminates issues cmd commands at the shell prompt.
I am merely using a "Unlock" and "Lock" Form button to issue several commands to ADB Shell to Change the HTC One Max Flag for Locked Bootloader status. I would like to hard code the shell commands to execute with form button press but I have yet to find a way. Below are 2 sequenced events i need to occur on button press. I am using Visual Studio 2013
Mark Boot loader as Locked Code is:
Code:
adb shell
su
(if needed to get a # prompt)
echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796
exit
exit
adb reboot bootloader
(This is for the user to verify the Bootloader flag has changed)
Mark Boot loader as Unlocked Code is:
Code:
adb shell
su
(if needed to get a # prompt)
echo -ne "HTCU" | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796
exit
exit
adb reboot bootloader
Thanks for your help
Click to expand...
Click to collapse
does this help?
http://forum.xda-developers.com/showthread.php?t=2042227
QuantumCipher said:
does this help?
http://forum.xda-developers.com/showthread.php?t=2042227
Click to expand...
Click to collapse
I was looking at more of something like this.
http://www.regawmod.com/software/wi...html/986559a3-c009-64d7-e1b0-c3cad2bf4fd4.htm
The reason your linked thread won't work is because once you enter the ADB Shell environment your are no longer issuing commands via the cmd.exe process. There for any command sent from that process are not interpreted by the console as valid as you are in ADB Shell. At least that is my understanding. The Namespace in my link seems to have what I need but I am having a hard time breaking down what I need as I am so new to C# programming.
DeadPhoenix said:
I was looking at more of something like this.
http://www.regawmod.com/software/wi...html/986559a3-c009-64d7-e1b0-c3cad2bf4fd4.htm
Click to expand...
Click to collapse
OKay ive just refrenced that in my new tool ..Ill look in a few hours buddy going ski center now
DeadPhoenix said:
I was looking at more of something like this.
http://www.regawmod.com/software/wi...html/986559a3-c009-64d7-e1b0-c3cad2bf4fd4.htm
The reason your linked thread won't work is because once you enter the ADB Shell environment your are no longer issuing commands via the cmd.exe process. There for any command sent from that process are not interpreted by the console as valid as you are in ADB Shell. At least that is my understanding. The Namespace in my link seems to have what I need but I am having a hard time breaking down what I need as I am so new to C# programming.
Click to expand...
Click to collapse
Right I had a quick look and I think I know what you mean.. Theres a few ways I can think of ..
1. Is Make a thread process and covert your commands like adb reboot to Cmd process like my tutorial.
And for the shell as you said there is AndroidLIB.DLL You need to set the adb shell up from that so you can execute that longer command.
http://www.regawmod.com/software/wi...html/986559a3-c009-64d7-e1b0-c3cad2bf4fd4.htm
Something like this :
But obviously change this code to use adbshellcommand
Code:
AdbCommand adbCmd = Adb.FormAdbCommand(device, true, "input", "keyevent", (int)KeyEventCode.HOME);
If you get stuck Ill right the code out later as I was thinking about adding shell to my console app.
QuantumCipher said:
Right I had a quick look and I think I know what you mean.. Theres a few ways I can think of ..
1. Is Make a thread process and covert your commands like adb reboot to Cmd process like my tutorial.
And for the shell as you said there is AndroidLIB.DLL You need to set the adb shell up from that so you can execute that longer command.
http://www.regawmod.com/software/wi...html/986559a3-c009-64d7-e1b0-c3cad2bf4fd4.htm
Something like this :
But obviously change this code to use adbshellcommand
Code:
AdbCommand adbCmd = Adb.FormAdbCommand(device, true, "input", "keyevent", (int)KeyEventCode.HOME);
If you get stuck Ill right the code out later as I was thinking about adding shell to my console app.
Click to expand...
Click to collapse
Here is my code for the button I am using
Code:
private void lockboot_Click(object sender, EventArgs e)
{
string serial;
android = AndroidController.Instance;
android.UpdateDeviceList();
serial = android.ConnectedDevices[0];
device = android.GetConnectedDevice(serial);
AdbCommand adbCmd = Adb.FormAdbShellCommand(device, true, "echo", "-ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796");
Adb.ExecuteAdbCommand(adbCmd);
lbllocked.Visible = true;
lblunlock.Visible = false;
textboxcolor.BackColor = Color.Red;
}
It Compiles with no issues however the command is not executing properly. The Bootloader show be flagged unlocked when I boot in to Bootloader. It is however remaining unchanged.
DeadPhoenix said:
Here is my code for the button I am using
Code:
private void lockboot_Click(object sender, EventArgs e)
{
string serial;
android = AndroidController.Instance;
android.UpdateDeviceList();
serial = android.ConnectedDevices[0];
device = android.GetConnectedDevice(serial);
AdbCommand adbCmd = Adb.FormAdbShellCommand(device, true, "echo", "-ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796");
Adb.ExecuteAdbCommand(adbCmd);
lbllocked.Visible = true;
lblunlock.Visible = false;
textboxcolor.BackColor = Color.Red;
}
It Compiles with no issues however the command is not executing properly. The Bootloader show be flagged unlocked when I boot in to Bootloader. It is however remaining unchanged.
Click to expand...
Click to collapse
Any Suggestions?

[Q] Tutorial Send SMS from Android commandline (shell)

Hello guys!
Please, could you point me how to achieve the following functionality?
I would like to be able to send text messages (SMS) directly from android shell/commandline. The idea is that in Android from a terminal I will invoke e.g.:
Code:
sendsms +639xxxxxxxx "The body of the message"
and the sendsms app will send the message "The body of the message" to the specified number +639xxxxxxxx. I won't be using it directly, but I'd like to call it from scripts.
At stackoverflow under 4043490 thread two methods are mentioned:
a) use adb
Code:
adb shell am start -a android.intent.action.SENDTO -d sms:CCXXXXXXXXXX --es sms_body "SMS BODY GOES HERE" --ez exit_on_sent true
adb shell input keyevent 22
adb shell input keyevent 66
Where CCXXXXXXXXXX is country-code followed by phone number. This may not work correctly on non-standard android installations, you will need to find the correct keyevent values to pass.
b) use a service call
Code:
service call isms 5 s16 "17079876543" i32 0 i32 0 s16 "SMS TEXT HERE"
But none of them works for my rooted Alcatel OT 8008D with Android 4.2.1. If I run the adb command (a) from terminal with root rights, it complains "error: device not found".
The service call (b) ends with a message "Result: Parcel(00000000 '....')" but nothing happens, no SMS being sent. Similar behaviour has been reported at stackoverflow under thread 20680167.
Please, do you have any tips?
Thanks in advance!

[Guide][17-5-2017]Hide Navigation Bar, Status Bar or both(Immersive Mode)-No App

Hi guys, i was searching for a way to hide the navigation bar without any app that will require you buying it or it consuming battery and after finding a couple of threads on the topic i thought of sharing my findings and also as a reference to go back to in case i forget how to. This is also good for eliminating or reducing screen burn caused by the bars on Amoled screens.
Credits go to @jplempka @cabegol @SmartPhoneLover
Type the following commands in adb/fastboot environment (adb shell) on your PC after connecting the phone in file transfer mode and usb debugging is on:
· Hide Status Bar only type:
adb shell settings put global policy_control immersive.status=*
· Hide Navigation Bar only type:
adb shell settings put global policy_control immersive.navigation=*
· Hide Both Bars type:
adb shell settings put global policy_control immersive.full=*
· Back to normal/default state:
adb shell settings put global policy_control null*
--------------------------------------------
Updates: (15/5/2017):
+ Immersive in all apps except certain apps
adb shell settings put global policy_control immersive.full=apps,-"app location",-"another app location"
Notes:
1. You can get the app location by going to "system/data/data" using any file browser with root, the location should start with the app folder name "com.appname"
Ex: com.whatsapp
2. Remove quotation marks(" ")when adding the location of the app also add an apostrophe(,) if you are adding more than one app and when typing the code there is no space after the apostrophe.
Ex: https://forum.xda-developers.com/showpost.php?p=71987561&postcount=5
Credits: @wilhexm, @rizalkhoiruddin
+ Immersive in all apps but with certain apps having Status bar not hidden
adb shell settings put global policy_control immersive.navigation=apps,:immersive.status=apps,-"app location",-"second app location"
Ex: adb shell settings put global policy_control immersive.navigation=apps,:immersive.status=apps,-com.whatsapp
Notes:
1. You can get the app location by going to "system/data/data" using any file browser with root, the location should start with the app folder name "com.appname" ex: com.whatsapp
2. Remove quotation marks(" ")when adding the location of the app also add an apostrophe(,) if you are adding more than one app and when typing the code there is no space after the apostrophe
Credits: @beatschubser https://forum.xda-developers.com/showpost.php?p=72300666&postcount=54
+ Immersive in all apps but with certain apps having Navigation bar not hidden
adb shell settings put global policy_control immersive.status=apps,:immersive.navigation=apps,-"app location",-"second app location"
Ex: adb shell settings put global policy_control immersive.status=apps,:immersive.navigation=apps,-com.whatsapp
Notes:
1. You can get the app location by going to "system/data/data" using any file browser with root, the location should start with the app folder name "com.appname" ex: com.whatsapp
2. Remove quotation marks(" ")when adding the location of the app also add an apostrophe(,) if you are adding more than one app and when typing the code there is no space after the apostrophe.
By the way this method works on all rom versions i have tested it on Nougat and all commands work. Good
luck:highfive:
-------------------------------------------------------------------
Updates: (17/5/2017):
Apps Identified to not play well with navigation and status bar hidden and how to exclude them(To be updated accordingly):
Apps List:
*Whatsapp(When typing the status bar needs to be there to see what others wrote at the same time)
*Wechat(When typing the status bar needs to be there to see what others wrote at the same time)
*Youtube(When typing the status bar and navigation bar need to be there)
*Hangouts(When typing the status bar needs to be there to see what others wrote at the same time)
---------------
Code: adb shell settings put global policy_control immersive.navigation=apps,-com.google.android.youtube,:immersive.status=apps,-com.whatsapp,-com.tencent.mm,-com.google.android.youtube,-com.google.android.talk
---------------
P.S: If you want to use these commands directly on your phone without a PC you need first to be rooted, next use any shell terminal to insert the code but remove the "adb shell" part.
So in the terminal app for example if you wanted to hide both bars you type the following:
>su
>settings put global policy_control immersive.full=*
Thank you for this info, also I just tested it using Android terminal and it works well. I don't always have PC nearby to test things, very nice.
Fe Mike said:
Thank you for this info, also I just tested it using Android terminal and it works well. I don't always have PC nearby to test things, very nice.
Click to expand...
Click to collapse
Cool that's another way. I don't know why we need to do it manually instead of google offering it as an option.
I would love it on as a Google option.
Sent from my Pixel XL using XDA-Developers mobile app
Rashad83 said:
Hi guys, i was searching for a way to hide the navigation bar without any app that will require you buying it or it consuming battery and after finding a couple of threads on the topic i thought of sharing my findings and also as a reference to go back to in case i forget how to. This is also good for eliminating or reducing screen burn caused by the bars on Amoled screens.
Credits go to @jplempka @cabegol @SmartPhoneLover
Type the following commands in adb/fastboot environment (adb shell) on your PC after connecting the phone in file transfer mode and usb debugging is on:
· Hide Status Bar only type:
adb shell settings put global policy_control immersive.status=*
· Hide Navigation Bar only type:
adb shell settings put global policy_control immersive.navigation=*
· Hide Both Bars type:
adb shell settings put global policy_control immersive.full=*
· Back to normal/default type:
adb shell settings put global policy_control null*
By the way this method works on all rom versions i have tested it on Nougat and all commands work. Good
luck:highfive:
Click to expand...
Click to collapse
Thank you for the post, this is cool! Can I choose only certain apps to be immersive? or set full immersive except some apps?
---------- Post added at 03:43 AM ---------- Previous post was at 03:36 AM ----------
rizalkhoiruddin said:
Thank you for the post, this is cool! Can I choose only certain apps to be immersive? or set full immersive except some apps?
Click to expand...
Click to collapse
Just found the answer from https://forum.xda-developers.com/pixel-xl/themes/how-to-enable-true-immersive-modes-t3554299
wilhexm said:
Sure!
for example, if u want to enable some apps
Code:
settings put global policy_control immersive.full=com.chrome.beta,com.google.android.apps.magazines,com.medium.reader
or if u want immersive full except some apps
Code:
settings put global policy_control immersive.full=apps,-com.google.android.apps.nexuslauncher,-com.twitter.android,-com.google.android.apps.photos,-com.google.android.GoogleCamera,-com.google.android.keep,-com.android.settings
The difference is the "-" before [app full name]
Click to expand...
Click to collapse
In this case you can add app names or 'apps,-*app name* to enable or set full immersive except some apps
Hi could you explain in more detail how one does this? Thank you. I have no knowledge of adb within Android.
Permission denied
Hi
I'm trying this directly from the phone but I got the message "setting permission denied"
I'm in debug and dev mode
Any idez please
fredrik0612 said:
Hi could you explain in more detail how one does this? Thank you. I have no knowledge of adb within Android.
Click to expand...
Click to collapse
Sorry, there are a lot of threads about Adb. If you are not familiar with rooting, flashing a rom. Then i suggest you don't do this. Please don't take offense but it's better to read on those topics before attempting this.
Cookiemonster51 said:
Hi
I'm trying this directly from the phone but I got the message "setting permission denied"
I'm in debug and dev mode
Any idez please
Click to expand...
Click to collapse
You need to be rooted to execute the command within the phone.
@ashad83
hello friend and thanks for you post.
Is possible desactivate(delete) navbar without immersive mode. For use pie etc.....my nexus 6p no root. thanks in advance.
I can´t use the code qemu.hw.mainkeys = 1....or is possible make with adb and how?
Thanks in advance....
$ su
put global policy_control immersive.status=* <
sush: adb: not found
127|angler:/data/data/com.termux/files/home # exit
$ adb shell settings put global policy_control immersive.status=*
No command 'adb' found, did you mean:
Command 'gdb' from package 'gdb'
$
This works perfect for my stock nonrooted Samsung Galaxy S8+.
Thank you
/CK
This command work on non-rooted devices?
[email protected]:/ # setprop qemu.hw.mainkeys 0 //to turn ON soft keys
[email protected]:/ # setprop qemu.hw.mainkeys 1 //to turn OFF soft keys
isaakmg said:
@ashad83
hello friend and thanks for you post.
Is possible desactivate(delete) navbar without immersive mode. For use pie etc.....my nexus 6p no root. thanks in advance.
I can´t use the code qemu.hw.mainkeys = 1....or is possible make with adb and how?
Thanks in advance....
Click to expand...
Click to collapse
Hi isaak, to remove the navigation bar without root you need to take the build.prop file from the System folder using adb commands "Pull" and "Push" (If you search online you will find alot of threads on how to use the command) edit the file by adding the code: " qemu.hw....." to it on your PC and then returning the file to it's place on the phone. I am sorry i can't give you a step by step on how to do this because i am travelling, if i have time i might right a tutorial on how to do this. Good Luck
DEVILOPS 007 said:
$ su
put global policy_control immersive.status=* <
sush: adb: not found
127|angler:/data/data/com.termux/files/home # exit
$ adb shell settings put global policy_control immersive.status=*
No command 'adb' found, did you mean:
Command 'gdb' from package 'gdb'
$
Click to expand...
Click to collapse
Hi, first you need to be rooted then in the terminal type this:
>Su
>settings put global .......... (Just type the command without "adb shell")
Café King said:
This works perfect for my stock nonrooted Samsung Galaxy S8+.
Thank you
/CK
Click to expand...
Click to collapse
Your welcome, thanks for the feedback i also wanted to know if this worked on Samsung S8+. I am thinking of getting the Note 8 when it comes out.
wixvdj said:
This command work on non-rooted devices?
[email protected]:/ # setprop qemu.hw.mainkeys 0 //to turn ON soft keys
[email protected]:/ # setprop qemu.hw.mainkeys 1 //to turn OFF soft keys
Click to expand...
Click to collapse
Not sure mate, you let us know if it does.
Rashad83 said:
Your welcome, thanks for the feedback i also wanted to know if this worked on Samsung S8+. I am thinking of getting the Note 8 when it comes out.
Click to expand...
Click to collapse
Thank you Works absolutely perfectly. I'm thinking about working on a project in the future if people are interested where I make a flashable zip for different roms that will add immersive mode as a feature.
What's the benefit of on nav bar? If no nav bar how do you guys navigate around the OS?
hinds90 said:
What's the benefit of on nav bar? If no nav bar how do you guys navigate around the OS?
Click to expand...
Click to collapse
Good question, we use apps like LMT launcher or GMD gesture control instead of the navigation bar which wastes a good portion of the screen. I used both and i love both of them but i think gesture navigation is the future. Now since Nougat update i stopped using both of these apps because it's a headache to simply root and change the build.prop to simply use both apps, instead i opted to hide the status and navigation bar. You should try both apps you will enjoy your phones' screen more. :good:

[Guide] Linux on Wear OS!

THIS IS ONLY TESTED IN WEAR OS 3 ON A GALAXY WATCH 4
THOUGH THIS SHOULD WORK ON ALL WATCHES AND OLDER VERSIONS OF WEAR OS
Requirements:
ADB installed on your computer
Have your wear OS device connected to the same network as you computer
A bit of patience, this works in a very weird way!
Downloading apks and installing them
Firstly enable adb and adb debugging over WiFi on your wear OS device
Then download the latest apks:
Termux
MultiVnc If you want a graphical environment on Linux
When you have the apks run these commands:
Code:
adb connect IP_OF_YOUR_WEAR_OS_DEVICE
You might be able to see your ip under the button for enabling adb debugging over wifi
Then run these commands in the downloads folder
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_TERMUX_APK_FILE
and
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_MULTI-VNC_APK_FILE
BE AWARE THAT YOU MIGHT HAVE TO RESTART THE ADB CONNECTION, SOMETIMES IT MAY FREEZE.
to do that run
Code:
adb disconnect
then
Code:
adb connect IP_OF_YOUR_WEAR_OS_DEVICE
Installing Linux in Termux
Stay awake sleepyhead!
To make everything easier enable the option in Termux to keep your watch awake, this will save you from so much trouble.
First open up Termux, then long press the black background.
Then press the three dots and choose the option "More...".
Scroll down until you see the option "Keep screen on", turn on that.
Keyboard?
I've discovered that there's a problem with Wear OS keyboards, for some reason they might not interact properly with certain android applications.
So open up Termux in your Wear OS device and see if you can write anything in Termux.
If that works, see if there's any enter button on your keyboard and see if it works.
If Termux gave any response to what you entered then skip this part and head straight for "The Linux multiverse!"
If the enter button doesn't work then you gotta install an android keyboard.
The best keyboard I've found that also works on round Wear OS devices is "Unexpected keyboard"
Download the keyboard and run:
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_KEYBOARD_APK_FILE
When the keyboard is installed change you default keyboard into the previously installed keyboard.
The Linux multiverse!
On your ANDROID PHONE install Andronix.
In there you will have a lot of options for installing Linux on Termux. You can choose whatever you want!
When you've chosen what you want, then Andronix will copy a command to your phones clipboard.
Oh no!
This is where you might only have a few options!
The problems is that you have to get the command from your phone to your Wear OS device, though your Wear OS device might not even let you copy and paste!
Though there is a way to bypass this, ANDROID APPS! The easiest way is to install messenger lite(not messenger for Wear OS).
First download Messenger lite. (source for the messenger download link)
Then In the downloads folder run:
Code:
adb -s " IP_OF_YOUR_WEAR_OS_DEVICE" install NAME_OF_THE_DOWNLOADED_MESSENGER_APK_FILE
Log into messenger on your phone and your Wear OS device.
On your phone send the command Andronix gave you, to yourself in messenger.
Then open up messenger on your Wear OS device and long press the command and select copy!
Now the biggest hassle is gone!
The long, really long awakening
Now that you've copied the command, enter Termux. Then long press the black background and press paste.
NOW DON'T TOUCH ANYTHING, so that you don't accidentally change anything in the command.
From your computer run:
Code:
adb shell input keyevent 66
Try to remember this command, or put it somewhere easy to copy. You'll need it pretty often. (this command serves as an enter button)
The installation of Linux will now begin, there will be some Y/N questions, just choose the default options by running:
Code:
adb shell input keyevent 66
After a while you might get questions about region, keyboard and such.
use
Code:
adb shell input keyevent 66
to scroll down when it says [MORE]
then use
Code:
adb shell input text "NUMBER/WORD"
(don't remove the parentheses)
then again use
Code:
adb shell input keyevent 66
as an enter button
It might also ask you for a vnc password, choose a small and easy password.
FINALLY LINUX!
You should now have Linux installed on your Wear Os device. Go do whatever you want with it.
Just remember that your Wear OS device uses arm, so if you wanna use x86 applications, then you gotta use Box64 if you have a 64-bit processor and Box86 if you have a 32-bit processor
Start Linux(Linux might automatically start after installation)
First run:
Code:
adb shell input text "ls"
Code:
adb shell input keyevent 66
This will run the ls command.
Look for a file closely name to start-SOME_LINUX_DISTRO.sh or start-andronix.sh
then run:
Code:
adb shell input text "./start-SOME_LINUX_DISTRO"
then
Code:
adb shell input keyevent 66
BOOM Linux is now running :3
What about GUI?
If you installed a Linux version with a graphical interface then you either gotta use a VNC to display anything on your watch
run
Code:
adb shell input text "vncserver-start"
then
Code:
adb shell input keyevent 66
then
Code:
adb shell input keyevent 66
The terminal will say " New 'remote-desktop' at :NUMBER on machine localhost "
remember that number
now exit Termux and start Mutli-Vnc
Scroll down to "New Connection"
in Address enter localhost
in port enter 590 and then the number. (If the number as is higher than 9, enter 59 and then the number)
Scroll down password and enter in the vnc password you chose earlier.
Then the scroll all the way down and press the big green "Connect" button!
You should now some something, maybe not a lot, but something"
You can manually set the resolution if you want, so that you're able to utilize the screen better, go here for a guide on that.
External GUI
If you actually wanna use the Linux installation, then you'll have to use an external device to view the desktop.
You can follow this guide here, as it's better at explaining then me.
You can also use this guide if you wanna use XSDL.
A tip for entering &, use the keyboard on the watch! Also the read the explanation of commands before you continue, you'll need it!
Command explanation!!
adb shell input text " " will enter any text into the connected adb device, %s is used for spaces
adb shell input keyevents will do any key event, like pressing enter, 66 is for enter
If something doesn't work, let me know. I might've missed something!

Categories

Resources