How to access private mode without access to screen? Galaxy S5 - General Questions and Answers

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

Related

[GUIDE] How To Root The Sprint CDMA Hero (Windows)

I have compiled this guide from the other one posted on this forum, the discussion therein, and my own knowledge. If you have any suggestions on making it better or to correct any mistakes I may have made please let me know.
This guide is intended for Windows and includes detailed instructions. It will cover the steps necessary to root, flash the new recovery image, create a full backup. This will work with software versions 1.29.651.1 and 1.56.651.2 (aka Android 1.5). If you have updated to 2.1 please following this guide here. I am not responsible for any damage done to your phone using this guide. Root at your own risk.
I have put to together a video on YouTube for you to follow along as well. The version numbers of certain files are now outdated in the video so change file names as necessary.
If you own a non-Sprint Hero, you will need to do some extra steps. Follow the guide in the How to Root Non-Sprint CDMA Hero thread.
Step 1: Download the Android SDK from http://developer.android.com/sdk/index.html The Windows file is called android-sdk_r06-windows.zip. Extract the files to your C: drive so that you now have the folder C:\android-sdk-windows
Step 2: Download the asroot2 exploit file from http://forum.xda-developers.com/attachment.php?attachmentid=244212&d=1257621154 Extract asroot2.zip to C:\android-sdk-windows\tools folder.
Step 3: Download the Hero recovery image from http://forum.xda-developers.com/showpost.php?p=4898505&postcount=1g Place this file in C:\android-sdk-windows\tools as well.
Step 4: Make sure USB Debugging is off by going to Settings>Applications>Development. Now connect the phone to your PC via USB cable.
Step 5: Mount your sdcard; Browse to the HTC Sync folder and install HTC Sync on your pc. After it is done installing unmount the sdcard then enable your USB debugging.
Step 6: Open a command prompt by clicking the Start button and typing cmd into the search box and pressing enter or found under All Programs>Accessories.
Step 7: You will now enter a series of commands which I will place inside code boxes to indicate the entire command. You may copy and then paste them into the command prompt window by right clicking. Only enter one command at a time.
1:
Code:
cd C:\android-sdk-windows\tools
2:
Code:
adb devices
If you've been following this guide you will see your phone's serial number. If you get "device not found" error, you either need to make sure you the drivers were properly installed or make sure you enable USB debugging AFTER you connect the USB cable. Continue on once you get the proper phone serial output.
3:
Code:
adb push asroot2 /data/local/
4:
Code:
adb shell
5:
Code:
chmod 0755 /data/local/asroot2
6:
Code:
/data/local/asroot2 /system/bin/sh
You should see an output that says:
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pope_inode_info layout
Opening: /proc/857/fd/3
SUCCESS: Enjoy the shell.
#​Now for a few last commands.
7:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
8:
Code:
cd /system/bin
9:
Code:
cat sh > su
10:
Code:
chmod 4755 su
You are now officially rooted. A few more steps and you will have flashed the recovery image.
11:
Code:
exit
12:
Code:
exit
13:
Code:
adb push recovery-RA-heroc-v1.6.2.img /sdcard
Pushing is equivalent of copy the file to the root of your sdcard. By the time you finished reading this it should be done. You'll know its done because the ouput will say something like transferred X bytes in X secs.
14:
Code:
adb shell reboot
This will cause the phone to restart automatically. Wait till it is fully booted to continue.
15:
Code:
adb shell
16:
Code:
su
17:
Code:
cd /sdcard/
18:
Code:
flash_image recovery recovery-RA-heroc-v1.6.2.img
FLASHING TO THE RECOVERY TAKES SEVERAL SECONDS-- BE PATIENT. ENTER THE NEXT COMMAND ONLY AFTER THE COMMAND PROMPT RETURNS TO THE # (ROOT SYMBOL).
19:
Code:
reboot recovery
Step 8: This is the last command; you may now close the cmd prompt. This will cause your phone to boot into recovery mode; it should take no longer than 30 secs. The third option on the list is "- Backup/Restore"; select it. Now, select the first option "- Nand backup". The phone will prompt you to press HOME to confirm which is want you want to do. The backup will begin. You will see the screen say, "Performing backup : .........." When done, the bottom of the screen will say "Backup complete!" and you will be given the menu options again. Go back to the main menu and select reboot system. Rebooting your phone after installing the new recovery image may take several minutes.
Step 9: Once your phone is fully booted, mount the sdcard. You will see a folder called "nandroid"; I highly recommend you copy this to your pc in case you lose your sdcard data or reformat it. Your phone is rooted, 100% backed up, and ready to install a custom rom if you wish!
wow dude,
instructions worked great on Win7
i was able to download the missing usb_drivers by running SDK Setup in C:\android-sdk-windows, and selecting the usb driver from the available packages. I was unable to download the index for the SDK Setup program until I enabled "force http://" in the settings menu.
had to copy over asroot again after i ran SDK Setup (that program deleted it from the directory)
your instructions worked like a charm. total time spent rooting this thing after finding your post: 18 minutes.
(you might want to add a line there in the "mount and copy over the zip file step" to backup the nandroid folder from your SDCard to your comp just as a backup of your stock phone image)
anyway.. cheers!
izanagi said:
wow dude,
i'm about to follow these instructions. thank's for the precise list!
(btw, about to try it on Win7.. may have to change some folder pathing but we'll see)
okay.. typo on the first command in parentheses, and I'm missing the usb_drivers folder (do you have it / can sent it to me) so am unable to install the device in win7.
Click to expand...
Click to collapse
Heh, thanks for the misspell heads up. I did my rooting from Win7 pc; it automatically installed correct drivers for me. To check go to the Control Panel>View devices and printers. You see one device named "Android Phone". Otherwise as far as Ive heard installing HTC Sync installs proper drivers.​
izanagi said:
*** edit had to copy over asroot again after i ran SDK Setup (that program deleted it from the directory)
**** edit: all done.. your instructions worked like a charm. total time spent rooting this thing after finding your post: 18 minutes.
(you might want to add a line there in the "mount and copy over the zip file step" to backup the nandroid folder from your SDCard to your comp just as a backup of your stock phone image)
anyway.. cheers!
Click to expand...
Click to collapse
Thank you for taking the time help make my guide better. I'm very glad to know there are little to no hiccups.
When I do step 5, instead of:
5. "/data/local/asroot2 /system/bin/sh"
You should see an output that says:
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pope_inode_info layout
Opening: /proc/857/fd/3
SUCCESS: Enjoy the shell.
#
I get:
[1] Killed /data/local/asroot2 /system/bin/sh
Any suggestions? Should I just be quiet until there is an Eris specific way to do this?
When I do step 5, instead of:
5. "/data/local/asroot2 /system/bin/sh"
You should see an output that says:
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pope_inode_info layout
Opening: /proc/857/fd/3
SUCCESS: Enjoy the shell.
#
I get:
[1] Killed /data/local/asroot2 /system/bin/sh
Any suggestions? Should I just be quiet until there is an Eris specific way to do this?
detox702 said:
When I do step 5, instead of:
5. "/data/local/asroot2 /system/bin/sh"
You should see an output that says:
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pope_inode_info layout
Opening: /proc/857/fd/3
SUCCESS: Enjoy the shell.
#
I get:
[1] Killed /data/local/asroot2 /system/bin/sh
Any suggestions? Should I just be quiet until there is an Eris specific way to do this?
Click to expand...
Click to collapse
This guide is for the CDMA Hero not the Eris!
When I go to apply the rom I get an white screen with skateboarding androids on the bottom and the prompt to erase data yes/no. I press the home key and the Hero reboots without asking to "Apply sdcard:choose zip". This is done from the boot menu. Does the rom load automatically? Did I do something wrong? I got root with no problem. A tip; to make it easier and to avoid spelling mistakes copy and paste the rooting commands from the instructions. Made it go faster too. Thanks in advance.
Never mind. I held down Home and Power at
the same time instead of Home THEN power! ARRGH! Loading up now as I type. Sorry.
ELIMINATED said:
When I go to apply the rom I get an white screen with skateboarding androids on the bottom and the prompt to erase data yes/no.
I press the home key and the Hero reboots without asking to "Apply sdcard:choose zip".This is done from the boot menu.
Does the rom load automatically? Did I do something wrong? I got root with no problem.
A tip; to make it easier and to avoid spelling mistakes copy and paste the rooting commands from the instructions. Made it go faster too. Thanks in advance.
Click to expand...
Click to collapse
yuck... break up your sentences, that's alot of crap to throw on someone all at once... and the bold doesn't help it any.
check to see if you have the custom recovery installed....
-turn off phone
-hold vol down + power
-should search for some stuff then give three options
-press "home" to enter recovery image
do you see "!" and a phone.... does it just hang or do you see a green/yellow menu?
At the end of his post he says he figured it out. He wasn't holding down home key
None of this is working for me at all... I'm not sure what I'm doing wrong, but every time I enter ANY of the commands into the prompt all I get is "cannot find the path specified".
For reference, i have done everything in this guide to the letter, everything is downloaded, unzipped to the correct location, USB drivers installed, etc etc. Not sure what's wrong.
EDIT: I figured it out.. user error, awesome. Worked great, thanks for this!
awesomeindeed said:
None of this is working for me at all... I'm not sure what I'm doing wrong, but every time I enter ANY of the commands into the prompt all I get is "cannot find the path specified".
For reference, i have done everything in this guide to the letter, everything is downloaded, unzipped to the correct location, USB drivers installed, etc etc. Not sure what's wrong.
EDIT: I figured it out.. user error, awesome. Worked great, thanks for this!
Click to expand...
Click to collapse
"cd C:\android-sdk-windows\tools" is actually "cd C:\android-sdk_r3-windows\tools"
is that where you are stuck?
thank you TS. I've been lurking xda for a couple years now when i had the mogul and tp. First time on an android device. Thank you for your time in helping me.
someone buy this man a drink!!!
Invaluable piece of work right here, helped me get it done in no time at all....real clear concise and very helpful....REQUEST THIS BE A STICKY!!!!!
fenske09 said:
"cd C:\android-sdk-windows\tools" is actually "cd C:\android-sdk_r3-windows\tools"
is that where you are stuck?
Click to expand...
Click to collapse
That was the name of the zip file not the extracted folder.
Please help, I followed all of your instructions, I received no errors however I can't boot the recovery image. I checked and it is in the sd card, but every time it just hangs at the HTC logo
I downloaded a terminal emulator and typed su and it gave me # so I assuming I am rooted?!
newtodroid said:
Please help, I followed all of your instructions, I received no errors however I can't boot the recovery image. I checked and it is in the sd card, but every time it just hangs at the HTC logo
I downloaded a terminal emulator and typed su and it gave me # so I assuming I am rooted?!
Click to expand...
Click to collapse
Redownload the recovery image and reflash it. The one you're using probably became corrupt during DL or something.
theresthatguy said:
Redownload the recovery image and reflash it. The one you're using probably became corrupt during DL or something.
Click to expand...
Click to collapse
also make sure you have the heroc version there's a hero and heroC, i messed that up once and had similar results
new ROM
So i loaded the custom ROM, and i followed all the istructions as listed on this guide. When i rebooted my phone, a bunch of my apps started Force Closing on startup.
did i miss something, or do something wrong?
if i reinstall them on the new ROM will they work right?
thanks for any insight
kristaps said:
So i loaded the custom ROM, and i followed all the istructions as listed on this guide. When i rebooted my phone, a bunch of my apps started Force Closing on startup.
did i miss something, or do something wrong?
if i reinstall them on the new ROM will they work right?
thanks for any insight
Click to expand...
Click to collapse
you converted your sd card to fat32,ext2,swap and now the apps are looking for the program on your sd card,
turn off your phone
take out sd card
turn on phone
uninstall app
turn off phone
put in sd card
turn on phone
reinstall app
this should fix you

How To Root An AT&T HTC One X [No Longer Working]

This root was rendered unusable at this time due to AT&T disabling the Ready2Go app installation feature. Working on a work around now.
Original content:
http://www.androidpolice.com/2012/0...the-att-htc-one-x-on-version-1-85-or-earlier/
Hope you get your One X soon dude!
Confirmation number: 8PH11891CA483914J
In! Thanks Justin!
Billy
Damn, thanks a lot!
jcase said:
Now comes the timing critical part, you have to use ATT Ready2Go to Download "AT&T Mark the Spot", and interrupt the install process right after the download has finished. Easiest way is to reboot the device, but we have found other ways to do it.
Click to expand...
Click to collapse
OK, so when exactly do we reboot? There is no download status bar or whatnot, and I have rebooted right when it says install started to no avail. Do we have to do it before that point?
<---Not a noob, just crappy at timing.
id10terrordfw said:
OK, so when exactly do we reboot? There is no download status bar or whatnot, and I have rebooted right when it says install started to no avail. Do we have to do it before that point?
<---Not a noob, just crappy at timing.
Click to expand...
Click to collapse
You need to reboot right after the download is done. I haven't had a chance to do this in person, I just found it in the firmware and asked others to test for confirmation. Hopefully someone can chime in and tell us what visual indicators show when to do the reboot.
Some testers got it first try, some took 3-4 tries.
id10terrordfw said:
OK, so when exactly do we reboot? There is no download status bar or whatnot, and I have rebooted right when it says install started to no avail. Do we have to do it before that point?
<---Not a noob, just crappy at timing.
Click to expand...
Click to collapse
I'm with you on this one. I've been trying this for last hour but to no avail. The minute it says in status bar that it's installing, I tried command. I tried when I press finish on phone and LTE signals go up and down and even tried as soon as I was done with att site but can't get it to work. I've restarted 20 times and this startup sounds I think is now annoying other people in the office
jcase said:
You need to reboot right after the download is done. I haven't had a chance to do this in person, I just found it in the firmware and asked others to test for confirmation. Hopefully someone can chime in and tell us what visual indicators show when to do the reboot.
Some testers got it first try, some took 3-4 tries.
Click to expand...
Click to collapse
Hah, well now I just feel dumb as I am on try 10 or so. I must not be able to hit the timing right at all. I'll keep at it, as I am constant as the northern star.
Don't feel dumb, it is very timing critical, with few real indicators of when to pull it off.
Maybe xfinrodx or designgears can chime in on this one
noobsquared said:
I'm with you on this one. I've been trying this for last hour but to no avail. The minute it says in status bar that it's installing, I tried command. I tried when I press finish on phone and LTE signals go up and down and even tried as soon as I was done with att site but can't get it to work. I've restarted 20 times and this startup sounds I think is now annoying other people in the office
Click to expand...
Click to collapse
Turn your ringer off, it will silence the startup sound. At least I can help with that!
id10terrordfw said:
Turn your ringer off, it will silence the startup sound. At least I can help with that!
Click to expand...
Click to collapse
Thanks, but everytime I do factory reset...it comes back on?
I might be doing something dumb.
After I get permission denied error, I try to start at the process of tryping:
Code:
adb shell ln -s /data/local.prop /data/install/com.att.android.markthespot.apk
but when I do that after uninstalling AT&T Mark the spot, it gives me erorr:
link failed File exists
So I do a factory reset and then try again from scratch.
Is there an easier way to repeat the process?
Edit: I figured it out, just delete the file like this:
Code:
adb shell rm -r /data/install/com.att.android.markthespot.apk
Hope that's the right way of doing it.
Thank you.
I have been deleting the file from data/install
adb shell
cd data/install
rm com.att.android.markthespot.apk
exit
then repeat the process...i'm in double digits on attempts...going to have to walk away from it for a bit.
going on 10x for me and still nothing. Any suggestions?
id10terrordfw said:
OK, so when exactly do we reboot? There is no download status bar or whatnot, and I have rebooted right when it says install started to no avail. Do we have to do it before that point?
<---Not a noob, just crappy at timing.
Click to expand...
Click to collapse
No worries. Here's the way I did it back when I did it:
Open 2 cmd windows
adb devices on both (to make sure daemon is running)
In first shell type adb reboot but do not execute (obviously!)
In second window, cd /data/install
Enter ls -l
Now tell Ready2Go to install.
In that second window SPAM "up arrow - enter" to repeatedly execute ls -l. Observe the .apk file growing in size. When it stops growing it's probably done downloading (It is 3801413 bytes as of today). Go back to that first window IMMEDIATELY and hit enter on that adb reboot you typed in. It's a small apk so you need to be fast.
This was my method. Hopefully it works for you!
noobsquared said:
Thanks, but everytime I do factory reset...it comes back on?
I might be doing something dumb.
After I get permission denied error, I try to start at the process of tryping:
Code:
adb shell ln -s /data/local.prop /data/install/com.att.android.markthespot.apk
but when I do that after uninstalling AT&T Mark the spot, it gives me erorr:
link failed File exists
So I do a factory reset and then try again from scratch.
Is there an easier way to repeat the process?
Edit: I figured it out, just delete the file like this:
Code:
adb shell rm -r /data/install/com.att.android.markthespot.apk
Hope that's the right way of doing it.
Thank you.
Click to expand...
Click to collapse
Um, why are you doing a factory reset?
---------- Post added at 12:11 PM ---------- Previous post was at 12:10 PM ----------
xfinrodx said:
No worries. Here's the way I did it back when I did it:
Open 2 cmd windows
adb devices on both (to make sure daemon is running)
In first shell type adb reboot but do not execute (obviously!)
In second window, cd /data/install
Enter ls -l
Now tell Ready2Go to install.
In that second window SPAM "up arrow - enter" to repeatedly execute ls -l. Observe the .apk file growing in size. When it stops growing it's probably done downloading (I think it was around 5MB but it's been a while). Go back to that first window IMMEDIATELY and hit enter on that adb reboot you typed in. It's a small apk so you need to be fast.
This was my method. Hopefully it works for you!
Click to expand...
Click to collapse
I will give that a shot, and I should have thought of that. Thanks!
xfinrodx said:
No worries. Here's the way I did it back when I did it:
Open 2 cmd windows
adb devices on both (to make sure daemon is running)
In first shell type adb reboot but do not execute (obviously!)
In second window, cd /data/install
Enter ls -l
Now tell Ready2Go to install.
In that second window SPAM "up arrow - enter" to repeatedly execute ls -l. Observe the .apk file growing in size. When it stops growing it's probably done downloading (It is 3801413 bytes as of today). Go back to that first window IMMEDIATELY and hit enter on that adb reboot you typed in. It's a small apk so you need to be fast.
This was my method. Hopefully it works for you!
Click to expand...
Click to collapse
Good advice, was the first person to test it for me. I confirmed it with 4 users before posting, and all got it eventually.
id10terrordfw said:
I will give that a shot, and I should have thought of that. Thanks!
Click to expand...
Click to collapse
I was the first one I'm aware of who used this exploit a couple weeks ago. I won't claim that the process is clean, but it should work for you if you do it the way I intended the instructions to read... Good luck!
Thanks for all the help but I think this red bull is not working today.
Here is what I did:
First CMD:
Code:
adb shell
cd /data/install
ls -l <- it only gives me the file name..it doesn't tell me the size.
Also, I delete the file and run the first command in second CMD and right after that I see this in ls -l:
[email protected]:/data/install $ ls -l
ls -l
lrwxrwxrwx shell shell 2012-05-25 12:16 com.att.android.markthesp
ot.apk -> /data/local.prop
Second CMD:
Execute:
Code:
adb shell ln -s /data/local.prop /data/install/com.att.android.markthespot.apk
Wait to execute:
Code:
adb reboot
xfinrodx said:
No worries. Here's the way I did it back when I did it:
Open 2 cmd windows
adb devices on both (to make sure daemon is running)
In first shell type adb reboot but do not execute (obviously!)
In second window, cd /data/install
Enter ls -l
Now tell Ready2Go to install.
In that second window SPAM "up arrow - enter" to repeatedly execute ls -l. Observe the .apk file growing in size. When it stops growing it's probably done downloading (I think it was around 5MB but it's been a while). Go back to that first window IMMEDIATELY and hit enter on that adb reboot you typed in. It's a small apk so you need to be fast.
This was my method. Hopefully it works for you!
Click to expand...
Click to collapse
Great Idea !!!.... If you could post the exact size of the file , we can probably try to script it...( I have an idea in mind as mentioned below , but not sure if it works the way I intended in android )
for Ex:
szie=`ls -l /data/install/com.att.android.markthespot.apk | awk '{print $4}'`
while [ "$szie" -lt <size-of-apk> ];do
echo "waiting......"
done
adb reboot
dharani1234 said:
Great Idea !!!.... If you could post the exact size of the file , we can probably try to script it...( I have an idea in mind as mentioned below , but not sure if it works the way I intended in android )
for Ex:
szie=`ls -l /data/install/com.att.android.markthespot.apk | awk '{print $5}'`
while [ "$szie" -lt <size-of-apk> ];do
echo "waiting......"
done
adb reboot
Click to expand...
Click to collapse
If you can get a working script, that was reliable I would love to post it in the OP. To get an idea of the size, you could install the app, and do adb shell ls -l /data/app/<filename>

