How to create your own one click recovery installer for any android device - General Topics

Today most of us use one click softwares to work with our android phones or tablets.
Ever wondered how these work ??
If,yes today i will teach you how to make your own "one click custom recovery for your phone". :good:
Before we begin we need a few requirements. The basic things include
TWRP image for your phone
You can download the image for your phone by clicking here
Notepad or any other similar software installed on your pc
Some knowledge on creating a ".bat" file
and a device with unlocked bootloader
Once you have this lets get started.
First download and extract the "Recovery files.zip" from the attachments
How to make a one click recovery
After downloading copy the twrp image to this folder.
Now,Create a new text file and write the following commands.
Before that let us understand some basic bat file commands.
The word "echo" is used to add lines in bat file. If u want to add blank lines just type "echo." and to add text or any other symbols type "echo <your text> " Make sure you leave a space after echo and eliminate the"<>" symbols.
To change the default colour,type "color 0a". You can try changing "a" with "b","c" etc to see new colours.
The "pause" Command is used to view the message "Press any key to continue",
The "cls" command clear the entire window and execute the lines just after the cls command.
The "exit" to close the bat file.
I think thats enough for a begginer.If you have any doubts ask in comments not in pm.
So first type these commands in the text file you created
Code:
@echo off
COLOR 0b
Title <YOUR TITLE FOR THE SOFTWARE>
echo -----------------------------------------------------------
echo -----------------------------------------------------------
echo One Click TWRP Recovery Installer for <DEVICE NAME>
echo -- TWRP Recovery image by <YOUR NAME>--
echo -----------------------------------------------------------
echo -----------------------------------------------------------
echo One Click Installer made by [url]www.YOUR[/url] WEB SITE.com
echo -----------------------------------------------------------
echo -----------------------------------------------------------
echo <any thing you like to display>
pause
cls
The pause is given to promt the user to press any key to continue
The "cls" to clear all the details printed after the key is pressed.
If you want to add blank lines type "echo." and hit enter.
Code:
adb devices
adb reboot bootloader
fastboot devices
fastboot erase cache
fastboot flash recovery [COLOR="Orange"]recovery file name[/COLOR].img
echo -----------------------------------------------------------
echo -----------------------------------------------------------
echo Installation successful!
echo Your device will now reboot automatically.
echo -----------------------------------------------------------
echo -----------------------------------------------------------
fastboot reboot
echo to close this window press any key..
pause
exit
I hope you may have some knowledge about the adb commands,so that i dont need to explain those again.
Once this is done save the file as "filename.bat" and save type to "All Files" from "Text Document".
Once agin to keep in mind this requires a phone with Unlocked bootloader and Make sure that "USB Debugging is enabled"
You can see the bat file i created with above codes and the text file i wrote in the attachment
If this helped you post you reply and thumbs up :laugh:

Great but please use "[ CODE][/ CODE]" to format the code parts in your text (like the following example). And take another look, there are some Typos.
Code:
This is how it looks formatted as code!
Keep it going
Deletescape

deletescape said:
Great but please use "[ CODE][/ CODE]" to format the code parts in your text (like the following example). And take another look, there are some Typos.
Code:
This is how it looks formatted as code!
Keep it going
Deletescape
Click to expand...
Click to collapse
Yeah thanks for the info. I will look into that today itself

Thanks
Ty, very useful.

caes95 said:
Ty, very useful.
Click to expand...
Click to collapse
you are
welcome

adithyan25 said:
Yeah thanks for the info. I will look into that today itself
Click to expand...
Click to collapse
I have changed as you suggested :victory:

Related

idea for dualbooting android builds... somewhat

