Learn to logcat like a Pro! - Android General

adb logcat bootcamp
I'm going to be teaching the basics of logcats. I sat for a few hours a while back and hammered all this stuff out with ckisgen from XDA/ACS holding my hand the whole way, so this is good info here. I see lots of posts about issues people have and no logcats accompanying them. A good logcat is fried gold to a dev troubleshooting a problem. I did the whole thing in Ubuntu (Linux) and have listed the Window$ $pecific desktop pathing below the Linux command. UNIVERSAL COMMANDS LINUX COMMANDS WINDOWS COMMANDS.
When I say Terminal, I mean Command Prompt for you Window$ u$er$ (start-run-cmd)
In terminal with your phone plugged into the computer
A Logcat:
Code:
[COLOR=#ff0000][FONT=Arial][SIZE=3]adb logcat[/SIZE][/FONT][/COLOR]
This doesn't START logcat, this tells terminal to grab the information already on the device logcat and display it in terminal. This isn't so useful to us. It just scrolls the information in terminal and you can read it there. This is kinda difficult to read though, for one it's constantly scrolling as your phone does things and two, it's likely that your terminal is configured to only allow a certain number of lines to be kept readable before they drop off.
Pipe it to Desktop as a .txt file
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat > ~/Desktop/logcat.txt [/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
This command above will tell the logcat to export the terminal logcat to a .txt file on your desktop called logcat.txt The '>' symbol tells the logcat to pipe to the location listed. This will continue to update even if you open the text file, so long as you have terminal running. It's not done “live” though, you have to either refresh the file, or close it then re-open it. That won't affect anything other than giving you an update. Now we're getting somewhere, but where?
Code:
[COLOR=#ff0000][FONT=Arial][SIZE=3]adb logcat > /sdcard/logcat.txt[/SIZE][/FONT][/COLOR]
If using Terminal Emulator on your phone instead of a computer setup, this (above) is the code you'd want to use. It will save the logcat.txt to the root of your SD card. Next!
-v long, or not to -v long, that is the question!
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat -v long > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat -v long > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
Now we're telling the logcat to do something more interesting. We are telling it to give us every scrap of information it has. This will space the logcat out nice and pretty and really make things easier to read as well, even giving time stamps of when everything happened! Now you can say “it happened at about 9:30 pm” and we can find that. Winning!
Sometimes you want to filter down the information though. You want to make the dev's life easier. Here is how:
First, a brief on Tags and Priorities.
Tags are going to be what process is actually giving the information, for example 'ActivityManager', 'Database', and 'WindowsManager' are all Tags you can find. There are TONS of these suckers! Research into what your problem is and try to pick out the tag.
Priorities are different. These will tell you how serious the issue at hand is. The priorities are called by their letter code and are:
V Verbose
D Debug
I Info
W Warning
E Error
F Fatal
S Silent (suppress all output)
These are in ascending order. In other words, Verbose or V is going to be the micro information which doesn't really mean much to anyone 99.99% of the time where as Fatal or F is going to be a huge catastrophic issue. When filtering for a Priority it will include the Priority you give PLUS all HIGHER Priorities. So, for example, if you call to filter for Warning or W then it will give you Warning, Error, and Fatal. That is common to filter for. Below are some examples of code:
( PS - you would never actually type or input ‘{‘ or ‘}’ in your logcat commands .. they are in some of the examples below to show you that these are generic modifiers … meaning - if you were actually inputting the command you would replace the {Tag} with an actual Tag, like: ActivityManager or GTalkService .. in the same way you would replace {Priority} with an actual Priority, such as: W or E )
Examples
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat {Tag}:{Priority} *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat {Tag}:{Priority} *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
The above line is if you know exactly what Tag (GTalkService or ActivityManager) and Priority (W or E) you are looking for.
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat *:{Priority} *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat *:{Priority} *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
The above line is if you don't know the Tag, but know the Priority. The * is a wild card that basically means all/any. An example of a VERY valuable logcat could be:
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat *:W *:S > ~/Desktop/logcatALLwarnings.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat *:W *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
So, the command above would give you all tags that had a priority of Warning, Error, or Fatal. It would silence (not show) everything else and would pipe the output of your log to your desktop as a text file named logcatALLwarnings.txt … moving along …
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat {Tag}:V *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat {Tag}:V *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
The above line is if you know the Tag but want to see all Priorities. {Tag}:V outputs all priorities for the specific Tag you’ve entered because it calls for the V (Verbose) priority, which is the very lowest priority … and as you recall, it always gives you the priority you’ve asked for AND above.
The *:S tells the logcat to Silence (or ignore) all lines/messages that have not otherwise been specifically called for using these filter expressions. This CAN cause issues though, sometimes it will silence what you're looking for / everything.
A final specific example from my phone to be clear. I got a Database Tag with an Info Priority, if I wanted to see all instances of this happening, I could use the following code:
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat Database:I *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat Database:I *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
Or, if I had an ActivityManager Warning I could use
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat ActivityManager:W *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat ActivityManager:W *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
Ok, now we're going to the show! You know the tools, but how do I use them? Glad you asked!
For the first time you boot a ROM/Kernel bundled together (IE InsomMIUI 1.12.2) or for just a kernel you're going to do the following:
Once you're finished full wiping and installing the ROM, but haven't rebooted the phone yet. (Or wiping just the caches for a separate Kernel):
Open Terminal on your computer
enter the following code
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat -v long > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR][COLOR=#0000ff]
[/COLOR][COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat -v long > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
​
Name the logcat something useful. A good format is to use you're initials, rom name, what it is, and date. This way it stands out. So the code with the really long but helpful file name would be:
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat -v long > ~/Desktop/JH_InsomMIUI1122_firstboot_5Dect11.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat -v long > %userprofile%\desktop\JH_InsomMIUI1122_firstboot_5Dect11.txt[/SIZE][/FONT][/COLOR]
Yes, I know that's a long name, but we look at dozens of these things, it helps!
In recovery tell it to reboot the phone. The logcat will start recording internally on your device at boot automatically.
Once the phone is at the lockscreen let it sit for 5 minutes.
Unlock the phone and let it sit for about 10 seconds.
Restart the phone.
Once you restart the phone open the logcat file on your desktop to make sure it’s not blank/empty/something went wrong and if everything’s golden - send to your favorite developer (ME! ).
FYI , the -v option sets the output format. -v long after the logcat command formats the log so that it adds a date and time stamp to each line. It also separates each line with a blank line .. making the log as a whole much easier to look through.
That's it, you should be off to the races with these logcats. I hope this has helped!

Wow this is great I hope People make use of this.

Glad you like it
this has been a message from the dead pool.

Im still very much a noob and dont like posting unless necessary but would like to help when I can. Is there a way to do this on a mac?

It should be really similar to linux. You'll have to have the sdk installed and running which I don't know how to do on mac but the commands should be similar. Let me look into it.
this has been a message from the dead pool.

hy,
Realy nice tutorial.
Can you make a tutorial to how to use logcat from terminal emulator from phone?

Nice info. thanks

Good post m8
One minor criticism, not just of this post but many "How to's" on this forum.
A clear description of what a logcat is and how it maybe useful would go a long way to help educate the inexperienced.
I only say this as i have non techy friends who constantly complain about this issue.
They go looking for info to sort their own issues out and are confronted with jargon on jargon on jargon ..... with no 'Plain English explanation"
We should all try to remember not everyone possesses the same tech knowledge, and we all where N00bs once we only ascended to being the godlike superusers we are due to others making knowledge clearly available to us.
Th idea that "if you don't understand then this isn't for you" is pretty narrow and arrogant.

When I run logcat on my phone, using the command
Code:
adb logcat -v long > /sdcard/logcat.txt
the next line display is
Code:
- waiting for device -
and then does nothing. What am I doing wrong?

Adb doesn't see your devices. Do you have debugging turned on in settings? If you do try:
Code:
adb devices
If you don't see anything you don't have debugging turned on or you don't have the drivers installed for your devices. Or it isn't plugged in.

PrinceFX said:
When I run logcat on my phone, using the command
Code:
adb logcat -v long > /sdcard/logcat.txt
the next line display is
Code:
- waiting for device -
and then does nothing. What am I doing wrong?
Click to expand...
Click to collapse
Seems I need to fix it. For doing this on the phone you should enter 'su' to gain superuser than type "logcat..." and whatever. It reads logcat directly, not through adb. Sorry about missing your reply earlier. Hope this helps.
Sent from my HTC Glacier using Tapatalk 2

Nice write up Thanks .

Thanks
This is a really nice post...
XDA is gr8...
greg

Thanks for the article. I also like using the '-t' switch to grab the last n log entries (e.g., 'adb logcat -t 100 -v time'). Also, if you need a bit more compact log output, using the 'time' format works nicely.

This is a great article. I have learnt a lot. Could you take time to add a description about the various switches like -f, or -t etc that can be used with logcat. It's really very difficult for me to understand those switches...plzz Will be really helpful for others as well.

The-Droidster said:
This is a great article. I have learnt a lot. Could you take time to add a description about the various switches like -f, or -t etc that can be used with logcat. It's really very difficult for me to understand those switches...plzz Will be really helpful for others as well.
Click to expand...
Click to collapse
Code:
[email protected]:/ $ logcat --help
Usage: logcat [options] [filterspecs]
options include:
-s Set default filter to silent.
Like specifying filterspec '*:s'
-f <filename> Log to file. Default to stdout
-r [<kbytes>] Rotate log every kbytes. (16 if unspecified). Requires -f
-n <count> Sets max number of rotated logs to <count>, default 4
-v <format> Sets the log print format, where <format> is one of:
brief process tag thread raw time threadtime long
-c clear (flush) the entire log and exit
-d dump the log and then exit (don't block)
-t <count> print only the most recent <count> lines (implies -d)
-g get the size of the log's ring buffer and exit
-b <buffer> Request alternate ring buffer, 'main', 'system', 'radio'
or 'events'. Multiple -b parameters are allowed and the
results are interleaved. The default is -b main -b system.
-B output the log in binary
-C colored output
filterspecs are a series of
<tag>[:priority]
where <tag> is a log component tag (or * for all) and priority is:
V Verbose
D Debug
I Info
W Warn
E Error
F Fatal
S Silent (supress all output)
'*' means '*:d' and <tag> by itself means <tag>:v
If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS.
If no filterspec is found, filter defaults to '*:I'
If not specified with -v, format is set from ANDROID_PRINTF_LOG
or defaults to "brief"
The help output is pretty clear. '-f' allows you to save log in file. '-t' specifies how many lines for logcat to print (counting backward from present).
example:
logcat -v time -t 100 -f /sdcard/logtest1.txt
This prints last 100 lines in 'time' format to file logtest1.txt
Play with it and have fun.

Good stuff in here, going to logcat some JB roms now!

Thanx......That was really informative.

lanternslight456 said:
Seems I need to fix it. For doing this on the phone you should enter 'su' to gain superuser than type "logcat..." and whatever. It reads logcat directly, not through adb. Sorry about missing your reply earlier. Hope this helps.
Sent from my HTC Glacier using Tapatalk 2
Click to expand...
Click to collapse
Same thing happens to me
I've have checked my settings, and I can't see anything "wrong"
I've also tried different apps, like alogcat but they don't show anything either.

I don't have to 'su' on SGS2/I777 with CM9 ROM. Works for me from ADB or in phone shell.
It probably depends on the ROM you are running and permissions set.

Related

Sending calls to running GUI apps via CLI

This is /sort/ of a development question; if the mods feel it's more properly in Q&A, please move it.
First off, a little disclosure; "IANAP".
Okay, here goes:
Currently I am trying to create what ought to be a /very/ simple script using "am" (as in; am start -a blahblah -n blahblah/.blah ) in order to invoke an activity for a specific application. Unfortunately, apparently the activity can only be called viably from //within// the application.
The app in question is "redditisfun" ( http://github.com/talklittle/reddit-is-fun ). The activity in question is ".InboxActivity". So far, I can get the first bit of code to pull up the app, but the second bit fails out due to lack of permission.
1)
Code:
am start -a android.intent.activity.MAIN -n com.andrewshu.android.redditdonation/.RedditIsFun
2)
Code:
am start -a android.intent.activity.MAIN -n com.andrewshu.android.redditdonation/.InboxActivity
I've tried it with "broadcast" rather than "start" -- that throws no errors, but simply does nothing. (logcat shows no activity that I can see.)
So here's my question; how does one send a system call to an app that is already running, using am? I am afraid that none of the documentation I've yet found says anything at all about this.

Terminal/Script/ADB Cheat Sheet

I made this for my own reference and would like some experienced users to critique it (please don't laugh) and help me add to it. This is a first draft replacing the "napkin" I've got tucked under my keyboard. Specifically simple for newbes like myself to just help us get started with Terminal, Scripting, ADB and have a command reference to follow.
Please chim in on the ADB section which I know needs some serious help. I have almost no experience with ADB but seek to learn and document more so its useful. Or if something already exists like this but way better please point me to it so I can take from it or use it to replace this.
Thanks in advance!
Edit1: Redline1, change to:
chmod octal...10 columns: 1 Type, 9 Permissions
Nice start.
Some comments from top to bottom:
You don't need semicolons after each line. Only if you want to write more than one command on the same line - e.g. "if some condition; then".
For the directory commands (cd, mkdir, ...), you can type directories with leading "/" if you want to specify the complete path starting from root, and without leading "/" to refer to subdirectories of the current directory. ".." is the parent directory of the current directory.
"which" scans your $PATH for the command you give it, so especially if it exists multiple times it shows you "which" will get run if you type it without specifying a path. It has nothing to do with directories.
The permission groups are usually called "u=user", "g=group" and "o=other" (not "everyone else)". And "s---------" is a socket, not a binary - the rest is correct. Read all you wanted to know about the output of ls and much more here: http://www.gnu.org/software/coreuti...ion-is-listed.html#What-information-is-listed
You confused "logwrapper" with "logcat". You use "logcat" to display the log and "logwrapper" to redirect the output of something in your script to logcat.
"sh script.sh" will execute a script even if it doesn't have the "executable" permission set. Use chmod 7xx to make it executable directly without "sh".
"adb command" doesn't exist - to run a single command, you need to say "adb shell xxx".
"adb fastboot" also doesn't exist, at least on my adb.
Some general tips:
Many or all commands in busybox have built-in help if you invoke them with "--help". Also adb shows a small manual if you invoke it without parameters.
You can use most basic reference material for Linux, e.g. guides about shell scripting. It's 95% the same on Android.
Always be very careful when running commands as root - the system assumes you know what you are doing. There is no safety net. For example, "rm -rf" will happily wipe your entire device (if mounted writable) if you add a space between the following "/" and the rest of the path.
Thanks oodels for the feedback and corrections. I will update and rev the document based on this feedback when I get the time.
Also thanks for always being the one who takes the time to reply in detail to my threads, give me guidance, and inspire me to learn more about the discussion topic while NEVER making me feel like I have asked a dumb question or am the newbe I am. I had a college professor that reminds me of you who told me the only dumb question I could ask was the one I didn't ask. I appreciate that more than I can express. You are a plethora of knowledge and a master instructor with a winning humble and tackful approach to education and inspiration; a rare gem.
_that said:
Always be very careful when running commands as root - the system assumes you know what you are doing. There is no safety net. For example, "rm -rf" will happily wipe your entire device (if mounted writable) if you add a space between the following "/" and the rest of the path.
Click to expand...
Click to collapse
Thanks for _that tip. Knowing this now I think I will remove that example from the newbe guide as someone could easily mistype it, add a space after /, and wipe their device from the root down. I will also add the -i option to the command(s) that are dangerous, requiring user intervention (permission) to proceed with the command as a newbe safety factor.

TeamCody Discussion thread!

Team Cody!
Member List (in no particular order):
@thewisenerd
@omerjerk
@#Superuser
@dhrumangajjar
@navinn
@xaak
@Agaphetos
WANTED
- Testers - to beat the hell out of our ROMs
- Graphic Designers - boot logos, wallpapers, banners(one or two people)
- Themers - theme EVERYTHING!!!
- Co-Dev(s) - Do i really know what I'm doing most of the time (the answer to that is "probably not")
- Moral Support - LOL
- Suggestions - anything you got - Lay It On Meh!!
our works:
MiniCM9
CodyROM
CM9 Build #15
Evervolv
AOKP
OmniROM
AOSPA-legacy
note to self: add all the works, links
find a thread tagged [TeamCody], that's ours
Team-
@thewisenerd
@omerjerk
@#Superuser
@dhrumangajjar
@navinn
Source- https://www.github.com/CodyROM/
Blog- http://www.codyrom.wordpress.com/
Yea, we need support and suggestions!
todo list:
generalise this
First, finish the work on "reverse mounter"; as it is *technically speaking* easy (for me, to write scripts, that do things); and is pretty straight forward (no aimless edits or so)
fix gps in omni
fix video recording in omni
udpate twrp
switch to wlan0 in omni
random trolling lol
@thewisenerd
we should fix the date bug in notif bar..
is that xml derps..??
navinn said:
@thewisenerd
we should fix the date bug in notif bar..
is that xml derps..??
Click to expand...
Click to collapse
No, its a java derp
Compiling CM11/Kitkat for pico!
I assume you have knowledge of building with source, even if not, I don't really care (for there are a lot of guides).
First, get *all* the required packages installed. As for what I mean by *all*, is not really a question for me to answer. I used <insert-random-guide-from-xda> here, and the source.android.com's guide on initializing, just to be sure.
As for java, I use openjdk. *most* sources today support openjdk, elseways, either, you could force it to be compatible by removing just ONE line in build/core/main.mk
So, that's the packages part.
As for syncing sources, as most guides say, you DON'T need to use a ~/system folder or anything. You can use a folder, anywhere.
Just open up a shell, wherever you want to get the sources synced, and type in the following commands.
I assume you have the repo tool installed. IMHO, you should really create a "bin" folder in your homefolder (short linked as "~/") using the following commands:
Code:
mkdir -p ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Then, open up your ~/.bashrc file, using Geany (a better alternative to Gedit, perhaps ), using the command:
Code:
geany ~/.bashrc
Just insert this line, randomly (preferrably at the end of the file).
Code:
PATH=$PATH:/home/<insert-your-username>/bin
Now, for syncing sources. Make sure you are a directory above working folder.
Code:
mkdir -p <insert-ROM-name>
cd <insert-ROM-name>
Now, that you are inside the working folder, take your pick about the ROM that you are going to compile. This tutorial is for CM11, so i'd be running the following command.
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
Yes, you can reference this from a cm10.2 source that you've already downloaded, and this will reduce the size required to download. Why, you could even reference this from an ICS source (just saying, not meant to be even tried).
If you aren't really building for mac, I'd suggest that you don't download the darwin repos.
Short way that I use:
Run following command in working folder.
Code:
mkdir -p .repo/local_manifests
grep "darwin" .repo/manifests/default.xml > .repo/local_manifests/local_manifest.xml
Open up local_manifest.xml using
Code:
geany .repo/local_manifests/local_manifest.xml
Add these lines on top:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
and the following line at end.
Code:
</manifest>
Now open up "search and replace" dialog box.
Search for:
Code:
<project
and replace with:
Code:
<remove-project
Voila, you've removed all the unnecessary darwin repos.
Now, for repo syncing.
I'd seriously suggest that if you live in parts of the world where the internet speeds are less than 1 m'b'ps (~128 k'B'ps (worst case, mine's around 60 k'B'ps, and I've known people with speeds ranging 30 k'B'ps), you'd sync just one repo at a time (the -jx).
run:
Code:
repo sync -j1
Else, if you have a super fast internet connection, please don't brag. Use a higher number, preferably 3, or 4.
Now, sync these repos, while I attend my classes. I'd return back and write part 2.
edit: part 2; go here: http://forum.xda-developers.com/showpost.php?p=49349691&postcount=8
Compiling CM11/Kitkat for pico! PART 2
reserved
Also, yes, you could use this localmanifest here: https://github.com/PicoKat/local_manifest/blob/dev/local_manifest.xml
but, you'd miss out the learning process
Anyways, this post would take up part 2 of the tutorial.
This is purely device specific. and, there's already a guide on android development section (of this device), the reason why I didn't make a new thread.
part 2 begins here:
Ok, so, you'd synced the repos?
Now, as opposed to roomservice, I'd prefer manually cloning the device tree, kernel, and vendors.
Clone a device tree (galaxyfreak's, or mine), into /device/htc/pico.
Clone the kernel sources from here: https://github.com/PicoKat/android_kernel_htc_pico
Clone the vendor tree from here: https://github.com/PicoKat/android_vendor_htc_pico
(note: if you are using my device tree, that has ION, you'd have to use my vendor tree, with updated blobs here: https://github.com/vineethraj49/android_vendor_htc_pico)
Ok, so that part's setup.
Now, lets move on to cherry-picking, and/or patching some stuff (from legaCyMod).
Note: you could have just added these to local_manifest too...
android_build:
Hopefully, you should know how to add remotes, and working with them, if not, click on the show content, below (as a sample for android_build):
Code:
git remote add legacymod git://github.com/legaCyMod/android_build.git
git fetch legacymod cm-11.0
git cherry-pick <commit-id>
where commit id's the looong "number" following /commit/ in the URL.
1. always rebuild build.prop
2. bringing back squisher
3. Removing TTS data
4. Revert adding auditd
5. add kitkat sdk versions
6. Revert "add drawables for all densities" (seriously, this saves space.)
7. adding support for our recovery
frameworks/av:
1. enable meta mode for video msm7x27a
2.bring back support for legacy omx
3. support legacy qcom audio variant
vendor/cm:
1. bring back squisher
2. revert adb authentication (yea, screw adb while dev'ving
3. remove ze bloats
Next, clone media-legacy to hardware/qcom/media-legacy, and display-legacy to hardware/qcom/display-legacy.
waait!!!!
You need to do some patches in some files. required to fix up camera.
patch two files, manually, making some sense out of this:
frameworks/base: https://github.com/szezso/vivo_cm11_patches/blob/d819363fe7d181e73841d3fa35c1b8c0c7d7c046/frameworks_base.patch
frameworks/av: https://github.com/szezso/vivo_cm11_patches/blob/2f1c87f4453c1c7c88e3c7d2b011994f894fe669/frameworks_av.patch
The next step:
Get prebuilts, seriously.
Code:
cd vendor/cm
./get-prebuilts
Then, "cd" back to root of source dir.
Run the following commands:
Code:
. build/envsetup.sh
brunch pico -j4
Hopefully, you should see an output package by the end of <insert-time-directly-propotional-to-crappiness-of-computer>
For batch-resizing bootanimation (in linux):
resizing part:
Code:
for file in *.png; do convert $file -resize 320x320! $file; done
you'd know which part to edit
for zip'ing part:
Code:
zip -r -y -q -0 bootanimation.zip *
will edit this later
Using CCahe
Now something very important who gonna compile ROMs, use CCache. It'll spped up the building process.
CCache - Compiler cache
How to use?
> Open a Terminal(Ctrl+Alt+T)
>
Code:
gedit /.bashrc
[You can use any alternative to gedit )
> Add the following lines to it:
Code:
export USE_CCACHE=1
export CCACHE_DIR=/[COLOR="Red"]source[/COLOR]/prebuilts/misc/linux-x86/ccache
Source here is the folder in which you have the code downloaded.
>
Code:
cd source
>
Code:
prebuilts/misc/linux-x86/ccache/ccache -M [COLOR="red"]25G[/COLOR]
25G = 25 GB of space to be used as CCache. You can use any value in this.
How does ccache work ?
Well , in short , what it does is that for C and C++ programs it caches the output. One it detects that the program is getting repeated it directly sends out the output and thus reduces the time of compilation.
After using ccache you will really feel the difference in the compilation speeds of your ROMs and kernels. //Copied.
Credits - Red Devil.
I use CCACHE, but the only difference is that I don't specify the directory. also, I did a "apt-get install ccache" long ago, and set file size according to that. Its still working just as fine.
and oh, yes, adding that USE_CCACHE=1 to .bashrc is required
IRC and you!
In case you came here via my signature, sorry for that. But really, you need to know some stuff about IRC, before going to a channel. The pico channel is #pico :fingers-crossed:
So, you might have heard about IRC, even logged into one (freenode, probably, the webclient of it), (and most probably saw that there was no activity and just closed that browser tab).
Let's take a timeout here to talk about IRC.
Instead of me talking about IRC, (and you being too lazy to Google stuff (not intended to those who solve problems themselves (not noobs (?) :wink: :wink)), here's a nice article by Rey Bango that you might want to read: IRC is Back: Here's Your Starter Guide
So, instead of me talking blah blah, and you skimming through most parts, which I assume, you did in the above article (considering you taking the energy to read it), here's what you need to know about Freenode:
..but in terms of development, from my experience, most developers tend to jump on Freenode - and rightfully so.
Click to expand...
Click to collapse
So, just to let you know, in those channels (where you thought there was no activity), there actually is a lot of discussion going on. You just don't know it yet.
So? What am I supposed to do? Keep a browser tab open? Don't expect me to say "Exactly not!" because that too is a viable option, though not very practically possible.
Here's where bouncers come in. Known as BNCs, here's what they do:
A bouncer (BNC for short) is a piece of software used to relay the communication between an IRC client and the network it is connected to, acting as a Proxy.
So, whats the point you ask? The reasons and benefits of using a bouncer are many and include hiding the real IP you are connecting from, protecting your nickname and channel from being taken on networks that don’t provide channel-/nickname registration and most of the time they’ll also notify you of private messages that came in when you’ve been disconnected – of course only when the bouncer can stay online being connected from a server.
Click to expand...
Click to collapse
Coming as either free or paid (either of them being useful, nonetheless), and cutting all the tech jargon, they allow you to "stay online" allowing you to close that browser tab you feared to keep open.
So, in case you actually read through the above quoted text, software!? Being connected from a server? Nah, just kidding. Here's where online BNC providers come in. They provide you a username, (and of course a password, which you need to select), and they host for you the BNC software (in most cases, ZNC).
Most BNCs allow caching of messages, i.e. buffered playback. Their servers are connected 24x7. You, the user, connect to their server, and through their server join the channels. You then, disconnect from their channel. Poof! But, their server still remains connected to the channels, and logs the messages in the channels, and any PMs sent to you. The next time you connect to their server, it gives you all the logged stuff, and it gets cleared. The next time you disconnect, ... Well, you get the flow.
Questions. That's what you go to IRCs for (mostly. I do it for the conversations ). How exactly do you ask questions? Similar to on XDA, but slightly different. I couldn't have said better than l3dx's answer on stackexchange:
Rule #1: Don't ask to ask
Rule #2: Behave as you would do in a real life conversation
Rule #3: Be patient. If there is no activity, it usually means that no one has read what you wrote yet. If no one responds, they don't know or didn't notice. You can re-try after a while, or ask if anyone has any clue with regards to your question x minutes ago.
Click to expand...
Click to collapse
What does Rule #1 mean?
Something very similar to what zxcdw said in the comments:
"Don't ask to ask. Just ask". Don't ask people "Anybody around?" or let alone highlight others to ask if they are around. It's just easier to drop your question, hang around and wait. Ask again in a few hours or so.
Click to expand...
Click to collapse
Also, use English, in most channels, if possible. Stay safe, don't open any unknown links or links to untested software, scripts and stuff. Stay safe.
IRC clients help you stay connected. A few simple google searches will get you going in the right direction. I personally use XChat IRC on Linux, but there are a lot of other good IRC clients available too.
Free bouncers should do, mostly. I use bnc.im, seen people using EliteBNC, some people installing ZNC in their own private servers that are online 24x7, YMMV.
That's about it for IRCs. Happy chatting!
P.S. Make sure you ask the right questions in the right channels.
sys2cache... something to help with less /system partition size.
note: this would be running at boot, with busybox, so,...
Code:
# algo:
# if read(switch_file=1)
# goto case 2.
# else case 1:
# get /system size
# get /data size
# get /cache size
# check /cache remaining size
# check for files in /system
# check for the following folders
# name generic size priority
# ./etc 3.1M 6
# ./vendor 36K 9
# ./addon.d 12K 8
# ./core 76K 7
# ./xbin 1.6M 5
# ./fonts 18M 1
# ./usr 21M 2
# ./media 4.8M 3
# ./bin 5.5M 4
#
# switch = 0;
# file folder_list;
# for i in list_args
# if (getsize($i) < getfreesize(/cache))
# mv $i /cache/$i
# mount bind /cache/$i /system/$i #fix syntax
# ifexists(/system/$i)
# switch = 1;
# folder_list >> $i
# else
# switch = 0; break;
# else
# echo "fak this, we're out of space!"
# fi
#
# echo $switch > switch_file
#
# sync; exit!
#
#
#
# case 2:
#
# for i in xargs(folder_list)
# do
# mount bind /cache/$i /system/$i #fix syntax
# done
#
# sync; exit!
#
#
#
# todo:
# * actually code this shiz
# * better error checking
# * add logging
Hey!
Make sure y'all check this!
http://team-cody.github.io/ :highfive:
welcome to another member @Agaphetos
Source- https://www.github.com/Team-Cody/
todo: update this post with website link.
lol, nvm this post
shameless bump.
since my board exams are over (sort of; only CS is left); i thought of building something for pico (a looong time since I did so).
Waht do I build?
At first thought; one *pure* CM9 build with *some* cherry-picks;
another; an updated CM11 build (updated sources and stuff)...
fixing up omx and stuff on Omni is on the "to-do" list and going to take some 'time' to do; so don't expect it to be fixed already :silly:
So; which one do I 'invest' time in? :cyclops:
@thewisenerd
MTP and OTG in cm9
Cm11 only if you can make it compressed
Sent from my Xperia S using XDA Free mobile app
mirhl said:
@thewisenerd
MTP and OTG in cm9
Cm11 only if you can make it compressed
Sent from my Xperia S using XDA Free mobile app
Click to expand...
Click to collapse
you mean MTP && USB tethering?
edit: a test build will be up today (if build goes well, that is).
edit: here you go: cm-9-20150315-UNOFFICIAL-pico.zip
thewisenerd said:
you mean MTP && USB tethering?
edit: a test build will be up today (if build goes well, that is).
edit: here you go: cm-9-20150315-UNOFFICIAL-pico.zip
Click to expand...
Click to collapse
This is one sick ROM - good job !!!

I have an issue. I do not know if my code modification or my device is to blame.

Info:
my device is rooted (fully) and my phone consist of Supersu, Nethunter terminal, bcmon, Reaver.
(below are the codes i modified for my device)
The history
when I first started running reaver i would receive many errors; [...not found] [...can't enable] [...can't change permissions (appearently you can't change permissions within sdcard folder... anyways, moving on.)]
[...no internet connection found]
my point is after looking at the custom scripts I had installed (with notepad++) i noticed that the actual scripts were the big issue. so I started changing things one by one in-order to not mess-up everything. yeah sure, I made some errors that made things last longer- way longer than normal. Nevertheless, at some point I actually started making things better and slowly started knocking down those errors!! until i hit the 'test' button and sure enough
"Cannot link executable... libfake_driver.so is 32 instead of 64.... only PIE are supported."
Truth Be Told
as you might can tell from the kind of question I'm asking, I am not an expert.
And I understand these kind of questions comes with others looking at the questioner as annoying- and with the thought of 'these beginners just want everyone to give answers instead of learning themselves...' It's NOT COMPLETELY wrong, since now days a comment like such is ... pretty much true-
So i'll say this: Not Every One Is The Same.
I am a programmer. my programming is mostly within game design/ game development so if more coding is needed to solve my issue at hand, then let me know and please (at the lease) point me in the right direction.
if I need to google something, please clarify what to search. For I am just one person, so it is possible I haven't thought of something to type in- however, that does not mean I haven't type MANY searches in already.
The Question
Am I able to use Rfa and bcmon on nexus 5x, and if so, then what is needed to get my phone operating (the app(s)) correctly? This is the complete error i am receiving in RfA.
CANNOT LINK EXECUTABLE: "/system/app/bcmon/assets/libs/libfake_driver.so" is 32-bit instead of 64-bit page record for 0x7f98e8c010 was not found (block_size=64)
error: only position independent executables (PIE) are supported.
My Done Work
with the rfa settings you can choose to use custom scripts the following shows the scripts i used and it's placement.
these scripts i had to modify to get the device's errors fixed ( not all though )
Activation Script:
#!/bin/bash
svc wifi disable
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/data/sdcard/bcmon/assets/libs/libfake_driver.so sh
cd /sdcard/bcmon/assets/tools
./enable_bcmon
echo “rfasuccess”
exit
Warm-up Script
#!/bin/bash
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/sdcard/bcmon/assets/libslibfake_driver.so sh
cd /sdcard/bcmon/assets/tools
Stop Script
#!/bin/bash
svc wifi enable
echo “rfasuccess”
Will you care to help me?

sudo in Android

I am looking for advice on how to define a "sudo" command, given that I have a working "su" command.
I have been getting away with
Code:
alias sudo='su -c '
but recently got a silly error message that makes me think I need more than one backward-slash to escape the asterisk I am trying to pass to "find" in an "-iname" option. (And leaves me wondering what I've been doing this last year when I thought it was working as expected.)
@Cruzy12100 described using "sudo". I wanted (and still want) him to explain in detail how he comes to have an "sudo" command available.
To invoke SU command the synthax is
Code:
su -c '<YOUR-COMMAND-HERE>'
Note that the <YOUR-COMMAND-HERE> must be enclosed with single quotes.
Currently, using the "su" provided by Magisk, I get away with the alias I described.
@jcmm11 advised me to use
Code:
alias sudo='su -c "[email protected]"'
I remember on an earlier Android, with a different "su", I had to enclose the argument in quotes, which then led to the nightmare of trying to multiply backward slashes when trying to re-issue a command, this time as an argument to "su". On that tablet, I just gave up and switched to "root mode" when I needed to.
When I use "su" in Linux, I don't have to wrap the command in quotes -- it's easy to recall a command, put sudo in front of it, and execute it. (I'm mostly using "ls" and "find", so there's usually no risk of damaging anything.)
I just tried playing with the "[email protected]" construct. In my tests, with
Code:
alias xxx='echo fore "[email protected]" aft"'
The "[email protected]" doesn't seem to do anything:
Code:
xxx asdf
produces
fore aft asdf
Maybe the suggestion was targeting a different shell.
J.Michael said:
Currently, using the "su" provided by Magisk, I get away with the alias I described.
@jcmm11 advised me to use
Code:
alias sudo='su -c "[email protected]"'
I remember on an earlier Android, with a different "su", I had to enclose the argument in quotes, which then led to the nightmare of trying to multiply backward slashes when trying to re-issue a command, this time as an argument to "su". On that tablet, I just gave up and switched to "root mode" when I needed to.
When I use "su" in Linux, I don't have to wrap the command in quotes -- it's easy to recall a command, put sudo in front of it, and execute it. (I'm mostly using "ls" and "find", so there's usually no risk of damaging anything.)
I just tried playing with the "[email protected]" construct. In my tests, with
Code:
alias xxx='echo fore "[email protected]" aft"'
The "[email protected]" doesn't seem to do anything:
Code:
xxx asdf
produces
fore aft asdf
Maybe the suggestion was targeting a different shell.
Click to expand...
Click to collapse
Couple of points, prefaced by the fact that I can't currently test or verify anything.
First of all, about [email protected] Specifically from the documentation for mksh (which is Android's default shell):
Same as $*, unless it is used inside double quotes, in whichcase a separate word is generated for each positional parameter.If there are no positional parameters, no word is generated. [email protected]can be used to access arguments, verbatim, without losing NULLarguments or splitting arguments with spaces.
Magisk switched to ensuring that any startup scripts etc use Magisk's BusyBox commands on order to ensure consistency. I don't however think that su changed the shell to the BusyBox shell (which is ash, the Almquist shell), that would actually be bad for consistency.
For a test try something like:
alias sudo='su -c "[email protected]"'
sudo echo test
and see what happens. It should just return "test".
Personally I've never cared for sudo. I've always just preferred to use su, both on Android and Linux. But that's another discussion entirely.
jcmm11 said:
...
For a test try something like:
alias sudo='su -c "[email protected]"'
sudo echo test
and see what happens. It should just return "test".
...
Click to expand...
Click to collapse
It printed "test"
My problem is that I do not see any evidence that '"[email protected]"' is expanding to anything: I get the same result with or without that construct.
Code:
alias xxx='echo a "[email protected]" b'
alias yyy='echo a b '
I think I am using "sh" as a shell, both in my normal terminal, and when I use "su". (/bin/sh is not a link to toybox, it is a 400KB file)

Categories

Resources