Hey guys,
I always found it annoying that I couldn't see the battery percentage. This can be enabled by executing the following command. I have tested it and it does work.
Step 1:
Code:
Open cmd and type the path to adb.
Step 2:
Code:
adb shell content insert --uri content://settings/system --bind name:s:status_bar_show_battery_percent --bind value:i:1
Step 3:
Code:
adb reboot
You're set.
PS: It can be enabled using System UI Tuner as well.
Note: If you change the screen resolution, you may have to run the code again.
Does this do it any different then the System UI Tuner? That is what I currently use to see battery percentage.
Sent from my XT1575 using Tapatalk
ahent said:
Does this do it any different then the System UI Tuner? That is what I currently use to see battery percentage.
Sent from my XT1575 using Tapatalk
Click to expand...
Click to collapse
It's more or less the same.
Related
After installing the JH2 ROM and using unleash the beast, I'm getting weird output from the ls command in the adb shell. Apparently, I can't post links or pictures, yet. So, here's a sort of link:
picasaweb. google. com/ lh/ photo/ VQKACQqA9i7u8ZWG3OmRGQ?feat=directlink
I'm getting listings of entries like [1;34mcache [0m
and [0;0mdefault.prop [0m
before each of the square brackets, there is a left-pointing arrow.
What's causing this? It seems to be an expanded version of the directory listing. How do I turn it off?
belyle said:
After installing the JH2 ROM and using unleash the beast, I'm getting weird output from the ls command in the adb shell. Apparently, I can't post links or pictures, yet. So, here's a sort of link:
picasaweb. google. com/ lh/ photo/ VQKACQqA9i7u8ZWG3OmRGQ?feat=directlink
I'm getting listings of entries like [1;34mcache [0m
and [0;0mdefault.prop [0m
before each of the square brackets, there is a left-pointing arrow.
What's causing this? It seems to be an expanded version of the directory listing. How do I turn it off?
Click to expand...
Click to collapse
thats normal...
designgears said:
thats normal...
Click to expand...
Click to collapse
When I was using the original kernel and the one-click root, my adb shell ls was only file names, not the extra stuff. When I use the ls command in terminal emulator on the phone, it's just the file names.
Also, when I grep the output of ls, the output of grep doesn't have the info in the square brackets, just the file name(s) that meet the criterion.
Thats the ls command sending color codes. It looks nice on a terminal that supports it but weird on windows.
To temporary solve it, after adb shell do this:
alias ls='ls --color=never'
It will fix the problem until you exit adb.
Sent from my SAMSUNG-SGH-I897 using XDA App
LGSilva said:
Thats the ls command sending color codes. It looks nice on a terminal that supports it but weird on windows.
To temporary solve it, after adb shell do this:
alias ls='ls --color=never'
It will fix the problem until you exit adb.
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
This was it. Thank you very much. I'm not sure why I didn't see the extra info on my other ROM, but there it is.
I don't suppose there's a different terminal/command prompt for windows that would show the colors?
ls -l
will just give you a standard list of files.
ok I have the supernoob question of the day. can you type adb commands via the terminal emulator on the phone, or do you have to be connected to a computer via usb? I downloaded adb wireless, but im thinking that i have to have the sdk set up on my comp first? Im just a little confused as you can tell
The terminal is the equivalent of doing 'adb shell'. You will have to download the android SDK to get the actual adb tool if you want to do push/pull etc. with it.
belyle said:
This was it. Thank you very much. I'm not sure why I didn't see the extra info on my other ROM, but there it is.
I don't suppose there's a different terminal/command prompt for windows that would show the colors?
Click to expand...
Click to collapse
http://code.google.com/p/puttycyg/ this does.
very old post that got bumped to the top. If you didn't try puttycyg and not interested in colors you can try this: http://forum.xda-developers.com/showpost.php?p=8036010&postcount=7
It works for me.
Hello,
I passed since this morning to Android 5.0 on my nexus 5.
There is a way to always show battery percentage?
I used Xposed for that on my Android 4 but it's not compatible anymore as I read .
Thanks.
https://play.google.com/store/apps/details?id=de.kroegerama.android4batpercent
Thanks but it show the percentage only if the battery is enough empty .
thierry_b said:
Thanks but it show the percentage only if the battery is enough empty .
Click to expand...
Click to collapse
That's only true for KK, on Lollipop you will see it always.
Yes, thanks
No in fact, it doesn't work but I have 71% for example...
It works. See screenshot.
Yes, in fact, it's when it charges that we can't see .
Can't always have it all
on adb run this command
adb shell content insert --uri content://settings/system --bind name:s:status_bar_show_battery_percent --bind value:i:1
Reboot and its done
ok, I will try that.. It's to always see percentage ?
And to know, what is the reverse command?
Thanks.
royaltartufo said:
on adb run this command
adb shell content insert --uri content://settings/system --bind name:s:status_bar_show_battery_percent --bind value:i:1
Reboot and its done
Click to expand...
Click to collapse
This worked perfectly. White battery indicator with black font.
royaltartufo said:
on adb run this command
adb shell content insert --uri content://settings/system --bind name:s:status_bar_show_battery_percent --bind value:i:1
Reboot and its done
Click to expand...
Click to collapse
:good::good::good:
Thanks..
It works...
thierry_b said:
ok, I will try that.. It's to always see percentage ?
And to know, what is the reverse command?
Thanks.
Click to expand...
Click to collapse
Cant say for sure but I'd imagine swap the 1 for a 0
Thanks, so with this command, it works even if the phone is charging?
thierry_b said:
Thanks, so with this command, it works even if the phone is charging?
Click to expand...
Click to collapse
No..the command is the same command that the app activates
So, I'm an idiot and was working too close to my phone with some heavy tools. Long story short, I ended up dropping my Dewalt drill directly on the screen. It's completely ruined and no longer has any picture on the screen. The phone itself still turns on. I'm able to unlock with fingerprint, etc. The problem is...since I can't actually see anything on the screen, I'm not sure exactly where to press and swipe to access private mode. I had some files for work stored in private mode that I need to retrieve from the phone (customer contracts)...but since I can't see anything, I don't know exactly how to get them back. Any ideas? Thanks in advance!
Is adb debugging enabled on your device?
Fusseldieb said:
Is adb debugging enabled on your device?
Click to expand...
Click to collapse
I believe so, yes. I think I enabled it awhile ago.
mosesport said:
I believe so, yes. I think I enabled it awhile ago.
Click to expand...
Click to collapse
Perfect. Now you can make a .bat script that pushes a screenshot fron your device every second.
You do it in following way:
1. Create a normal text file and write in there:
Code:
:1
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
goto 1
2. Rename it to Screenshot.bat
3. Run it and you will see a command prompt in loop getting screenshots from your device. Then open the newly created "screen.png". If you're using Windows 7, the image will update automatically every second and you will see a 'live feed' of your device's screen.
If your touchscreen is damged too, you will need inputting keyevents, like touch x y. If that's your case, just say me and I'll explain you.
Sent from my SM-G925F using XDA-Developers mobile app
Fusseldieb said:
Perfect. Now you can make a .bat script that pushes a screenshot fron your device every second.
You do it in following way:
1. Create a normal text file and write in there:
Code:
:1
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
goto 1
2. Rename it to Screenshot.bat
3. Run it and you will see a command prompt in loop getting screenshots from your device. Then open the newly created "screen.png". If you're using Windows 7, the image will update automatically every second and you will see a 'live feed' of your device's screen.
If your touchscreen is damged too, you will need inputting keyevents, like touch x y. If that's your case, just say me and I'll explain you.
Sent from my SM-G925F using XDA-Developers mobile app
Click to expand...
Click to collapse
When I try to run the script, the command prompt gives an error stating "adb is not a recognized as an internal or extermal command."
mosesport said:
When I try to run the script, the command prompt gives an error stating "adb is not a recognized as an internal or extermal command."
Click to expand...
Click to collapse
Install adb on your machine, reboot and try again.
Search here on xda for "15 seconds adb and fastboot installer".
(While installing, press Y for Yes when prompting to install it system wide)
Do not forget to reboot!
Sent from my SM-G925F using XDA-Developers mobile app
Wouldn't it be cool to be able to automate the swicthing data between SIM 1 and SIM 2 using Tasker given the location of the device? Let's figure out how to do it together. Do we need root? ADB command comes to mind...
@MishaalRahman any ideas?
What do you mean by "switching data?" Sorry, I usually don't use two SIMs so I'm not sure what you mean.
MishaalRahman said:
What do you mean by "switching data?" Sorry, I usually don't use two SIMs so I'm not sure what you mean.
Click to expand...
Click to collapse
The dual sim version mha-l29 has an option to set the default 4g slot from within the settings menu
I have found already a system variable that can be changed using secure settings plugin for tasker, and running the adb command adb shell settings list system I can see that the variable switch_dual_card_slots does change from 0 to 1 when doing it from the ui, but when done from a put command nothing happens. Any ideas?
dmorales023 said:
The dual sim version mha-l29 has an option to set the default 4g slot from within the settings menu
I have found already a system variable that can be changed using secure settings plugin for tasker, and running the adb command adb shell settings list system I can see that the variable switch_dual_card_slots does change from 0 to 1 when doing it from the ui, but when done from a put command nothing happens. Any ideas?
Click to expand...
Click to collapse
The screenshot shows you doing the command from the Secure Settings plug-in, not from shell. Have you tried it from shell?
MishaalRahman said:
The screenshot shows you doing the command from the Secure Settings plug-in, not from shell. Have you tried it from shell?
Click to expand...
Click to collapse
Yes, same results executing directly from shell. Nothing happens. Is there a trigger like command to update ui from settings or something like that? Sort of:
1. adb shell command x
2. Commit?
dmorales023 said:
Yes, same results executing directly from shell. Nothing happens. Is there a trigger like command to update ui from settings or something like that? Sort of:
1. adb shell command x
2. Commit?
Click to expand...
Click to collapse
@MishaalRahman The shell command I am using is "adb shell settings put system switch_dual_card_slots 0/1"
dmorales023 said:
@MishaalRahman The shell command I am using is "adb shell settings put system switch_dual_card_slots 0/1"
Click to expand...
Click to collapse
Yeah, that seems like it would do it.
dmorales023 said:
@MishaalRahman The shell command I am using is "adb shell settings put system switch_dual_card_slots 0/1"
Click to expand...
Click to collapse
Is it working? I am trying to do same thing on my phone. No luck till now
midhunmanohar said:
Is it working? I am trying to do same thing on my phone. No luck till now
Click to expand...
Click to collapse
No luck on my side either. Did you find a solution? This seems so trivial...
dmorales023 said:
Yes, same results executing directly from shell. Nothing happens. Is there a trigger like command to update ui from settings or something like that? Sort of:
1. adb shell command x
2. Commit?
Click to expand...
Click to collapse
I am using the shell command successfully on my Honor 6X.
First I set switch_dual_card_slots to 0 or 1 , and to commit I simply kill the phone process, which will automatically restart instantly.
It is not the most elegant solution, but works flawlessly for me.
The two commands I run (with root priveleges)
1: settings put system switch_dual_card_slots 1
2: pkill phone
dual SIM data switch
RealParity said:
The two commands I run (with root priveleges)
1: settings put system switch_dual_card_slots 1
2: pkill phone
Click to expand...
Click to collapse
i tried the above.
1 executes something, no msg.
2 gives an error message: pkill: TERM->24469: Operation not permitted
the data SIM does not change. but i guess it can't, as the 2nd command fails. what other things i might try?
and yes, i'm a noob on terminal commands - please walk me through how to automate this.
Bump after disabling one sim on location has I get no signal at work
zdoe said:
i tried the above.
1 executes something, no msg.
2 gives an error message: pkill: TERM->24469: Operation not permitted
the data SIM does not change. but i guess it can't, as the 2nd command fails. what other things i might try?
and yes, i'm a noob on terminal commands - please walk me through how to automate this.
Click to expand...
Click to collapse
Not sure if you got this figured out but you need to be rooted. Then in adb shell/terminal you must type "su" first then do the pkill
Anybody tried with a Xiaomi phone?
There's an app 4 this (dual sim switch widget) but it doesn't work on Xiaomi phones
Hi, I have a xiaomi mi 9t, I wish I could change the default sim for data, how much I receive or send a call.
What command can I give tasker for modifying the data sim?
Hello I've been trying to find a way to get rid of the Heads Up Notifications that are so intrusive and a lack of privacy while watching the screen with somebody else.
Does someone know how to disable them in Android Q stock rom (100% untouched OS)
Thanks!
You need root, but this should work on stock. If you're rooted and have a terminal emulator on the device just run the same command without the adb shell part.
Code:
adb shell su -c settings put global heads_up_notifications_enabled 0
Sent from my Google Pixel 3a XL using XDA Labs
Thank you for this, so would the command line be the same but minus the 0 and replace it with 1 to re enable this?
Skittles9823 said:
You need root, but this should work on stock. If you're rooted and have a terminal emulator on the device just run the same command without the adb shell part.
Code:
adb shell su -c settings put global heads_up_notifications_enabled 0
Sent from my Google Pixel 3a XL using XDA Labs
Click to expand...
Click to collapse
Archangel said:
Thank you for this, so would the command line be the same but minus the 0 and replace it with 1 to re enable this?
Click to expand...
Click to collapse
Yea that's right. Just set to 1 and it'll be enabled again.
Sent from my Google Pixel 3a XL using XDA Labs