alrighty, basically im lazy and want someone else to do this for me.
heres my idea:
you install rc33 or whatever you want, make a nandroid backup of it, rename the folder to OS1. this folder contains your boot.img data.img and so on
then install or place a nandroid backup of another build into a folder called OS2..
then you would be able to boot into the modified recovery mode, which would have the selection to run a script, which then asks which OS to flash, 1 or 2, you press 1 or 2 wait for it to flash and reboot, a little hacky way to get a dual boot...
now who wants to repack a recovery image for me?
good idea would be worth a try , too bad im not up to par for the job , but id like to see it done
i'll give this a shot tomorrow and see what happens, not really feeling like doing it now. and i'm not gonna do it via rebuilding the recovery.img, just gonna make a script that does it for me from the recovery terminal. i'm quite lazy as well and i already have a script that runs the fastboot commands from my computer script to flash from one build to another, in theory it shouldn't be too hard to get the script terminal reaady and do that.
tubaking182 said:
i'll give this a shot tomorrow and see what happens, not really feeling like doing it now. and i'm not gonna do it via rebuilding the recovery.img, just gonna make a script that does it for me from the recovery terminal. i'm quite lazy as well and i already have a script that runs the fastboot commands from my computer script to flash from one build to another, in theory it shouldn't be too hard to get the script terminal reaady and do that.
Click to expand...
Click to collapse
I have a .bat file that I use to flash back and forth from Windows.
To RC33
cd C:\Android\
@echo off
echo :::Instructions:::
echo You must have:
echo system.img
echo data.img
echo boot.img
echo installed in the "C:\Android" directory
echo then enable fastboot on device before proceeding
pause
fastboot flash system system.img
fastboot flash userdata data.img
fastboot flash boot boot.img
fastboot reboot
Click to expand...
Click to collapse
To 502H
cd C:\Android\502H\
@echo off
echo :::Instructions:::
echo You must have:
echo system.img
echo data.img
echo boot.img
echo installed in the "C:\Android\502H" directory
echo then enable fastboot on device before proceeding
pause
fastboot flash system system.img
fastboot flash userdata data.img
fastboot flash boot boot.img
fastboot reboot
Click to expand...
Click to collapse
Pretty simple. I have them stored to my desktop. I save my nandroid backups to the appropriate file and just double click. No problem. I just wish there was a script that I can use to reboot into HARDSPL mode (someone tell me if there is).
keatonreckard:
This is the worst idea i've heard so far...
FLASH has a limited life-time, and rewriting the whole system at every boot is a BAD idea.
If you want to dual-boot, you should look into making your own init-system, adding the ability to load another system (From SD).
Binary100100:
"adb reboot bootloader"
there might be a simpler way: change the kernel command so it mounts somewhere in sdcard as root. not sure how to do this without a computer though.
Hey binary, with your phone plugged into your comp pull up you cmd and type adb shell reboot bootloader, the phone will boot right into fastboot mode making it easy to continue the script
just to clarify...i meant a script that is store locally on the device in the recovery image... so then you dont need a computer at all... you can already do this, you just have to type in the commands from the recovery console...i just wanted an easier way to do it
Binary100100 said:
I have a .bat file that I use to flash back and forth from Windows.
To RC33
To 502H
Pretty simple. I have them stored to my desktop. I save my nandroid backups to the appropriate file and just double click. No problem. I just wish there was a script that I can use to reboot into HARDSPL mode (someone tell me if there is).
Click to expand...
Click to collapse
To flash back and forth from windows? You've been running Windows Mobile on the Dream? I must be missing something.
Joushou said:
keatonreckard:
This is the worst idea i've heard so far...
FLASH has a limited life-time, and rewriting the whole system at every boot is a BAD idea.
If you want to dual-boot, you should look into making your own init-system, adding the ability to load another system (From SD).
Binary100100:
"adb reboot bootloader"
Click to expand...
Click to collapse
not flash at every boot...just so you can text out a build and if you dont like it go back to a stable one on the go....
again, im taking the lazy way out
Disregard! - My mind ran ahead of what this post was about and I posted something regarding a slightly different idea!
I don't know about re-installing Nandroid backups...
But, if one wanted to be able to run two different installs...
Seems to me an easier way about doing this would be to have a modified SPL. It could have the option of selecting an update file...
For example, one could put two files on their sd card - update1.zip and update2.zip. The SPL could have one of the following options:
1) reboot into recovery mode - select "alt-s" - then you would have an option to select 1 or 2.
2) have an additional "Alt- " option.
"Alt-s" - runs update1.zip
"Alt-?" - runs update2.zip. (dev could pick the additional letter)
I think this would be great! No reteaching of anyone how to use the process. And, one could leave the primary use-able update.zip as "update1.zip" and use the other as the version being tried out. It wouldn't be a Nandroid back up... But, with the new "nowipe" builds it should work well.
My $.02 worth.
Joushou said:
keatonreckard:
This is the worst idea i've heard so far...
FLASH has a limited life-time, and rewriting the whole system at every boot is a BAD idea.
If you want to dual-boot, you should look into making your own init-system, adding the ability to load another system (From SD).
Binary100100:
"adb reboot bootloader"
Click to expand...
Click to collapse
To be fair, that limited life-time is something like 1,000,000 writes, which would take about... oh... a year straight of constantly rebooting your phone(assuming it takes 30 seconds per reboot)
EDIT: and that assumes re-writing the whole system every time you boot, which I don't think he means since he's saying its in the recovery image.
hmmm....
I know that from the alt+x console you can do this....
mount sdcard
echo "boot-recovery
--update_package=SDCARD:build1/update.zip" > /cache/recovery/command
reboot recovery
so if you wanted 2 builds available (I would think you would need a wipe for 2 completely different builds) but....
make 2 folders in on your sdcard
build1
build2
place a copy of the update.zip from each build you want to boot in the folder
make a script like this
Code:
echo "boot-recovery
--update_package=SDCARD:"$"/update.zip" > /cache/recovery/command
reboot recovery
save the script to the sdcard directory
then when you start your phone you could
1. type "mount sdcard" (no quotes)
2. type "sh sdcard/script.sh build1" (for build 1 located in /sdcard/build1/update.zip)
3. type "sh sdcard/script.sh build2" (for build 2 located in /sdcard/build2/update.zip)
problem would be when wipes are needed. But if you have 2 solid builds and don't need to wipe when swapping it should work.
Just need a way to make a script or bootloader that could run either one of these.
Cannot see another way around it since the OS is loaded into phone ROM/RAM
of course if your build supports the reboot command from the OS then you could just make a script to run when you want to reload the other build. Then you could skip the recovery console.
@beagz - Ha, forgot about that script. Yes, to switch between say, the DudesG build and Haykuro's H build one could write a script like that in Gscript and change back and forth when a new build comes out.
Like now... One could run Dudes G build and try out Haykuro's new ADP1.5 build.
But, I do believe your right about going back to a JF33 build - would need to wipe...
Gimpeh said:
To flash back and forth from windows? You've been running Windows Mobile on the Dream? I must be missing something.
Click to expand...
Click to collapse
Nah.. I was referring to using a bat file on my Windows computer to switch between 1.1 to 1.5 back to 1.1 by just executing the bat.
Now that i know that "adb reboot bootloader" will work it can be completely automated!
... but will it default to fastboot? Hmmm...
tubaking182 said:
Hey binary, with your phone plugged into your comp pull up you cmd and type adb shell reboot bootloader, the phone will boot right into fastboot mode making it easy to continue the script
Click to expand...
Click to collapse
Thanks! But is this going to put the phone in FASTBOOT mode? I'm trying to make this completely automatic if it's possible. Simply keep your latest and greatest backup .img's in a certain directory on your computer and EXECUTE!
Take a shower or whatever... come back and VOILA! Your previous backup.
The method that I've come up with thus far is pretty simple... but you just can't execute and walk away. You still need to enable FASTBOOT at the least on the bootloader. Although I haven't tried messing with it lately. I have my phone just like I want it.
Now that the Official ADP1.5 is out let's get to work on Mulitouch, themes, etc!
Wow this seems crazy but it just might work. Lol.
bat file to automatically restore backups using Windows!
So all you need to do is...
Open notepad, copy and paste the quoted text below, edit the top line of this bat file to the directory of your backups (I used "c:\android" for an example), save as .bat and double click. Wait and your done. Just watch it happen automatically.
Also if you decide to change that directory on the top line also use the directory on the 14th line. Your done. Easy restore to a backup.
HINT! Make a couple of these with a variety of directories on the top to change what backup your want to flash back to.
Example: c:\android\rc33; c:\android\501h; c:\android\adp15; etc
cd C:\android
color A
cls
@echo off
echo.
echo :::Instructions:::
echo.
echo You must have:
echo.
echo system.img
echo data.img
echo boot.img
echo.
echo installed in the "c:\android" directory
echo.
pause
cls
color b
echo.
echo.
echo.
echo Now restoring:
echo.
echo system.img
echo data.img
echo boot.img
echo.
echo to your device.
color c
echo.
echo DO NOT TURN OFF OR UNPLUG YOUR DEVICE DURING THIS PROCESS!!!
@adb shell reboot bootloader
@fastboot flash system system.img
@fastboot flash userdata data.img
@fastboot flash boot boot.img
@fastboot reboot
Click to expand...
Click to collapse
I've tested it and it works beautifully!
Hope it helps!
Thanks to everyone that pointed out the command "adb shell reboot bootloader"
This post is noob friendly.
OR
Use this script below for it to prompt for the location of your backups.
color A
cls
@echo off
echo.
echo :::Instructions:::
echo.
echo Enter directory of nandroid backups that you would like to restore...
set /p flash=path:
cd %flash%
cls
color b
echo.
echo.
echo.
echo Now restoring:
echo.
echo system.img
echo data.img
echo boot.img
echo.
echo to your device.
color c
echo.
echo DO NOT TURN OFF OR UNPLUG YOUR DEVICE DURING THIS PROCESS!!!
@adb shell reboot bootloader
@fastboot flash system system.img
@fastboot flash userdata data.img
@fastboot flash boot boot.img
@fastboot reboot
Click to expand...
Click to collapse
This one is even more noob friendly... but it's not as fast because it requires you to enter the location of your backups.
I hope it helps someone out there. It helps me.
[email protected]:
The average lifetime of flash is 100.000 writes, and flash isn't delivered 100% intact, they're usually delivered with faulty blocks (Depending on where you get it, blah blah blah).
That should change your numbers a bit (A month i believe?)
And, sure, he is using the update-zip, so it's not written to the same pages every time.
But still, it's a bad idea (Other than wearing stuff down, it will also be very slow ).
To dual-boot, modifying the init-system so it could choose from different android-runtimes would be way faster/cooler...
If possible, this would be pretty damn useful. Using a stable build while being able to tinker with experimental builds. Would definitly cut down on the constant flashing back and forth.

