[TOOL][LOG] Easy-to-share log and report for developers and users - Other Tools & General Discussion

Hello XDA comunity!
I want to share you a very useful tool that I have created, its name is: "kielyd".
What's keilyd?
Keilyd is a BASH daemon that constantly dumps the system's logs, warnings and other useful info in a easy-to-share "ZIP" with the main purpose to create a very informative and useful bug report.
keilyd is expansible and configurable. It's very easy to add new features because BASH interacts directly with the Linux/BSD commands in the Android System.
How does it works?
Keilyd is launched at device boot, with the "init.d support" and as root (see requeriments below). After launched, keilyd relaunches itself in a "daemon mode", that runs in the background, then, it dumps several information in the /sdcard and compress it in a single zip, so, the user can send that zip (in fact, are 2 zip's or more if you use the "snapshot" feature) to the developer of their ROM, to a forum or send it to a 3rd party developer and report a bug with all the system logs included.
Keilyd stores 2 zips: the first one is the current log (the "very last file") and the second one is the last log before keilyd were launched again.
If you won't enable de daemon, you can create a single zip when you use the "snapshot" feature, if you take two or more snapshots in the same minute, the ZIP will be the same, otherwise, one script per different minute will be created. The Snapshot feature can create as much zips as needed.
What info is collected?
That's a good question!
The info that is collected is (this applies ONLY for a vanilla copy of keilyd):
Kernel log (aka "dmesg") and other kernel info
Logcat (aka "logcat")
List of process running and memory statics
A copy of all tweaks in init.d (including keilyd itself)
A copy of build.prop and sysctl.conf
A copy of /proc/config.gz (if exists)
Some cpuinfo
Mounted filesystems and usage
How does this "daemon" can help me?
Developer:
Have you had the need to get some system log from a user?
Probably the answer is "yes", but, the user may have no idea how to do that, so, you have to give them a "step-by-step" guide of "how to get a system log in the terminal".
This simplifies the process, so, the user can report a bug with logs with no terminal (if the daemon is enabled) or with a single command that looks like
Code:
keilyd --snap
User:
Well, the complement of the developer... You can share "golden" information just by sending 2 zips files to the dev. Minimal Android knowledge is the only prerequisite if the daemon is working as spected.
This daemon is not a demon, but it can be very bad if not implemented as spected. Please, ensure that ALL THE COMMANDS ARE KNOWN and that THERE IS NO PORPRIETARY interference.
Why BASH?
A good idea is to create a daemon in C/C++ and share it as a "binary", BUT, as we are recolecting information from the device, the user must have to be concient of what are the script recollecting, if the user can't read bash, it can ask to a 3rd developer. You can feel safer because it's under the GPLv3 licence!
In addition, BASH run in (almost) any UNIX based OS, including but not limited to Apple OS X, GNU/Linux, Android, iPhone OS, etc...
This prevent a "blind trust" from the user, and give them facility of enable-disable the script, add features and so on.
Requeriments
- A rooted device
- Busybox (or run-parts)
- init.d support
- BASH 4.3.x ONLY SUPPORTED by the moment.
- Terminal emulator/HIDE]
How can I include it in my ROM?
Take a look of my repo in GitHub, it contains the last version of keilyd and the implementation during compilation in the Makefile.
If you are a ROM modder, download the latest version from above, include init.d and bash support in you ROM.
Or you can create a CWM/TWRP/Philz... flashable zip (it would be great!)
Users: how to use
When something goes weird, open the terminal emulator and write:
Code:
keilyd --snap
and send to the developer all zips in
Code:
/sdcard/keilyd/out
type
Code:
keilyd --help
and a helpful message will be printed.
If something goes wrong and you need to reboot the device (or the device reboots itself), just send both zips to the developer or the forum where you are asking help (This feature only works if the daemon is enabled).
Developers: how to use
You can add/remove things in order to fit your needs, the only thing that we ask you is that you write the whole script in BASH, without "blobs" that may private the user from know what is exacly logged and stored.
If some user sends you the zip, you will notice that the files are plain-text, and you can view it in any text editor.
TODO:
List all apps installed (system and user)
Secure "user-modificable" settings (Allmost DONE)
A graphical interface (an app) to manage the daemon
A flashable ZIP
Aports and sugestions are WELLCOME, please, coment in the box below
Install redistributable package:
If the avobe requeriments are meet...
1. Open this GItHub URL
Click in the "Download ZIP" icon in the right.
2. Put the zip in your phone
3. Unzip it.
4. If you want to use the script... A; otherwise, B.
A.
a. Open the terminal emulator.
b. cd to the folder that contains
Code:
install.sh
c. As root, type "
Code:
sh install.sh
" in the terminal.
B.
a. Open ES File Explorer
b. Enable root explorer and mount /system as rw
c. Copy
Code:
daemon/18keily
to
Code:
/etc/init.d
d. Tap and hold the
Code:
18keily
file and open the poperties
e. Change te permisions to
Code:
rwx r-x r-x
f. Copy the
Code:
redistrib/bash
file to
Code:
/system/xbin/bash
g. Change the permisions as above.
h. Symlink /etc/init.d/18keily to /system/xbin/keilyd
i. Reboot
NOTE:
Keilyd can be used in 2 ways:
1. As a daemon that does it job without human interaction, that constatantely and automaticaly creates 2 zips in the output directory.
2. As a Script that only needs to be called with the '--snap' parameter, but it requieres human interaction and does not constantely repeat the process.
Use the first one if you are a beta tester, or if you know that you ROM can hang sudently. Recomended for Unstable ROM'S.
Use the Last One if your ROM is stable or official, but you want to do a bug report.
You can allways use the second option if you use the first one.
By default, the daemon is disabled. You can enable if you change the "ENABLED" variable to "Y". I personally recommend values for "MINS" between 5 and 15.
BUGS REPORTS in the GITHUB REPOSITORY

Reserved

Hi there,
This looks like what I need, did you close the repo? Can you share a link to the script? I have a few devices, and I want to have some forensic information for troubleshooting (I.E. log all the warnings, errors and critical logs, + a snapshot every n minutes about the system usage). Right now I have to go where the device is, connect it with ADB and query the logs (most of the time, the logs were overwrited)... Thanks in advance.

Related

[SCRIPT] Android-Linux Tools v0.2 for Linux [[Suggestions Needed]]