[WINDOWS][TUT]ADB tutorial, setting up ADB, usefull commands, collecting debug info.

Hi all.
Everyone here on our forum wants to help devs by testing different stuff but devs wants testers to send debug info to them so they can resolve bugs. Notifying bugs without logcats is useless and some users don't know how to collect these debug data.
To collect debug info there is a tool named ADB (Android Debugging Bridge). we r very small community and there are not plenty of sgr users around here so we have to worry about knowledgeable testers. so i m making this basic instructional guide to ADB. about how to set up ADB on windows and some basic usage.
Setting up ADB on windows.​
Know this first.
> ADB requires usb drivers. So first of all install kies so that ur pc detects ur phone and ADB can recognise ur phone.
> Android is linux based and in linux commands are case sensitive so while typing these command use propare case otherwise commands won't execute.
> Windows uses back slash [\] and linux uses forward slash [/] so while typing file locations. For location of file in ur pc use back slash and for files in ur phone/sd card use forward slash.
there are two ways to setup adb on ur windows pc.
1 > download the android sdk, it includes the adb
u can download latest android sdk from HERE.
2 > only download adb package, no need of downloading the whole sdk.
look at the end of post to find the zip file of adb package.
now after downloading:
if u have downloaded sdk read this:
> after downloading sdk, extract it to ur desired location.
> after extracting, open that folder and goto "platform-tools" folder.
> now hold the shift key and hit right click in that directory
> click "open command window here"
> u will see command promp, type "adb" in command prompt. if adb executes means u have successfully setup adb on ur windows.
if u r using without sdk:
> just extract the package
> hold shift key, hit right click and choose "open command prompt here"
> type "abd" in command prompt and check if adb executes.
now as we have successfully setup adb lets begin to some basic commands.
first of all connect ur phone using usb cable. make sure u have checked usb debugging in settings>applications>development>check usb debugging.
now open adb as mentioned above and type
Code:
adb devices
u should see
Code:
list of attached devices
xyz device
xyz will be name of ur device, as default it will be some number.
Basic usefull ADB commands​
1.
Code:
adb pull
this command can be used copy files from ur device to ur pc.
for eg.
Code:
adb pull /system/app/Camera.apk
this will copy the camera app to the directory where adb is extracted.
if u know the path u can copy anything using this command.
2.
Code:
adb push
this command can be used to push files to ur phone.
type the command, drag and drop the file in command prompt and than type location where u want to push that file and hit enter.
for eg, if i want to push image named android.jpg stored in my C drive.
Code:
adb push C:\android.jpg /sdcard/
this will push that image to sdcard.
sometimes we have to push some packages in specified folders. just type the location after file name.
for eg
Code:
abd push C:\sanim.zip /system/media
3.
Code:
adb install
with help of this command we can install apps to our phone dorectly from pc.
for eg. type "adb install" than leave one space with mouse choose apk file of app u want to install and drag and drop it in command prompt. path of that app will be displayed in command prompt. like this.
Code:
adb install C:\adb\Camera.apk
by executing this command u can install the app u have dragged and dropped in command prompt.
As i have written for windows but these commands can be used on ADB on linux/MacOS as well but i have only mentioned the set-up guide for windows only.
Credits/Source.​
http://developer.android.com/tools/help/index.html
Getting Debug Infos (Logcats)​
1. logcat
logcat is a report from android logging system which runs in background from the moment u boot ur phone. and it haves all the info what went wrong with system.
generally we can see logcat by typing
Code:
adb logcat
but that will show the constant data flow so better save it as file so can be sent to dev or u can study it later.
Code:
adb logcat > log.txt
this will store the logcat to directory of adb and collect log in text file.
2. bugreport
Code:
adb bugreport
bug report prints dumpsys, dumpstate, and logcat data to the screen. which can be used for bug reporting.
3. Java Debug Wire Protocol
Code:
adb jdwp
this command prints the list of available JDWP processes on connected device in command prompt.
Logcats On Mobile​u can directly generate logcat on ur mobile using Terminal Emulator app, there are many terminal apps in market. CM comes with pre-loaded Terminal Emulator.
some terminal apps:
Android Terminal
Terminal Emulator
RomToolbox
u will need root access to generate logs
open terminal app, u will see following screen
Code:
$ export PATH=/data/local/bin:$PATH
$
now type su and hit enter.
allow super user permissions.
now to get a logcat type following command.
Code:
logcat > /mnt/sdcard/logcat.txt
this will generate text file named logcat.txt on root of ur sdcard which is containing logcat.
to get DMESG (Kernel Debug)
open terminal and type following command
Code:
su
dmesg > /mnt/sdcard/dmesg.txt
this will generate text file named dmesg.txt on root of ur sdcard which is containing kernel debug log.
Kernel Debugging.​
we can use adb to debug kernel issues.
Code:
adb shell
dmesg
this will generate a log which is very helpful to resolve kernel issues, we just have to send this log to dev, he will look after it.
sometimes after flashing kernel we go into bootloop in that cases generate logcat using this commands and send to dev it will be very helpfull for dev to know and resolve reason causing bootloop.
Code:
adb shell
cat /proc/last_kmsg > /sdcard/last_kmsg
this command should be executed immediately on reboot otherwise it will be over written by new kernel message. the file will be stored on root of ur sdcard named last_kmsg. send this file to kernel dev it will help him great to resolve the problem.
Read this if u dont know how to get files from ur sdcard even if ur phone is not booting and stuck at bootloop.
u must have CWM to do this.
>boot ur phone in recovery mode (by holding VOL UP and HOME key together on boot)
>goto "Mounts and Storage"
>Select "Mount USB Storage" and plug in your data cable.
>Now u can access ur sdcard on ur pc, after ur work is done click "Unmount"
Hi,
Just a noob question... if my phone is stuck in a bootloop, is there anyway for me to get a logcat without flashing a new rom???
Sent from my GT-I9103 using xda app-developers app
JoJo2012 said:
Hi,
Just a noob question... if my phone is stuck in a bootloop, is there anyway for me to get a logcat without flashing a new rom???
Sent from my GT-I9103 using xda app-developers app
Click to expand...
Click to collapse
If you have enabled USB Debugging , yes
"I have to go. It's just....they really need me." - Sora
Re: Toggle mobile data on and off via adb
Does anybody know how to toggle mobile data on and off via ADB?? IM WILLING TO PAY FOR THIS INFO lol I NEED IT THAT BAD!! PM ME PLEEEASE!!!!!
12manytimes said:
Does anybody know how to toggle mobile data on and off via ADB?? IM WILLING TO PAY FOR THIS INFO lol I NEED IT THAT BAD!! PM ME PLEEEASE!!!!!
Click to expand...
Click to collapse
'adb shell su -c "svc data disable"' and 'adb shell su -c "svc data enable"'. You must be rooted.
Sent from my GT-I9103 with CM10
Adam77Root said:
'adb shell su -c "svc data disable"' and 'adb shell su -c "svc data enable"'. You must be rooted.
Sent from my GT-I9103 with CM10
Click to expand...
Click to collapse
Thanks alot, i just sent you a PM but it shows that i didn't send anything, so if you didn't get the message please send me one cuz id like to buy you a beer!
I wish i could hit your thanks button a million times right now lol
Hello I am trying to create a batch file that has an infinite loop and was wondering if there are any adb commands that can do this.
I am also looking for an adb command that waits x amount of seconds before performing the next command.?
Any help would be greatly appreciated