[Q] [Solved] batch file question(s) for auto adb

okay so im creating a batch file for a little automation just mainly for rebooting the device into bootloader/recovery.. i have gotten most of the way through but at the end i would like for the batch file to stop and allow for further manual input (like i have it set to reboot the device into bootloader and then i would like the window to stop and allow me to MANUALLY input the next command such as flash/reboot/whatever) however i cant seem to find any way of doing that
HERE IS WHAT I HAVE CURRENTLY
it all works perfectly just for the issue i cant seem to work out
ECHO OFF
ECHO ============== CHANING DIRECTORY ==============
CD c:\program files (x86)\android\android-sdk\tools
TIMEOUT 2 /NOBREAK >nul
ECHO ........ Done
ECHO ============== CHECKING ADB DEVICE CONNECTION ==============
TIMEOUT 2 /NOBREAK >nul
adb devices
ECHO ........ Done
PAUSE
:MENU
ECHO.
ECHO ================== ADB MENU ==================
ECHO PRESS 1 or 2 to select your task, or 3 to EXIT.
ECHO.
ECHO 1 - Reboot Device into Bootloader [FASTBOOT]
ECHO 2 - Reboot Device into Recovery [CLOCKWORK MOD]
ECHO 3 - EXIT
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
IF %M%==1 GOTO BOOTLOADER
IF %M%==2 GOTO RECOVERY
IF %M%==3 GOTO EOF
:BOOTLOADER
adb reboot bootloader
GOTO FASTBOOT
:RECOVERY
adb reboot recovery
GOTO RECOVERY
:FASTBOOT
ECHO .
ECHO Waiting for device to reconnect
TIMEOUT 15 /NOBREAK >nul
ECHO ........ Done
ECHO ================== FASTBOOT ==================
ECHO manually type fastboot commands
:RECOVERY
ECHO .
ECHO Waiting for device to reconnect
TIMEOUT 15 /NOBREAK >nul
ECHO ........ Done
ECHO ================== RECOVERY ==================
ECHO Manually handle Clockwork Recovery tasks
ECHO .
ECHO .
ECHO Will automatically close in about 5 Seconds =]
TIMEOUT 5 /NOBREAK >nul
ECHO ....... bye!
I am not sur to understand exactly what you want to do, but you can do what you want in you batch file, it is what you did with for exemple :
- "Reboot Device into Bootloader [FASTBOOT]"
- "Reboot Device into Recovery [CLOCKWORK MOD]"
You have just check the choice with a number and after execute your "code".
So, if you know the "adb script" in addiction of the command you want, go to "code" it.
I remake your script and i especially add an exemple.
- "Execution" and "Code" are more clear.
- It is better for checking error.
- Now, this script is able to check if you are in "64bit" or "32bit", and check if the "ADB Tool" is in his correct way.
- Now, this script is able to check if you have connect or not your device.
- You can see the BootAnimation without "Power OFF" and then "Power ON" your phone.
- It is more beautiful, even if it is not very important.
The new "code", with your previous "started code" :
Code:
Even this topic is solved, i remove my code.
cheers for the reply.. but that was not really what i was after... i did some more googling and what i found was (in the last 2 minutes) that i needed a CMD /K at the end of the file.. which leaves the command window open and i can now enter in fastboot commands manually (for flashing etc)... i have attached the file as a.txt for anyone to use themselves if they were so inclined..
1. just make sure the directory of your adb/fastboot.exe is in the same directory as mine (CD c:\program files (x86)\android\android-sdk\tools) and change the 2 lines if necessary with note pad by opening the .txt normally as yours might be in program files or in platform-tools not tools, etc
2. change the extension to .bat and not .txt
3. chuck it in your task bar/start bar etc for quicker acess
and should be good to go =]
edit: i see the checking that the other fellow put it can do the checking for you.. but for me i knew the directory, etc
So, i did not exaclty understand your aim, but you have found it, so it is perfect.
I remake my previous script to do exactly what you want, and i always check every thing during the execution, to know the mistake when we have a problem. Because my version is for everybody, even if i think it is just for us. (Views: 45)
So if you want it, or someone else, just ask me.
ptit developer said:
So, i did not exaclty understand your aim, but you have found it, so it is perfect.
I remake my previous script to do exactly what you want, and i always check every thing during the execution, to know the mistake when we have a problem. Because my version is for everybody, even if i think it is just for us. (Views: 45)
So if you want it, or someone else, just ask me.
Click to expand...
Click to collapse
no worries mate it was my first time writing an entire script so im pretty stoked with the outcome i tried to keep it looking as real as scripts i have seen as possible.. =]
I will continue to develop this idea : "A easy way to use ADB Menu".
When i will have finish, if you want i will post a link here to it.
ptit developer said:
I will continue to develop this idea : "A esay way to use ADB Menu".
When i will have finish, if you want i will post a link here to it.
Click to expand...
Click to collapse
sure mate.. ill edit the op if you like and can sort something out?
i think the simpler nature allows for much to be automated for mundane tasks... as long as you keep the fastboot commands manual so noobs dont do anything incorrect
I will use what you want, and i will add what i post in my first answer here.
In addition of this, i will post the final "A easy way to use ADB Menu" on a new topic on other section.
And i will post news here, because i think you will look it.