Okay. If this is not where the MODs want this post, please move it.
[UPDATE] - Jump over to Post #12 for some of my recent ideas and changes for this application.
I have been using mods for the G1 and the myTouch 3G for a little while now. I have used Backup for Root, and I use Nandroid. I created just a little simple script to backup your device to your linux-based machine and restore from there too. The concept behind this is having your backup on your computer, not your sd-card. Please, feel free to contribute. (If this is not your cup of tea, please do not leave a comment). I am limited on time, and wanted to contribute a little to the community. All this script is a compilation of adb commands. Anyone could compile these commands, I just wanted it organized and in one place.
README
After using all of the backup tools for root, I have ran into random FCs and bugs. This script uses Android SDK's adb tool and was designed to be simple. This script goes through and backs up your applications, bookmarks, sms, alarm clocks, settings, launcher settings and dictionary. There are plans for this script to be interactive in the future. As for now, it is a very basic script that will backup your device then restore your device.
Notes. As for now this script requires sudo. On every other linux pc tested, sudo was required (maybe because user did not install adb correctly?). This will change in future versions.
= Details =
REQUIREMENTS
1. Android SDK Toolkit 1.5 or higher
2. Bash v4.0.33
3. Root access to your device
4. Root access to your pc
HOWTO
Backing-Up
1. Plug your device in
2. Open command-line (On PC)
3. Run ./abrtool -b
4. Done.
Restoring
1. Reboot from flash of rom (Enter credentials and let phone setup first)
2. Open command-line (on PC)
3. Run ./abrtool -r
4. Restart device
5. Done
Changelog
Version 0.1.5
- Merged into Android-Linux-Tools (alt)
- Changed zenity commands (shows restore progress)
- Option to restart device after restore
- Can install abrtool via command-line (./abrtool --install)
Version 0.1.4
- Added Icons
- Runs Fix Permissions after restoration of applications
Version 0.1.3
- Fixed Restore (Again) - Sets $BACKUPDIR as $PATH
Version 0.1.2
- Restore applications now uses adb install instead of push
Version 0.1.1
- Fixed Restore arugement (-r restores now)
Version 0.1
- Created initial script
- Creates backups for Apps, Sms, Bookmarks, Alarms, Settings, User Dictionary, and Launcher
- Restores device
Download
Project Page for Android-Linux-Tools (ALT) http://code.google.com/p/android-linux-tools
Project Page for abrtool http://code.google.com/p/abrtool
Download abrtool ConvertVideoToAndroid
Download InstallOnAndroid Nautilus Script
InstallOnAndroid
Disclaimer
I am not responsible for anything. Anything at all. I'm just not. Blame someone else if something goes horribly wrong.
[Reserved]
[Reserved for future post]
Nice script but bart.sh can accomplish a full backup of your Android environment for restoration at a later date. While it does it to the SD card initially, these "barts" can easily be copied to any computer. I can, however, see a use for this as it serves a slightly different purpose. Thanks.
I wasn't sure what response I would get to this post. I have had to flash, partition, format, wipe.. enough times that I just wanted to plugin into my computer, backup, wipe-flash then restore. Thanks!
nice. I don't use linux myself, but i see the point of having the backup else where (not an SD card attached to the phone itself).
will this, in theory be made to work on windows? Cause that will be awesome.
@str4vag It would be really simple to just use a .bat file for Windows. I don't have any plans on making a windows script anytime soon. Sorry. Same commands especially though.
This is exactly what I've been looking for, now I just need to mod it to sync apps/bookmarks/etc automatically whenever I plug in my phone, and to only sync the new items to keep it speedy, great work dev!
@ggolemg I can play around with some "real" features soon. I plan on having it archive your backups and allow you to select which backup (default is most recent) you would like to use. I am sure I can play around with your idea too. Thanks.
subscribing to the thread, idea is very interesting. i've been looking for a foolproof way to backup and restore bookmarks, sms messages, and different alarms, without all the issues of backup for root users. gonna check out the script tonight.
Update coming by the end of the week.
- Will only backup apps not already backed up.
- Possibly apply the Python interface I have developed.
- More goodies.
How about switchrom?
Android-Linux-Tools
Okay, so this week has been crazy for me. (Mind you I am a restaurant manager first and a developer (primary web) second). I think I am going to gear this project in a different direction. First off, I have created GTK2 Dialogs and a settings panel for this application. I would like to gear towards general linux tools on the pc side. So over the next two weeks you can expect,
- Graphical Interface for abrtool (Android-Backup-Restore)
- Configuration for each application.
- Nautilus Scripts for all applications.
- Right-Click to Encode Video (With GTK2 Dialog progress)
- Right-Click to Install APK (With GTK2 Dialog progress)
- Right-Click to Sign APK (With GTK2 Dialog progress)
- Right-Click to Copy Files to SD Card
- abrtool will backup to Ubuntu One Cloud (Simple adb pull ~/Ubuntu\ One/? or maybe play with the API?)
Ideas and Possibilities
- User.conf editor
- Select with applications to backup
- Switchrom features?
Any other thoughts or suggestions are welcome. I want to start simple, keep working on the abrtool and then make my way out to some other useful tools for us linux (Ubuntu) users. Let me know what you think and what would be helpful.
i had to make a bynch of edits so this dosent run as root, id recomend everyone do the same, only run root when you must. Also changed ,.adb to adb so i dont have to run it in my android sdk dir
@ahronzombi Can you post those changes?
I am a firm believer of only running root when needed, Like I mentioned before I don't really have a huge amount of time, and when I tested this on a friends notebook adb required root to atleast kill-server then you could perform shell/push/pull.
AFAIK, adb server only requires root if ou haven't set the proper udev rules for the device.
Exactly. If we want this script to run universally we cannot rely on all users to have added the udev rules. If they don't they have to run sudo. Maybe a quick check for the udev file then sudo if not?
boulderjams said:
Exactly. If we want this script to run universally we cannot rely on all users to have added the udev rules. If they don't they have to run sudo. Maybe a quick check for the udev file then sudo if not?
Click to expand...
Click to collapse
no i think it would be wise to have people understand there udev permissions rather than run root so its universal. that kind of thinking leads to very big security problems. with root in the script most of the simplest linux users could exploit anyone
I fully understand that. Do you mind posting your changes to the script?
this is the secure version of the script that dosent run as root
keep in mind i set my own adb and home directorys so you'll have to change those
Code:
#! /bin/bash
# abrtool version 0.1
# Last Updated Wednesday, November 18, 2009
# Android Backup Data and Restore Data Script
#TODO
# 1- See if config file exists
# 2- If not, create config file (for now, select directory to backup to)
# 3- See if arguments are specified
# 4- If not, return an error via dialog
# 5- If argument -b exists, run backup
# 6- If argument -r exsists, run restore
export PATH=${PATH}:/home/ahron/android/android-sdk-linux/tools:/home/ahron/android/abr
BACKUPDIR=/home/ahron/android/backups
USER=${username-`whoami`}
backupscript() {
export PATH=$PATH:$BACKUPDIR
adb kill-server
adb pull /system/sd/app $BACKUPDIR/apps
adb pull /system/app $BACKUPDIR/apps/device
echo "---------- Backed Applications"
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db $BACKUPDIR/msgs/mmssms.db
echo "---------- Backed Text Messages"
adb pull /data/data/com.android.browser/databases/browser.db $BACKUPDIR/bookmarks/browser.db
echo "---------- Backed Bookmarks"
adb pull /data/data/com.android.alarmclock/databases/alarms.db $BACKUPDIR/other/alarms.db
adb pull /data/data/com.google.android.providers.settings/databases/googlesettings.db $BACKUPDIR/other/googlesettings.db
adb pull /data/data/com.android.launcher/databases/launcher.db $BACKUPDIR/other/launcher.db
adb pull /data/data/com.android.providers.userdictionary/databases/user_dict.db $BACKUPDIR/other/user_dict.db
echo "---------- Backed Other Settings"
chown -R $USER $BACKUPDIR
zenity --info --text "Successfully Backed-up to $BACKUPDIR"
}
restorescript() {
export PATH=$PATH:$BACKUPDIR
adb kill-server
#sudo adb push $BACKUPDIR/apps /system/sd/app
echo "----------- Installing Applications"
cd $BACKUPDIR/apps
for searchfile in ./*.apk
do
echo "------------ Processing $searchfile"
sudo adb install "$searchfile"
done
echo "---------- Restored Applications"
adb shell su
adb shell fix_permissions
echo "---------- Fixed Application Permissions"
adb push $BACKUPDIR/msgs/mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db
echo "---------- Restored Messages"
adb push $BACKUPDIR/bookmarks/browser.db /data/data/com.android.browser/databases/browser.db
echo "---------- Restored Bookmarks"
echo "---------- (Please, make sure to restart your browser)"
adb push $BACKUPDIR/other/alarms.db /data/data/com.android.alarmclock/databases/alarms.db
adb push $BACKUPDIR/other/googlesettings.db /data/data/com.google.android.providers.settings/databases/googlesettings.db
adb push $BACKUPDIR/other/launcher.db adb pull /data/data/com.android.launcher/databases/launcher.db
adb push $BACKUPDIR/other/user_dict.db /data/data/com.android.providers.userdictionary/databases/user_dict.db
echo "---------- Restored Other Settings"
zenity --info --text "Successfully Restored Android device from $BACKUPDIR"
}
if [ "$#" -eq 0 ]
then
echo "Usage $0"
echo " -b Backup"
echo " -r Restore"
exit $E_OPTERR
fi
set -- `getopt "br:" "[email protected]"`
while [ ! -z "$1" ]
do
case "$1" in
-b) backupscript;;
-r) restorescript;;
esac
shift
done

GUIDES & FAQs [Android]: ADB Workshop by Adrynalyne and Guide by Captainkrtek

DO NOT POST IN THIS THREAD BEFORE READING THE WHOLE POST
PLEASE ADD GUIDES TO COMMON ISSUES YOURSELVES
To my recollection, the previous WM Guides thread was successful.. so we'll be moving on to android as well - from beginner to pro.
I hope this thread will provide answers to a decent percentage of your questions.
Please hold until guide collecting is finished..
In the meanwhile you are ALL invited to send me links or full guides to add to this thread.. remember, we are all about sharing.
COMING SOON! (in the meanwhile, you've got a great battery life guide at http://forum.xda-developers.com/showthread.php?t=471521 - be sure to thank BruceElliot for it!)
also, if you decide to post a guide, please keep the guide as neat as possible, with a title containing the LEVEL ([BEGINNER], [INTERMEDIATE], [PRO]) and the commonly searched words so that people who look for it can find it easily. (if you can, use the same color (dark orange) and same size (4) and Bold.. for the main title.. tho that's not a must )
post #2. [BEGINNERS+INTERMEDIATE] Replacing System Files using Android Commander
post #3. [EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
post #4. [QUICK FAQ's] Common QnA's for beginners by Timmymarsh (work in progress)
[BEGINNERS] Replacing system files using Android Commander
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
[EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
This following guide was rewritten by Captainkrtek, please make sure to thank him for it
Original Post:
(http://forum.xda-developers.com/showthread.php?t=879701)
This workshop was held in #android-learning on irc.freenode.net by XDA Member Adrynalyne. All credit to him for this guide, I simply am taking it and turning it into a guide. Here we go!
You can find the raw IRC log here
Good evening folks, and welcome to my ADB workshop. This is by no means a full explanation on the subject, but more of a crash course to help folks get up to speed, and get more from their devices. There may be some things you already know here, so please be patient and respect those who do not.
Reference Files
http://adrynalyne.us/files/How to install adb.pdf
http://adrynalyne.us/files/Using ADB.pdf
So, lets just start with the basics.
What is ADB?
ADB stands for the android debugging bridge and is used for testing and debugging purposes by developers.
However, we like to get more out of our devices, and its a great way to fix things.
Knowing adb can mean the difference between a paperweight and a working phone.
So, to start with, we will look at installing ADB.
Generally speaking, the Sun/Oracle JDK is required to run all SDK functions.
ADB is but one tool in the SDK arsenal.
So, we begin by downloading and installing the JDK. This can be found here:
https://cds.sun.com/is-bin/[email protected]_Developer
Choose your OS, download and install. I recommend that 64 bit users use the regular x86/32 bit version as well.
Moving ahead, we download the Windows sdk from here:
http://dl.google.com/android/installer_r08-windows.exe
Due to already installing JDK, you won't be stopped by the install process.
Now, if you notice, I installed it to:
C:\android-sdk-windows
I did this because it makes things easier when setting up path variables.
I encourage everyone to do the same, but obviously it is not required.
So, this SDK is handy, but is only good up to 2.2. We want the latest and greatest! (Well I do)
So, we navigate to:
C:\android-sdk-windows\
and we run SDK Manager.exe
If you notice in your PDF file for installing adb, you will notice that you can update, and I made a choice not to include earlier sdk versions.
I won't go into full detail on that, but depending on the version of SDK you have, 8 or 9, it WILL make a difference in using adb.
By default, for version 8 adb.exe resides in C:\android-sdk-windows\tools
By default, for version 9 adb.exe resides in C:\android-sdk-windows\platform-tools
We will assume version 9 in this guide
Really, the SDK is installed and adb is usable right now, but in my humble opinion, its not enough
I like the ability to use adb in ANY directory on my machine.
To do this, we edit Windows's environment variables.
Specifically, the system path.
To do this, we click on start, or the orb (depending on OS), and right click on Computer, left clicking on properties in the menu.
If its windows XP, I believe it brings you into advanced system properties immediatly. Vista and 7 need a second step.
On the left hand side, as you notice I have highlighted in the pdf, left click advanced system settings.
Under advanced tab, we left click environment variables...
There are two boxes here.
We are concerned with system variables, however.
So we scroll down the list and highlight path and click edit.
Ignoring all the extra stuff in here, make sure you are at the end of the line, and type
Code:
;C:\android-sdk-windows\platform-tools
The semicolon allows us to separate it
from the previous path statement.
Click ok all the way out.
We now have ADB setup globally. We can use cmd.exe (I use powershell) and no matter what directory we are in, adb is recognized.
If it is not, make certain you entered the path into system variables, and made no typos.
If you installed to a different location, you will need to adjust the path accordingly.
This concludes the section on installing the Android SDK to use ADB.
This next section will be on using ADB, so please open that pdf now.
Now, this applies to any OS, not just Windows.
Well, with the exception of the USB drivers.
I will not go too much into that, but if you take a look at the PDF, it goes through installing usb drivers for the sdk, and how to download them.
Fiarly straightforward, in that rspect.
Now, to setup our phones to use with the SDK and ADB, we must change some settings.
First, we go to menu softkey, then settings.
We scroll down to Applications and tap it.
Under Development, we will check Enable USB Debugging. Please note the SGS phones are different in this respect.
The USB cable must be unplugged before enabling or disabling this setting.
Once this is done, we are now ready to play with adb
One quick note: If you get device not found/conencted, please reboot your phone. DJ05 has a quirk in it where ADBD randomly crashes on boot.
A reboot will fix this
ADBD= ADB Daemon
Ok, continuing on.
Lets look at installing applications. This is also known as sideloading.
Unlike installing from the SD card, it does not require unknown sources to be enabled.
The command for this is
Code:
adb install packagename
This assumes that you are working from the directory where the file is located.
This will install the application to /data/app.
It will also show sometimes useful errors if install fails.
That is not something you will see from the Android GUI.
Now, a lot of us have probably deleted files with apps like Root Explorer. While this isn't really a bad thing, it leaves behind databases and data for the application removed.
This is where the 0kb applicaiton entries come from.
If you take that application entry name, you can uninstall the extra data via adb.
First we go to the adb shell which logs into the phone.
Code:
adb shell
If we end up with a $, we will want admin rights, in many cases. This is not one of them, I don't beleive.
To get admin rights, you want to type
Code:
su
Look at your phone if this is the first time, it may prompt you to allow access. Else you will get permission denied.
If you are not rooted, this will not work either.
Ok, now that we are logged in, we will type
Code:
pm uninstall packagename
where packagename is the name of the 0kb listing.
Now this seems like a pain in the a** and I agree.
HOWEVER
There will be a time where Manage applications crashes when you try to uninstall it from the phone. In this case, a factory reset, or this method is the only effective way to fix the problem.
Moving on.
How many of us have removed system applications or renamed them? Did you know that you can simply disable them from the system?
Code:
adb shell
su
pm disable appllicationname
This will disable it, and the system will ignore it.
This can be seen as safer than deleting or renaming things, but your mileage may vary.
On the other hand, you can also re-enable these applications.
Code:
adb shell
su
pm enable applicationname
Please note: Not all applications will properly re-enable. I believe a factory reset or reinstall of said application will fix the issue.
Also, application names are absolutely case sensitive.
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Ok, a lot of us tweak and mod our phones and turning off the device to get to clockwork recovery, or battery pulls, or multiple button holds to get into Download mode are troublesome and annoying at best.
ADB can help us here.
Here, we do not need to be logged into the shell
If we want to merely reboot the phone:
Code:
adb reboot
If we want to go to recovery (works well with voodoo5)
Code:
adb reboot recovery
If we want to go to Download Mode because we need Odin, heaven forbid:
Code:
adb reboot download
Its instant. No waiting on animations or anything else.
Its also handy if Android has locked up, but yet still works in adb.
I for one hate taking my case off to battery pull.
So now we move on to pushing and pulling files.
Sometimes, I don't feel like mounting my sd card to copy a file over to my phone.
I can use this command to push a file straight to my sd card:
Code:
adb push filename /pathtodirectoryonphone
So for instance, if I have test.txt that I want to send, I would type:
Code:
adb push test.txt /sdcard/
and there it goes.
Ok moving on
Pushing files can be done to any directory, however, some are protected.
For instance, /system is going to give you a permission denied or a read only filesystem error.
To get around this, the easiest thing to do is push the file to your sdcard, then log into the shell:
Code:
adb shell
Code:
su
We will then mount the system as writable
Code:
mount -o rw,remount /dev/block/stl9 /system
Then we can use something like
Code:
cp /sdcard/test.txt /system/app/test.txt
cp stands for copy
and it requires the path of the file and destination path. The name of the file is optional
When you copy it, you can rename it to whatever you like.
For instance, if we wanted to backup a file
Code:
cp /sdcard/test.txt /sdcard/backuptest.txt
Now, lets assume you do not have busybox installed.
You non rooted users will not.
Then you must use a slightly more complicated command called dd
This is used like this:
Code:
dd if=/sdcard/test.txt of=/system/app/test.txt
if is for inputfile
of= output file
Not every user friendly, but probably one of the safer copy commands.
Ok, moving on to pulling files.
Lets say you want to get a file from your phone, to modify, backup, etc.
To do this, we simply use adb in this manner:
Code:
adb pull /pathtofile/filename destinationname
For instance, if I wanted to backup ADW launcher in system/app
I would do this
Code:
adb pull /system/app/ADWLaucnher.apk ADWLauncher.apk
And it will pull the file from the phone and put it in the current directory.
Like above, you can specifcy where it goes.
pushing files to the sdcard, it seems prudent to talk about changing permissions.
sdcards are typically fat32, which destroys permisisons, and Android is heavily permission based.
So if you push an application to your sd card, then try to copy it to /system/app/ bad things are going to happen, or the app may not even show up.
So in that case, we use something called chmod.
This is used in this manner
Code:
adb shell
su
chmod 755 /pathtoapplication/applicationname
Keep in mind
you dont want to do this while its still on your sd card.
an example
Code:
adb shell
su
chmod 755 /system/app/ADWLauncher.apk
755 is good for applications and script files.
Just a couple more topics to cover.
Lets go over deleting files.
This becomes especially handy for removing rogue applications.
To do this, we must be in the adb shell.
Code:
adb shell
su
rm /system/app/ADWLauncher.apk
You may need to remount system as writable with:
Code:
mount -o rw,remount /dev/block/stl9 /system
That applies when using chmod as well.
So what I did above was delete ADW Launcher from system/app
However, what if I wanted to delete the entire contents of a directory?
Same thing as before, except
Code:
adb shell
rm -f /data/dalvik-cache/*.*
I just cleared my dalvik-cache with that command
very quick, very effective.
If you just tried that, please reboot your phone now
Ok....this leaves us with the final topic: logcat
logcat allows us to log what the OS is doing, and possibly delve information for when things are not working
its quite simple Reading it is another.
To use logcat
Code:
adb shell
logcat
To logcat to a certain file do
Code:
adb shell
logcat > /sdcard/logcat.txt
Now we let the log settle down to a reasonable amount of data coming in and not a wall of scrolling, then start the app in question. When it gives an error, we hit ctrl-C and kill the adb shell session.
This should have captured enough data to see the error. Now, I prepared an example. A user came to me on IRC, and Google Maps was force closing. Clearing data didnt fix it, Clearing dalvik-cache, and fix permissions did not fix it. In this case, the user did not know how to use adb So I had him grab an app called alogcat from the market and email me the log. This is also a very valid method.
this file explains what the problem was, and highlights what to look for as an example.
http://adrynalyne.us/files/logcat.pdf
___________________________________________________________________
This concludes the guide from Adrynalyne, there will be more workshops such as this one in irc.freenode.net #android-learning.
Thanks to everyone in #samsung-fascinate !
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Android control other device with IOIO Board.
It use ADB.
http://androidcontrol.blogspot.com/2011/10/ioio-board-for-android-control-io.html
timmymarsh said:
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Click to expand...
Click to collapse
Thank you for your patience and taking the time to answer those questions. I loved your simple and easily digestible format.
There is a note
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Click to expand...
Click to collapse
this note is all wrong..
1. linNUX is not *NIX.
2. Mac OS-X is a *NIX OS, it is based upon UNIX, they use their own variant called Darwin. Darwin does not require capitolization.
3. The word should be POSIX. Linux is POSIX compliant and POSIX defines the capitolization standardards
soft brick
Taioba said:
Is there any way to use ADB even though I can not enable USB debugging by the android?
I have an Atrix with soft-brick. How can I restore a file (framework-res.apk) knowing that my USB debugging is off?
I can enable ADB via fastboot?
Thanks!
Click to expand...
Click to collapse
I found this for atrix 4g....
http://forum.xda-developers.com/showthread.php?t=965546
hope it helps
knoknot said:
i have a bricked s2 not so sure how to go about reviving it via adb
Click to expand...
Click to collapse
check this thread
http://forum.xda-developers.com/showthread.php?t=1237815
thanks. searched for that
Thanks for it.
Great Guys............ :good:
Thanks for sharing.
Thanks for sharing this guild :d, i am new member for reccod
Great job~ Sometimes could be used this.
I'm using Windows 10 RTM and I've set the path, yet I still get the "unrecognized application" error in the command console. What am I missing?
Nevermind, a restart fixed it. Used to be you didn't have to.... sheesh.
nir36 said:
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
Click to expand...
Click to collapse
Thanks, this Guide is very informative
Help with LG D722
I'm using LG D722 phone and I somehow unlocked bootloader and installed twrp recovery. I backed up Lollipop that's what I'm using and i want to restore custom ROM
I know I need to install Google Apps after installing Custom ROM. But Do I also need to install Modem files on my device ? Because I can't find them on XDA Forums. Please give me a link or something. The help is not just appreciated but seriously needed.
Success. Thanks
Hello, I walk testing one recovery but I'm booting before flashing, the question is, will the recovery feel same when booted vs flashed? I've booted and used to flash a pair of zips but felt very laggy and bugged although did the work right. Thanks
Edit: solved, tried myself
Sent from my SHIELD Tablet K1 using XDA-Developers mobile app
http://forum.xda-developers.com/showthread.php?t=872128&page=2

[Tutorial] How to build a perfect ROM [Updated 02/12/11]

This is to educate all the wannabe Devs', How to build a perfect ROM.
There will be tutorials from all over. Respective credits will be added.
Everyone's Invited
Know the Basics
Without knowing what you are getting yourself into will only make things worse even before you start off. To build a good Rom is different and to atleast build a fully functional Rom is different. So make sure you are fully aware of the technical fundamentals of building a Rom to enough extent so that you are able to fix the bugs and know what and where can things go wrong and how to solve them.
Performance, Memory, Stability and Battery
These are the four defining points which decide the pros and cons of the Rom that you develop. The Rom should be Fast, Have enough storage and program memory, should be stable and have a good battery backup. Trying to get a good balance of all these is very important. So make sure you keep all these things in mind while developing your Rom.
Be Patient and Polite
Building a good/perfect or bug free Rom wont come immediately. It’ll take many releases, experiments, testing and knowledge till you reach a nearly perfect Rom. So be patient as it sometimes takes weeks or sometimes months. Dealing with the public is not an easy job. You’ll find all sort of people of various characters. The can be nice as well as rude, but do remember that their critics are the only way you can improve. All they want from you is a good Rom, just keep this in mind and ignore the negatives.
Make it User Friendly
There are many ways in which you can make your Rom user friendly. Integrating useful apps. Prepping Eye candy themes, Important shortcuts etc.
Stay Motivated
This is the only driving force behind every Rom developer to continue doing their work with ease and success. Stay motivated and alert so that you can deliver the best with every release. Its hard sometimes but its it important.
Give Time to your Work
Most of the developers are either students or work some where and building Roms is some what like a hobby for us. Its correct that we are not supposed to spend all the time on building Roms but if we want to have a good working Rom we should manage considerable amount of time for few alternate days to work on this project.
Make it Different
You Rom characteristics should be some what different from what is already been provided by other developers. If its nothing different and Catchy then it’ll be hard to get users trying your Rom consistently. I still remember the days when i used to try alot of different Roms but still couldn’t find one that was nearly perfecting my needs. I tried alot of Roms that time.
Join Hands with another Developer
This is what i like the most. Join hands and team up with other developers and thus improve the efficiency and effectiveness of your Rom. The mind of two can bring together wonders. You can even team up with Developers of other devices and build a Rom for device that you personally do not own but you you widen your work area.
Don’t be ignorant
Make sure you are attentive and up to date with all what is discussed about your Rom, all bugs, all tests, reports, etc. so that you do not miss out on any bug possibly to be fixed for next release. If you ignore or avoid fixing the important bugs, the users will think that you are not really capable of solving them or not really interested in this Rom.
Get Testers
Testers are users who like to test the Rom and report you the bugs before you go public with the release. They are very helpful if you like to avoid the criticism after the release of the Rom as before itself you’ll be able to get rid of maximum number of Bugs and issues present in the Rom. That is where testers come in handy. Jus give a notice and many would love to try and test your Beta releases.
Keep Detailed Changelogs
Changelogs keep track of your developments over the time. They come in handy when ever you need to check for prolonged bugs. For example you may not notice it but if someone reports that he has been having an issue since your 3rd Rom release, then you can check out what all changes you made on that release and cross check whether one of those changes cause that bug.
Be Active on the Rom Page
This is the most important part of being interactive with the users cause there is alot that they want to be done in your Rom. Talk to them, answer their questions and discuss the pros and cons of the Roms with them. You can learn alot from them. Being active to the discussion will make them feel that you are eager to further develop and make this Rom improve further.
Add only Useful apps and Regularly Update them
Make sure the application you add to your Rom are useful by the people. Adding two Music Players in the Rom is not a good choice. Choose one that is best and use that only. But make sure you add one possibly best Application for all needs of the users. Keep track of all the applications that you have included in your Rom and make sure the latest versions are included. It keep the user feel updated with your Rom. Many times there are applications which are important to add but have some bug. Later these bugs are fixed in their next releases, so even you should add those updated fixed Applications. Use only Genuine Licenses and No Warez Applications. Warez is like a virus to the development of your Rom. Copyright issues and illegal use of cracked applications make pose a ban on you Roms by the Blogs and threads where you list them. Either you use development licenses to use the in your Roms or use an equally good free Application.
Good looking User Interface and Graphics
This is the major aspect that defines your Rom and makes it distinct from others. Work on that graphics that can be changed in your Rom, try different themes and skin enhancements in different aspects of os like dialer, lockscreen, fonts etc.
Keep Polls and ask Questions
Polls and asking questions from users is a very important way by which you can interact with users and get their feedback. Polls can be asking them about their preferences. Which applications they like or dislike, asking frequents questions on that changes you will be making in the Rom cause at the end of the day it is them who will be using them.
Learn from Competition
I don’t call the fellow developers a competition and usually many share their work and are supportive like i am to each other’s work. But you can learn from what is included in their Rom and if its catchy and important then you can add it to your Rom aswel. There might be many new and useful applications and features that other developers might be using and you are not even aware of that. It can be very helpful in evolving your Rom completely.
Listen and Learn from Users
Listening what a user has to say about their experiences on using your Rom is very important. They might have something very important to share from their experiences which you can incorporate in your Rom. It really helps in fixing bugs and improving your Rom further.
In the end you are the Decision Maker
Its you who has to take the decisions in the end. There will be many people wanting you to do this or that and add this or remove that but in the end you have to keep an unbiased judgment on all the requests, ideas and suggestions and bring forward the changes that you feel the masses are going to appreciate. And for that you will need to take care of all the above mentioned points in mind.
Give Credits
Not to forget that 70%-80% of your work is inspired from that of other developers. And it wonk charge you anything to be humbly give credit or some appreciation to the help you have got from other developers in terms of guides, tips, tricks, applications, UI Enhancements, etc. It just shows your character as a person as well.
[What is it?]
What are Stock Roms and Custom Roms?
What is a Rom?
ROM – Read Only Memory is that memory which stores the system files of your Device. Those files which make up the basic Operating System, be is Windows Mobile Phone OS, Android, Symbian, Windows OS, etc. Every electronic device has a Read only Memory which stores the basic programming of the functions that the Electronic equipment is to perform. ROM in terms of our Android Devices the basic set of programming applications and files of functions which your device performs Out of the Box. Without a Rom no electronic device exists.
What are Stock ROMs?
Those ROMs which come pre installed are called Stock ROMs. Stock ROMs are the ones that come Box packed with your Device preinstalled. These are official Software that are provided by the Manufacturer or the OEM.
Is it possible to Edit/Customize/Alter Stock ROMs?
Yes it is. For a lot of Operating Systems be it Windows Mobile Phone OS, Android, Symbian, etc, it is possible to Customize these stock ROMs and install them to our devices.
What are Custom ROMs?
They are Custom ROMs are based on Stock ROMs but customized by the user in terms of additions in applications, improvements, removal of unnecessary application, etc. A customized ROM may be an minor improvement to Stock Rom or can even be a complete makeover of Stock Rom even changing the drivers of the Rom with that of other compatible devices providing better performance.
Why do we need Custom Rom?
Customization is making things personal. That is one main reason why we customize a Stock Rom. A stock Rom no matter what will have a lot of unnecessary applications, files, images, settings that are pre set by the Manufactures but are not at all important to us and uses a lot of space for no reason. No matter what there has to be one or the other Bug in a Stock Rom. To get rid of these issues we customize a stock ROM by either adding useful applications, settings, removed crap, fixing bugs and on getting a Top Notch easy to use and completely customized Device.
What about the warranty?
This is decision that you need to make personally. Yes, Custom ROMs will take away your precious warranty. But that to only if your device stops working while you are using Custom Rom on your device and you have to take it to the company. If you want you can revert back to Stock ROMs and then take your device to the Service Center and they won’t even know about it. But you need to consider reverting back to Original Stock Rom.
su
Also referred to as substitute user - a command for changing the account in the current terminal (usually black screen with blinking cursor). Default account is root account. So if you insert into terminal 'su' and hit enter, you will become root user.
root
Root alias superuser or poweruser is special user account for system administration. Similar to windows having its administrator account, unix-like systems have a root account. With this, you can do anything and if you run a command to delete the whole system, unix will just do it! No asking, no confirming. So, watch your steps!
rooting
Rooting is just enabling power of root for applications and other purposes.
Superuser app
After rooting is done, you will see a new app called superuser in app drawer. This app can delegate applications to use su (root) feature. When an app asks this from first use, a popup window will appear asking if the application should be allowed to use root permission.
sh, bash
is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. So simply, it is some interface, which can execute command(s), which you have entered. Many shells exist, but in scope of android you can (as far as I know) use only sh (standard - Bourne-shell) or bash (compiled in BusyBox or separately on XDA). Both are basically same, but bash has much more features and it is more comfortable.
user/root shell
How do I know if I'm root or normal user? It's simple. Root's shell is ended with # (usually it's shell looks like "bash-3.2# _") and user's ends with $ (usually bash-3.2$ _). In terminal emulator you also can have only [path]($|#) (for root for example "/etc # _")
BusyBox
also called "The Swiss Army Knife of Embedded Linux" is a tool which brings into Android basic tools known from unix system, but is much more smaller than standard tools is. But this "packing" has limited functions in comparison to standard tools in unix-system (missing special modes of tool, color output and so on). Many application use this. For example busybox grep (filtering of text) is needed for application called Market enabler.
BusyBox commands
list of commands is really wide, so it's not possible explain all, so I pickup only top few. (hint: if you want what some command do, just search on google for "man <command_name>" for example man mv or enter command here
cd - change directory - same like in windows. You can switch directory. example: cd /sdcard
ls - list of files in actual directory (have few switches like for example: ls -l /sdcard/*.png (detailed listing)
cat - print file into standard output (like more in windows) Example: cat /sdcard/data.txt
vi - editing of file. But on limited phone keyboard (no keyboard) it is little harder Read more about vi
cp - copy of one or more file. Example: cp /sdcard/bike.jpg /sdcard/media/bike-wallpaper.jpg
mv - moving/rename files, Example: mv /sdcard/bike.jpg /sdcard/media/renamed-moved-bike.jpg
rm - delete file (rm -R for recursive, or for delete whole folder), Example: rm -R /sdcard/wallpaper-bad/*
find - search for files, Example find / -name "best-chopper-ever.avi"
mkdir - make directory - creates directory, Example: mkdir mynewdir
chmod - changes access of files
less - similar like cat, but you can scroll in it and it doesn't produce any output. Example: less /sdcard/funnytext.txt
For BusyBox's tool help, just enter BusyBox <command_name> -h.
ADB (shell)
ADB - Android Debug Bridge is a versatile tool that lets you manage the state of an emulator instance or Android-powered device. It is a client-server program that includes three components:
* A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
* A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
* A daemon, which runs as a background process on each emulator or device instance.
Generally, it can be compared with standard cmd prompt in windows (you can write commands which will be executed locally, for example in Terminal Emulator) or it can be just like SSH in unix-like system (you connect to terminal through adb client (in Android SDK) and commands will be run remotely.
Android SDK
Android software development kit is a complex set of tools for developing apps on Android. It includes a fully usable emulator of Android OS on your PC, where you can do everything. You can install/delete apps, browse web page in embedded web browser, play games or make your own application in Eclipse (widely used IDE for development). Of course, with emulator you can use also GPS or camera.
Android SDK tools
* Fully emulated Android device
* Android Development Tools Plugin (Eclipse IDE)
* Android Virtual Devices (AVDs)
* Hierarchy Viewer
* layoutopt
* Draw 9-patch
* Dalvik Debug Monitor Service (ddms)
* Android Debug Bridge (adb)
* Android Asset Packaging Tool (aapt)
* Android Interface Description Language (aidl)
* sqlite3
* Traceview
* mksdcard
* dx
* UI/Application Exerciser Monkey
* monkeyrunner
* Android
* zipalign
Tools for work with Android adb shell
You have two ways to connect into ADB service - locally and remotely.
Locally - for local access you will need some application which can connect to local adb shell.
Terminal Emulator (free) - probably most commonly used app from market, which works and looks like standard unix shell.
ConnectBot (free) - same as Terminal Emulator, but it can be also used for connecting via SSH or telnet
Remotely- For remote connection you need phone configuration adjustment:
Home desktop -> [menu button] -> Settings -> Applications -> Development -> USB debugging [ON].
Also you need connect your phone via USB (or finds on market some widget/app, witch enable using ADB also via wi-fi)
adb tool from Android SDK
After downloading Android SDK, extract the archive anywhere (in example I extracted it in c:/AndroidSDK). Then follow instructions on developer.android.com for installation of SDK Platform-tools (contains adb). After installation click on start menu and in Run... (in Windows7 in search bar) enter 'cmd' and press Ok or [enter]. Then write in cmd line:
Quote:
cd c:\AndroidSDK\android-sdk-windows\tools [enter]
now you can enter following command to connect to phone's adb shell if you don't have more connected device (virtual or real-one)
Quote:
adb shell
If you have more then one, you need explicitly say which one should be used for connection. So list connected devices with
Quote:
adb devices
which shows you serial number of connected devices. Than use
Quote:
adb -s <serial-number> shell
3. Custom recovery
* What is custom recovery
* Tools which custom recovery provide - NAND backup/restore, formatting of SDcard, partitioning (ext1,ext2, ext3), wiping, flashing of Custom ROM, ...
* Is it safe to install? - potential problems, backup/restore of original recovery
* How this whole thing works - installation description (not how-to install, just explanation of what is done during installation)
What is custom recovery
Recovery is an image (binary data) stored in internal memory. This image contains something like a "program" or "tool", which can boot-up independently from the Android system. This tool is part of phone system, and in PC terminology recovery can by compared to BIOS with some added features. This recovery state can be reached on all phones, but if you don't have a custom recovery, it will do a so-called HW reset and automatically restart itself into standard boot mode.
Tools which custom recovery provides
* USB-MS Toggle :mounts sdcard as mass storage
It just mounts your phone as USB-mass storage (USB disk) so you can access it through your PC
* Backup/Restore:
Absolutely GREAT feature. With NAND you can copy an image of your actual system (phone's memory). It means that you can backup the whole system with all configuration, customization, wallpapers, system's tweaks... just everything. This image will be written to your SD card which you are then free to copy around and back up on your computer
* Flash Zip From Sdcard
This tool is designed for installation of custom ROMs or tweaks. If you are instructed to install via custom recovery, then you should use this menu. Never unzip the file because it contains meta-information about itself with some validate-checks so if you edit it, or unpack and pack back, it won't work. And remember to place the file in the root (main folder) of your sdcard.
* Wipe Menu:
Wipe data/factory reset: wipes data & cache
- wipes user data (contacts, apps, configuration, ...) and cache (caches of applications)
Wipe cache
- wipes cache only
Wipe Dalvik cache : Wipes Dalvik cache in all possible locations if moved by apps2sd
- wipes Dalvik cache
Wipe SD:ext : Wipes Apps2sd ext partition
- if you used Partition SDcard option, you can wipe it here
Wipe Battery Stats (remember to fully charge your phone before doing this)
- If you think, that your battery life is too short, you can try delete battery stats. Than let phone fully charge. (more)
Wipe rotate settings
- wipe sensor settings (acceleration, ...)
Wipe .android secure : Wipes froyo native .android_secure on sdcard
- wipe information about moved apps
* Partition Sdcard:
Partition SD: Partitions sdcard for apps2sd (this formats card so all data will be lost)
- will create ext2 partition (you will be asked for size of ext2 and cache)
Repair Sd:ext
SD:ext2 to ext3 : converts apps2sd ext2 partition to ext3 (requires kernel support for ext3)
SD:ext3 to ext4 : same as above but ext3 to ext4 (requires kernel support for ext4)
ext2 - file system for the Linux kernel (no journal, fast but not recovery of I/O error)
ext3 - file system for the Linux kernel (journal, slower than ext2 because of journal, but provides recovery on I/O error)
ext4 - file system for the Linux kernel (journal, enhanced version of ext3)
* Mounts:
Gui automatically mounts folders
png-optimized -
png files takes less memory, are loads faster
JIT -
just-in-time compilation also known as dynamic translation, is a method to improve the runtime performance of computer programs, but it takes some time to convert into it on start.
HW:acceleration -
using of HW acceleration for rendering GUI. Increases battery consumption.
VM.Heap Size -
maximum memory an application can consume
stagefright -
In Android 2.2 new media framework that supports local file playback and HTTP progressive streaming
:: How To's ::
Samsung Galaxy 3 (I5801/I5800) Flashing Guide
Before these steps make sure you have latest version of kies installed, it helps in keeping latest drivers installed.
Files required for Flashing can be downloaded here.
1) Start Odin (if using windows 7 or vista right click Odin and use run as administrator)2) Check "One Package" checkbox3) Check “Reboot” checkbox4) Check protect ops checkbox (Don’t check this if you are flashing I5801 with I5800 firmware for the first time.)5) Check reset time checkbox, keep the default value as it is i.e. 300 don’t select any other options.6) Hit reset files button once.7) Click ops button and select OPS file for I5800*8) Click one package and select the firmware you want to flash. The file must a .tar file.9) You can take a backup of your data/apps. For that you can use Titanium Backup. For backing up contacts and SMS.A) go to contacts press menu/left most button select import/export option, then export the contacts to sdcard.B) For sms use the app called SMS backup.10) Now remove your sdcard and sim card from phone and do a factory reset/ Hard Reset also clear cache then restart and put it in downloading mode by pressing vol- + home + power button together.11) Now connect your phone to pc.12) Odin will show yellow color and com port no. in the first box on top in Odin.13) Click Start and watch the progress bar and timer, wait until PASS message appear on Message box.14) Disconnect the phone from PC when Odin displays disconnect serial port & wait until rebooting phone.
Let the phone boot it takes some time 5-10 mins for first boot so don’t panic.
After reboot do factory reset or Hard Reset also clear cache again then restart phone and put sim and sdcard back in.
Sorry cant post images right now in office, will attach images as soon as i get home.
Please let me know if i have missed anything or if anything needs correction.
ATENTION I5801 USERS:to keep the i5801 bootscreen you should remove boot.bin and sbl.bin from the .tar file before flashing.
Deodex
Advantages or disadvantages
- Odexed ROMs are slightly faster, deodexed ROMs are slightly slower
+ You can make custom themes for your ROM
+ Performance los is negligible.
Requirements:
Download XUltimate
Busybox installed
Root
1. Connect phone to computer
2. Start xUltimate, we will now get the required files from our phone to deodex and zipalign it which we will describe in the 3rd step.
3. On the main menu of xUltimate, choose option 5 (Pull and deodex all). Everything will be done for you here. Don't worry. You will see all your finished files in the folders 'done_app' and 'done_frame' which are located in the installation directory of xUltimate.
4. move folders 'done_app' and 'done_frame' folders to your sdcard, you can find these folders in the directory of xUltimate as described in the previous step.
5. Make sure the sdcard is not mounted to pc anymore
6. Open Windows Command Prompt and type the following commands.
adb shell
su
stop
mount -o remount,rw /dev/block/stl12 /system
rm /system/app/*.odex
rm /system/framework/*.odex
busybox cp /sdcard/done_app/* /system/app/
busybox cp /sdcard/done_frame/* /system/framework/
chmod 644 /system/app/*
chmod 644 /system/framework/*
mount -o remount,ro /dev/block/stl12 /system
sync
reboot recovery
7. Now data and cache reset in the recovery menu...
8. reboot
If one of the commands, for example 'cp' is not found, try putting busybox in front of the command:
eg: busybox cp /sdcard/done_frame/* /system/framework/
SRY, but please not again a tutorial. We already have two. I accept your work, but please don't make an another thread for something, that we already have.
lol, again?
Pauri said:
SRY, but please not again a tutorial. We already have two. I accept your work, but please don't make an another thread for something, that we already have.
Click to expand...
Click to collapse
Dude! This is different from others.
Just wait and see!
OK, I will see^^
@sekhargreen Very nice
kyrillos13 said:
@sekhargreen Very nice
Click to expand...
Click to collapse
hi
+1 here
lets appreciate his hard work look at the amount of info he has give and the time it would have taken to give the same if u are a rom developer this might not be a great thing as u already learn t all this the hard way
but looking at it from the eyes of noobs(or when u were a noob rom developer) who has many questions before they start cooking a rom i would say this is a good place to start as it has many of the answers
i would also say if this goes well this would not just be another tute but one with enough info for the noob rom devloper to start as he would have all his questions answers by reading this one
good job done pls keep up the good work
Note : this has been added to the roll up thread
Gonna throw myself out there and say I kinda fall under this category. I still have a lot to learn so thank you for this. It will most likely improve me.
The Dark Lestat said:
Gonna throw myself out there and say I kinda fall under this category. I still have a lot to learn so thank you for this. It will most likely improve me.
Click to expand...
Click to collapse
Hi Lestat,
Please contribute to this thread, if you have time.
It will help all the Devs in XDA forum.
Thanks dude for wonderful tutorial. It will be really helpful.
InDroid 4.0 (Build 6)
helpful to all..
Tutorials updated
Tutorials updated. Please First page.
can you add this to pocketdroid i think its very useful tutorial..
pflorin said:
can you add this to pocketdroid i think its very useful tutorial..
Click to expand...
Click to collapse
Sure, added. Just check it out!
Very good now i can see that it's different. Thank you for the wonderful tutorial.
Sent from my GT-I5800 using XDA App
Pauri said:
Very good now i can see that it's different. Thank you for the wonderful tutorial.
Sent from my GT-I5800 using XDA App
Click to expand...
Click to collapse
Thanks for you appreciation. Encouragement from people like you will boost my energy!!
Hello...firstly like to thank you for these tutorials...they are a gr8 help for everyone...
i would like to request you that if u can cover some kernel basics also then it would be great...

BootBuddy - Run Boot Scripts from SDcard (a safe alternative to init.d)

INTRODUCTION:
Boot Buddy will allow you to run Linux shell scripts when your Android device is booting up. It will run your scripts early in the boot process, before the home screen appears.
The intended audience is generally intermediate to advanced users, and those who want to play with shell scripting on their device.
FEATURES:
BootBuddy is similar to init.d scripts, but with a core difference that it stores boot scripts on your SDcard instead of the internal system. This allows for several interesting enhancements. Feature listing-
Much more Safe than init.d. If you have a script that is malfunctioning, just boot with the sdcard out, and put the sdcard back in after your device reaches home screen. Your device is Saved, No Problem!
Boot Buddy is designed from the start to run scripts right from your SDcard. Just download any scripts to your boot_buddy_scripts directory and they're ready to run. (No more screwing around with permissions and files in your /system/etc/init.d/*)
SDcard storage allows you to copy a script to another device, or multiple devices easily.
Boot Buddy's author has several years of scripting and programming experience. It is streamlined, fast, and doesn't perform worthless functions like repeatedly logging the authors name and time (*hint to a t-init author*).
Clear goals of making operation simple, intuitive, and clean.
If you're currently using an "init.d" solution, BootBuddy can integrate seamlessly with it.
If you try BootBuddy and you don't like it, the installer also works as an uninstaller for easy clean removal.
BootBuddy is Open Source GNU GPL. Open for anyone to modify and improve upon.
As a developer, I make software to operate the way I would want if I were an end user, because I actually do use it, and I am an end user like you.
REQUIREMENTS:
Android 4.0 and up
Rooted device
An sdcard
Script Manager Free (or any other app that can run scripts as root)
Boot Buddy Installer bb_install.sh
INSTALL:
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
The script will run quickly. It will automatically detect your sdcard location and create a folder on your sdcard named "boot_buddy_scripts". In that folder, you put the scripts you want to run at system boot. A log file will be kept at /data/boot_buddy.log
If you need your scripts to run in order, they are ordered by filename using the busybox "sort" program. They will run in alphabetical order using this format 0-9A-Za-z.
YOUR FIRST SCRIPTS: (OPTIONAL)
Here are a couple example scripts you may use.
The Android /system is normally mounted with read-only permissions by default. We will change that with the first script listed below. It will cause /system to be remounted to read-write permissions during boot.
The second script will create a file at every boot named /mnt/sdcard/sys_mount_info.txt. That txt file will give us information about how /system is currently mounted.
Download the file 00rw_system.sh into your boot_buddy_scripts folder.
Download the file 99sys_mount_info.sh into your boot_buddy_scripts folder.
Reboot your phone.
That's it, you just installed 2 new scripts and had them run at boot. It's Really just that simple to add startup scripts to your system.
To verify they are running, use any text viewer to open the file /mnt/sdcard/sys_mount_info.txt. It may show more than one line of text. There should be a line similar to this:
/dev/block/(device specific text) /system (fstype) rw,(more text)
The rw means that /system was successfully remounted as read-write during boot.
At any time you can delete either script if you choose. Easy!
UNINSTALL:
If for any reason you find you don't want or don't like Boot Buddy, you can cleanly uninstall it using the installer bb_install.sh. These instructions are almost identical to installing. (All match the installation steps, except step 4)
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
Type --uninstall in the text area labeled Arguments.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
Boot Buddy will be uninstalled. It will not remove the contents of your boot_buddy_scripts folder. If you have an "init.d" system installed, it will cleanly remove only Boot Buddy parts and leave the rest.
MUST READ
ADVANCED NOTES:
Boot Buddy will Not cause harm to your system, but it may not work on custom roms. Also, it may fail to detect the real location of your SDcard. It requires that /system/etc/install-recovery.sh is run during the boot process, and that file will be created if it does not exist. Also the file /data/boot_buddy.sh will be created. The script /system/etc/install-recovery.sh will run /data/boot_buddy.sh. The script /data/boot_buddy.sh will run the scripts on your sdcard. The file /data/boot_buddy.log will log any script output.
For Windows and Mac users- If you download the installer to your pc first, do not edit the installer with a text editor. Your computer will add hidden markers at the ends of each line that will prevent the installer from running. If you want to edit it, you should do so on a Linux pc or directly on your Android device.
Tell us about your results!!!
BootBuddy source code: http://github.com/Sepero/bootbuddy
NOTE : I AM NOT A DEVELOPER I AM ONLY SHARING THIS. So Try On Your Own Risk. I Can't Help Anything.
Credits :
[email protected]
Script mgr says I'm not root, despite me in a root terminal elsewhere. wtf ?? ...
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.
I give you 5 stars to the thread
Almost first!!! haha.... this is awesome dude this could be HUGE.
Steve Eligoyo said:
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.
Click to expand...
Click to collapse
You must to select root when start on script mgr, you have skull head with crossed bones
Steps to complete failure: Page 96 ?? ...
Here are the steps I've taken to get kicked in the teeth:
Boot phone > menu > script mgr. > start > scroll to file (in this case bb _install.sh ) > open file > tick su ( tried boot and bgr several times, nada amigo ) as instructions state > run > unexpected oper error: your not root > rinse and repeat sixty times > open terminal > su > Works just fine > Post my question on xda in the WTF Thread
Update:
After creating the directories and files needed to make this train wreck into a working setup, (obviously a few are missing here, working on it), I reopened script mgr and browsed the file system, which shows bb _install.sh file (and the other two in this
Thread as well) with the green su skull and crossbones with the boot dot next to those skulls, yet the apps shell /console says oper error - Your not root.
Again, I open terminal, su > enter > Viola!, I'm root.
I've installed the sdcard v. of script mgr as well and I get a message stating /data/system/xbin does not exist.
I'll likely need to tweak the script mgr settings to /sdcard 0/externalsd /directory bind /system /xbin/bb _install.sh - something like that.
Still doesn't explain why the app is putting the brakes on root terminal in the nag screen.
Any ideas ??
MAN THANK YOU !!!! as a noob i couldn´t get init.d to work right. so i tried your script on the xperia z3c with stock 4.4.4
to make it compatible with z3c you need to edit the file /data/boot-buddy.sh after the installation
and replace both
/boot_buddy_scripts/
with
/storage/emulated/legacy/boot_buddy_scripts/
or
/storage/sdcard1/boot_buddy_scripts/
or another prefered location
then make a new folder boot_buddy_scripts in the location.
really it executes the scripts way before the apps are starting , this is so nice and will be on my phones from now on !
edit: i also now changed the log file creation to the sd card for quick access (most filebrowsers open there by default)..
the logfile is major awesome btw if something didn´t go right , its easy to debug , thanx alot again
Won't install says I don't have busybox. I have it but it has to go in system bin instead of xbin. Amy way to get this working?

[How To][Linux] Optware + ssh + samba + transmission + flexget

Yep, you read that correctly. I have optware, ssh, samba, transmission, and flexget working on my Minix X5 Mini. This should work for any rooted device which has an adb connection enabled. This will work on the original ROM. In fact, I use the stock ROM. For those not using a Minix device this should work on any ARM device. Sorry but all the binaries are built on ARM.
JUST AS EVERY OTHER DEVELOPER: I AM NOT RESPONSIBLE IF YOU BRICK YOUR DEVICE! MAKE A BACKUP!
Requirements:
Linux box with adb (don't ask me about windows, I don't support bad habits)
clockworkmod (for a backup)
root
internet connection
Process:
Make a backup of your ROM!
Download files (gitHub)
You have two options here:
Download the zip via https://github.com/erichlf/AndroidSeedBox/archive/master.zip and unzip it.
Clone the repo using git via 'git clone [email protected]:erichlf/AndroidSeedBox.git'
Make script executable
chmod +x optware-etc.sh
Obtain adb connection to device (covered in another thread)
Gain root access on local machine (adb seemed to require this for things to work)
sudo su
Run script and follow directions
./optware-etc.sh
Use SManager to run /opt/home/root/sysinit at every restart.
Notes:
The script can be modified to change the various programs that I install. You could exchange transmission for deluge for example.
Transmission can be accessed from the minix through localhost:9091 or from some other machine using your ip-address and the port 9091. If that doesn't work you should edit the config file located at /opt/home/root/.config/transmission-daemon/settings.json
username: root
password: you provided this in the install script
Without SManager nothing will start automatically. However, if you have a ROM which has init.d support you can move the scripts in /opt/etc/init.d to /etc/init.d I would suggest maybe linking the two instead of just moving the scripts or possibly adding a script to /etc/init.d which runs the items in /opt/etc/init.d The reason is because when installing things using ipkg the startup scripts will be placed in /opt/etc/init.d and not /etc/init.d However, it is extremely important that optware is started, and this is partly what sysinit accomplishes.
To list available packages
ipkg list
To install a new package use the command
ipkg install <new package>
To remove a package use the command
ipkg remove <package to remove>
cron is weird and I couldn't get it to work like it should, but I got it to work
While on the Android device (ssh or terminal emulator)
Create a .crond file in the home directory of your device (/opt/home/root/) with some schedule in it. Remember to leave a blank line at the end of the file.
Tell cron about the .crond file
crontab -u root /opt/home/root/.crond
Make sure cron sees the cron file
crontab -l
If you want to edit your cronfile use a text editor and edit the file directly and then tell cron about the file again.
Many things are installed in what seem like strange places, so use
which <binary you are looking for>
Feel free to help develop the code. I think what would be best is an update.zip or a CWM flashable zip. Right now I don't know how to do this, but once I get more time I will look into it. So, any help on this front is welcomed.
Enjoy!
I really wish you would have kept the repo up. It seems kind of pointless to go through all that trouble just to delete the repo and leave people wondering what you did.
I have been busy and didn't update this particular post, since there had been no activity on it.
git clone [email protected]:erichlf/androidseedbox.git
https://bitbucket.org/erichlf/androidseedbox/get/master.zip
Sorry, I didn't need to be rude. I was just excited to find this and then sad when it was gone. Thanks for pointing me in the right direction!

Categories

Resources