[Q] How to unroot phone Atrix 2

I used the eacy one click to root phone. I would like to unroot it now. I am having touch screen freezing problem. I need to start removing applications to see which one is causing the problem or if it is a hardware issue or software.
I downloaded the zip file 1-click_exploit. I expanded the files and ran the application. I have read that there is an option to uninstall with in that file but I don't see one. Where do I find it. If I just do a factory reset will it remove it? If I do a reset do I have to repurchase all of my apps?
Thank you in advance!
A factory data reset will not remove root.
Also, a reset does not delete your purchases. They are all stored in your google account. So, if they do get deleted, just reinstall them.
As far as unrooting, I do not know. Someone else may chime in here...probably going to tell you to post in the Q&A section as well.
Doesn't the one-click have an un-root feature?
Sent from my bootloader-locked MB865.
The one click method also has an un root option in the folder.
Sent from my MB865 using xda app-developers app
Generally the only trace rooting leaves is a setuid binary "su" in /system/bin. And Superuser.apk to manage permission which apps get to invoke the binary. So unrooting involves uninstalling Superuser application and removing the su binary. If you want to do it by hand: (1) adb remount (2) adb shell (3) su (4) rm /system/bin/su
kousik said:
Generally the only trace rooting leaves is a setuid binary "su" in /system/bin. And Superuser.apk to manage permission which apps get to invoke the binary. So unrooting involves uninstalling Superuser application and removing the su binary. If you want to do it by hand: (1) adb remount (2) adb shell (3) su (4) rm /system/bin/su
Click to expand...
Click to collapse
I have no idea what the above manual steps are for. I can uninstall the application but where and how do I remove the su binary. On the phone? Please send directions for a non technical type of user.
Thank you!
MaTrixJ said:
The one click method also has an un root option in the folder.
Sent from my MB865 using xda app-developers app
Click to expand...
Click to collapse
Not sure where in the the following files in 1-click_exploit is the unroot option.I have attached a list of the files in the download.
bushbaum said:
Not sure where in the the following files in 1-click_exploit is the unroot option.I have attached a list of the files in the download.
Click to expand...
Click to collapse
Out of these files, adb.exe and .dll files are left in your windows PC. Not sure if they are deleted afterwards, if not, you can always unzip the above into a directory. You'll need the adb and the dll files.
The su and superuser.apk are two files that are pushed to your phone that provides the root functionality.
The zerg file is the exploit payload temporarily used to root your phone, and removed later by the script.
So if you have unzipped these into a directory, connect your phone via USB (make sure usb debugging is on), and run the commands
Code:
adb.exe remount
adb.exe shell
su // superuser may pop a permission request on phone screen
rm /system/bin/su
rm /system/app/Superuser.apk
exit
kousik said:
Out of these files, adb.exe and .dll files are left in your windows PC. Not sure if they are deleted afterwards, if not, you can always unzip the above into a directory. You'll need the adb and the dll files.
The su and superuser.apk are two files that are pushed to your phone that provides the root functionality.
The zerg file is the exploit payload temporarily used to root your phone, and removed later by the script.
So if you have unzipped these into a directory, connect your phone via USB (make sure usb debugging is on), and run the commands
Code:
adb.exe remount
adb.exe shell
su // superuser may pop a permission request on phone screen
rm /system/bin/wu
rm /system/app/Superuser.apk
exit
Click to expand...
Click to collapse
What mode is my usb connection? charge only? I have the phone setting usb setting on. I run the commands (using the run command in windows accessories). When I go run "adb.exe remount" the black command screen blinks on screen so then under I go to run again and entered "adb.exe shell" the run command screen opens up with [email protected]:/$ I put in "su" After I entered the command rm system/bin/wu I get a "read only error" how do I change from read only?
Sorry for all these questions but I warned you that I was not a technical user. Thanks
bushbaum said:
What mode is my usb connection? charge only? I have the phone setting usb setting on. I run the commands (using the run command in windows accessories). When I go run "adb.exe remount" the black command screen blinks on screen so then under I go to run again and entered "adb.exe shell" the run command screen opens up with [email protected]:/$ I put in "su" After I entered the command rm system/bin/wu I get a "read only error" how do I change from read only?
Sorry for all these questions but I warned you that I was not a technical user. Thanks
Click to expand...
Click to collapse
I was wondering do I have to have the elite version superuser installed to grant permission to system? I just have the free version.
bushbaum said:
What mode is my usb connection? charge only? I have the phone setting usb setting on. I run the commands (using the run command in windows accessories). When I go run "adb.exe remount" the black command screen blinks on screen so then under I go to run again and entered "adb.exe shell" the run command screen opens up with [email protected]:/$ I put in "su" After I entered the command rm system/bin/wu I get a "read only error" how do I change from read only?
Click to expand...
Click to collapse
1. yes -- charge only
2. it is better to open a command prompt -- in run commands type in "cmd" which'll give you a shell, easy to track command outputs
3. in that shell cd to the directory you unzipped and run "adb.exe remount"
4. Unless it says "remount succeeded" further operations won't succeed
5. After you execute "su" your prompt will change from $ to # ... is this happening?
6. Only on # prompt, you can do "rm /system/bin/su" ... that too only if remount succeeded
Let us know at which step it fails.
kousik said:
1. yes -- charge only
2. it is better to open a command prompt -- in run commands type in "cmd" which'll give you a shell, easy to track command outputs
3. in that shell cd to the directory you unzipped and run "adb.exe remount"
4. Unless it says "remount succeeded" further operations won't succeed
5. After you execute "su" your prompt will change from $ to # ... is this happening?
6. Only on # prompt, you can do "rm /system/bin/su" ... that too only if remount succeeded
Let us know at which step it fails.
Click to expand...
Click to collapse
I get the following error after entering the run "adb.exe remount"
*daemon not running starting it now*
*daemon started successfully*
remount failed: operation not permitted
bushbaum said:
I get the following error after entering the run "adb.exe remount"
*daemon not running starting it now*
*daemon started successfully*
remount failed: operation not permitted
Click to expand...
Click to collapse
Then try remounting manually:
Code:
C:\> adb.exe shell
edison$/ su
edison#/ mount -o remount,rw /dev/block/system /system
Afterwards proceed with rest of the script.

Dual SIM switching using Tasker

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?

Categories

Resources