[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] Uber Noob needs help unlocking bootloader ubuntu.

Hello good people, i have the Sensation XE beats by dre and I'm currently stuck at the very last step of unlocking my bootloader. I have Ubuntu 13.04 andd i get the following error message: error: cannot load 'Unlock_code.bin': No such file or directory, - from this entry: sudo fastboot flash /home/Name/Downloads/Unlock_code.bin. I have tried various other combinations, i have a suspicion that its a pathway problem, but i can't figure it out, its my 5 straight hour trying to work this out, would really appreaciate the help. Also smashed my fist into the keyboard. Hopefully some one will take pitty from this last remark and help me.
Kind regards Shabibs.
shabibs said:
Hello good people, i have the Sensation XE beats by dre and I'm currently stuck at the very last step of unlocking my bootloader. I have Ubuntu 13.04 andd i get the following error message: error: cannot load 'Unlock_code.bin': No such file or directory, - from this entry: sudo fastboot flash /home/Name/Downloads/Unlock_code.bin. I have tried various other combinations, i have a suspicion that its a pathway problem, but i can't figure it out, its my 5 straight hour trying to work this out, would really appreaciate the help. Also smashed my fist into the keyboard. Hopefully some one will take pitty from this last remark and help me.
Kind regards Shabibs.
Click to expand...
Click to collapse
Just a question in the /home/NAME/Downloads/Unlock_code.bin did you infact change the NAME to your user name and is the file Unlock_code.bin really in your Downloads folder ?
If you dont know your username you can find it out like this:
Press CTRL + ALT + T
When the terminal opens you'll see something like this
Code:
[email protected]:~$
Where ajax is my user name and home is my computer name.
so in my case destination would go like this /home/ajax/Downloads/Unlock_code.bin or even simpler without user name ~/Downloads/Unlock_code.bin. you can choose which ever method you like.
Ajax1337 said:
Just a question in the /home/NAME/Downloads/Unlock_code.bin did you infact change the NAME to your user name and is the file Unlock_code.bin really in your Downloads folder ?
If you dont know your username you can find it out like this:
Press CTRL + ALT + T
When the terminal opens you'll see something like this
Code:
[email protected]:~$
Where ajax is my user name and home is my computer name.
so in my case destination would go like this /home/ajax/Downloads/Unlock_code.bin or even simpler without user name ~/Downloads/Unlock_code.bin. you can choose which ever method you like.
Click to expand...
Click to collapse
Yes, i did in fact change my name to my username, yes the file in is my downloads folder, i got my token with fastboot being placed in downloads folder as well.
thanks for responding Ajax .
shabibs said:
Yes, i did in fact change my name to my username, yes the file in is my downloads folder, i got my token with fastboot being placed in downloads folder as well.
thanks for responding Ajax .
Click to expand...
Click to collapse
Well UNIX systems are famous for the file hierarchy system if it tells you its not there its most likely not there. Another thing that comes to mind is check captial letters ( for instance user name is always lowercase and folder within your home are all caps ), second maybe try tabbing to the file for ex. /ho[TAB] it should finish to /home and do that for the rest of the path. Im sorry if you think that i am condescending im really not im just not aware how familiar with the linux environment.... i just thougth of something do CTRL + ALT + T type sudo fastboot flash then drag and drop the Unlock_code.bin into the terminal window will write out the path for you.
Thanks again, no worries about being condescending, the drag and drop function dosent work, i however got to here:
sudo fastboot flash /home/name/Downloads/Unlock_code.bin
unknown partition '/home/name/Downloads/Unlock_code.bin'
error: cannot determine image filename for '/home/name/Downloads/Unlock_code.bin'
Ajax1337 said:
Well UNIX systems are famous for the file hierarchy system if it tells you its not there its most likely not there. Another thing that comes to mind is check captial letters ( for instance user name is always lowercase and folder within your home are all caps ), second maybe try tabbing to the file for ex. /ho[TAB] it should finish to /home and do that for the rest of the path. Im sorry if you think that i am condescending im really not im just not aware how familiar with the linux environment.... i just thougth of something do CTRL + ALT + T type sudo fastboot flash then drag and drop the Unlock_code.bin into the terminal window will write out the path for you.
Click to expand...
Click to collapse
shabibs said:
Thanks again, no worries about being condescending, the drag and drop function dosent work, i however got to here:
sudo fastboot flash /home/name/Downloads/Unlock_code.bin
unknown partition '/home/name/Downloads/Unlock_code.bin'
error: cannot determine image filename for '/home/name/Downloads/Unlock_code.bin'
Click to expand...
Click to collapse
The first error i dont understand but the second sounds interesting.
you are typing this
Code:
sudo fastboot flash /home/name/Downloads/Unlock_code.bin
you should be typing this
Code:
sudo fastboot flash unlocktoken /home/name/Downloads/Unlock_code.bin
you are missing unlocktoken part in the command.
Well Axaj your wise ways have made me a man one step nearer a rooted phone. thank you so much.
all the best.
Ajax1337 said:
The first error i dont understand but the second sounds interesting.
you are typing this
Code:
sudo fastboot flash /home/name/Downloads/Unlock_code.bin
you should be typing this
Code:
sudo fastboot flash unlocktoken /home/name/Downloads/Unlock_code.bin
you are missing unlocktoken part in the command.
Click to expand...
Click to collapse
Thanks, Ajax!
Ajax1337 said:
The first error i dont understand but the second sounds interesting.
you are typing this
Code:
sudo fastboot flash /home/name/Downloads/Unlock_code.bin
you should be typing this
Code:
sudo fastboot flash unlocktoken /home/name/Downloads/Unlock_code.bin
you are missing unlocktoken part in the command.
Click to expand...
Click to collapse
Thank you so much for your clear, concise instructions. I was having the same problems and you got me through! :victory:

[Hack] Skip WiFi setup/ Setup wizard while booting Android for first time.

Hey guys,
We had plenty of sweet surprises for Mi 4i recently, especially considering the Nougat ROMs. This also implies that you'll be busy in flashing a plenty of times.
You should also have noticed by now that when you flash a new ROM, you can't entirely Skip the network connection requirement after the first boot. This annoyed me so much because I have a slow, conservative bandwidth.
Fortunately, I have found a solution; but make no mistake, I'm NOT the author of this solution. This method was originally for Nexus 7 by organophosphate. I'm just extending this amazing trick to Mi 4i.
If you want, you can read the original post.
What do you need?
PC
Your phone
TWRP recovery
ADB on PC
Have them all before proceeding.
Procedure :
1. After installing your ROM through TWRP, mount system partition(Advanced>Mount>check system).
2. Connect your phone to PC via USB. Let the phone be in recovery. All the work is to be done in the same.
3. Launch ADB. Just ensure proper connection by first using adb usb and then adb devices commands. It should then show your phone connected in recovery mode.
4. Now, the important part.
If you want to skip only the WiFi setup part but not the rest of initial setup, execute adb shell sed -i 's/ro.setupwizard.wifi_required=true/ro.setupwizard.wifi_required=false/g' /system/build.prop
If you want to skip entire setup and directly goto home screen, launch Shell by executing adb shell and then execute the command echo "ro.setupwizard.mode=DISABLED" >> /system/build.prop.
5. Reboot your phone, either by using adb reboot (or just reboot in Shell) or using Reboot option in recovery.
6. Now, you should see a Skip button in WiFi setup page or Home screen depending on your choice in step 4.
7. Enjoy/explore your new OS
Few personal notes:
1. Entire procedure should happen while your phone is in recovery mode.
2. Skipping the setup wizard entirely has more working chance(almost every time) than skipping just WiFi setup. Skipping WiFi setup rarely worked for me. So, I'd recommend the former option.
3. Skipping initial setup entirely won't cause any trouble as it just for collecting the very basic information. Those details can be set manually later.
5. This method won't cause any trouble usually. That said, I'm not responsible for bootloops(although I haven't encountered it yet). This is not to discourage you but to let you know of worst case scenario. Should this happen, please refer to original article mentioned earlier.
Credits :
organophosphate for this amazing hack.
I(yourSAS) may/may not deserve credit for extending the method and sharing, depending on your result
or extractt he flashable zip
edit the build.prop
re pack it again and flash?
faizauthar12 said:
or extractt he flashable zip
edit the build.prop
re pack it again and flash?
Click to expand...
Click to collapse
I guess that would work. But it'll be lengthy and tedious.
If devs test and do that before releasing the ROM, this problem will be no more.
faizauthar12 said:
or extractt he flashable zip
edit the build.prop
re pack it again and flash?
Click to expand...
Click to collapse
In that case what lines should I delete/edit ?
elonmusk said:
In that case what lines should I delete/edit ?
Click to expand...
Click to collapse
oopss, we don't need to do this trick anymore
lineage already fix ( patch ) the setup wizard, it will ask a Wi-Fi connection..
so make sure you're an up-to date build
faizauthar12 said:
oopss, we don't need to do this trick anymore
lineage already fix ( patch ) the setup wizard, it will ask a Wi-Fi connection..
so make sure you're an up-to date build
Click to expand...
Click to collapse
Yes! I'm on the latest version.. was just curious..
elonmusk said:
Yes! I'm on the latest version.. was just curious..
Click to expand...
Click to collapse
It is already explained in first post. Those two are basic Linux commands:
- echo - is a simple command line text files editor/creator
Code:
echo "ro.setupwizard.mode=DISABLED" >> /system/build.prop
It mean: append text string "ro.setupwizard.mode=DISABLED" to the end of text file "/system/build.prop" , so if you want to do manually these unpack/repack acrobation, just paste "ro.setupwizard.mode=DISABLED" in build .prop
- sed - is advanced command line text editor, you can change already existing text in text file with your desired, using exact match or regex, etc.
Code:
sed -i 's/ro.setupwizard.wifi_required=true/ro.setupwizard.wifi_required=false/g' /system/build.prop
It mean: Get text file "/system/build.prop" , find in file following text string "ro.setupwizard.wifi_required=true" and change it to "ro.setupwizard.wifi_required=false", so if you want to do manually unpack/repack acrobations, just change true to false in mentioned text string, in build.prop.
Anyway, thanks to @yourSAS for sharing idea
Skip WiFi Setup / Setup Wizard On Fresh Boot
Figured I would leave my notes here as this where google dropped me off...
Yes ro.setupwizard.wifi_required doesn't work as expected most of the time as it was replaced with ro.setupwizard.require_network.
That being said one should be using it to skip WiFi setup:
adb shell sed -i 's/ro.setupwizard.require_network=any/ro.setupwizard.require_network=no/g' /system/build.prop
Click to expand...
Click to collapse
None the less here is a little breakdown of the process with a few suggestions:
1. Boot to TWRP.
2. Mount System partition.
3. Pull current build.prop to see what is currently set.
--- There may be other possible values for these properties.
--- There are many other things one can change from here, google them.
--- Also you may find that once mounted the build.prop resides in /system/system rather.
4. Run commands.
5. Reboot, Profit!
# Pull current build.prop from phone to local folder; see what you currently have.
adb pull /system/build.prop
# Push build.prop back to device.
# You can use this method, just be sure you save your the text file with correct line endings for Linux (no CR only LF).
# Using commands to edit the file rather than a pull/push will ensure things stay the same.
adb push /system.build.prop
# Replace elements in text files (build.prop).
adb shell sed -i 's/FIND.THIS/REPLACE.WITH.THIS/g' /system/build.prop
# Append (add a new line) to text file.
echo "NEW LINE TO ADD" >> /system/build.prop
# Relevant properties
# Set which, or if any network is required
ro.setupwizard.require_network=
any, no, wifi
# Same as above but older property
ro.setupwizard.network_required=
true, false
# Again replaced by above
ro.setupwizard.wifi_required=
true, false
# Control the complete setup process
ro.setupwizard.mode=
OPTIONAL, ENABLED, DISABLED
Click to expand...
Click to collapse

Categories

Resources