[TOOL][ADB][Windows]RAM-Hog Sniffer For Rooted Android Emulators - Android Software Development

Given the case you feel your favorite Android emulator runs slowly, especially at a certain game, then you should remind that Android emulator's (AVD) performance mainly depends on correct setting of its
A: Android per app Heap Size granted
B: VM total RAM (read: Random Access Memory) allocated off host machine
Most emulators don't automatically take care of this, they are preset to standard values: it's on the user to correctly configure it.
User has to check and monitor for the RAM usage of an individual app/game on Android, has to check which app/game is eating the maximum RAM and affecting the performance.
Yes, for me one of the fundamental questions users ask (or at least, they should) is: how much memory is my program using? It may be a simple question, but with a virtual memory operating system like Android the answer is quite complex.
By default Android OS - a derivate of Linux OS - since ages comes with procrank tool, what in detail shows you some RAM metrics for an application as those are VSS, RRS, PPS and USS. So also Android OS provided by the various emulators should do it, too.
Installed Terminal Emulator app on some wellknown emulators and ran procrank. Experienced that on Android emulators like
BlueStacks 4 ( Android Nougat )
PROCRANK doesn't work at all, you get message: "error creating kernel interface -- does this kernel have pagemap?"
MEmu 6 ( Android Nougat )
PROCRANK doesn't exist - means isn't implemented at all
NOX 6 ( Android Nougat )
PROCRANK isn't working, you get message: library "libpagemap.so" not found
Genymotion 3 ( Android Nougat )
PROCRANK doesn't work at all, you get message: "error creating kernel interface -- does this kernel have pagemap?"
Maybe someone knows reasons for that?
Hence, to get out the app/game specific RAM metrics ( read: VmPeak, VmVSS, VmHWM, VmRSS and VmPSS ) on an Android emulator, I wrote a Windows command script ( ~50KB ) that running against a rooted emulator gives them to me: I named it RAM-hog Sniffer. Notes: It's provided on an "AS IS" basis, it's free software, and you are welcome to redistribute it under license GPLv3.
Successfully tried it on properly rooted and ADB-enabled BlueStacks v4.50.5.1003 ( Android Nougat ):
Excerpt of logfile created:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Useful or not is for you to tell, give it a try and leave a comment with suggestion if indicated.
Usage:
• Download the attached ZIP and unpack it on Windows PC into any location of your choice
• Connect a rooted and ADB enabled emulator to PC
• Run Windows batch-file named RAM-hog-Sniffer
FYI: You will need to install the Android ADB drivers if your emulator is not detected.
PS: Please, do NOT share this elsewhere - I want to be able to update if necessary.

Script revamped. New version is in OP.

gr8. ty

To keep you updated: BlueStacks announced to fix the PROCRANK problem

According to the description I think something good,
but, can the script, not to change to the installed system,
for editing on a computer.>?

Ciuma777 said:
According to the description I think something good,
but, can the script, not to change to the installed system,
for editing on a computer.>?
Click to expand...
Click to collapse
You use any ANSI-editor of your choice, preferredly of course Notepad++, to edit the script on your Windows computer according to your needs.

Related

[Q] Porting an CLI app to Android.

Hi XDA Dev's,
I have a program called words. It's a windows based, but ported to linux program which is able to function as an English to Latin and reversed dictionary.
The program has to be ran in the Terminal, cos it is command line interface based.
I thought since it is a program ran in the Terminal you should be able to run it in the Android Terminal, but that's just a theory.
Practically it doesn't work that way.
After untarring the app I entered ./words or su ./words but either won't work.
It gives me the following:
(I took the block from the internet so hope you see a block, not some kind of symbol: )
EL4: not found
4: not found
4: not found
: not found
./words: 5 Syntax error: "(" unexpected
So I think the Android Terminal reads differently cos it doesn't expect that character.
The question is: How can I port a linux CLI program to Android? And is this possible with the App Inventor from Google?
I don't really understand ypur question. If you would like to run a shell script try this
Code:
sh script.sh
Sent from my GT-I5700 using XDA App
Hmm sh gives me almost the same error.
But that's the thing, I have no clue what it is, there are a few files which are being used by the program. One of them is words, but it has no extension.
TT5555 said:
Hi XDA Dev's,
I have a program called words. It's a windows based, but ported to linux program which is able to function as an English to Latin and reversed dictionary.
The program has to be ran in the Terminal, cos it is command line interface based.
I thought since it is a program ran in the Terminal you should be able to run it in the Android Terminal, but that's just a theory.
Practically it doesn't work that way.
After untarring the app I entered ./words or su ./words but either won't work.
It gives me the following:
(I took the block from the internet so hope you see a block, not some kind of symbol: )
EL4: not found
4: not found
4: not found
: not found
./words: 5 Syntax error: "(" unexpected
So I think the Android Terminal reads differently cos it doesn't expect that character.
The question is: How can I port a linux CLI program to Android? And is this possible with the App Inventor from Google?
Click to expand...
Click to collapse
Hi, If you can get the source code to the program, then potentially the program can be ported to Android/ARM CPU architecture. The fact that it is a command-line program isnt such an issue - an Android app can be designed to interact with that (eg using Runtime.getRuntime().exec()).
If you just copied over the binary that runs ok under Linux on your PC, and tried to execute it on your Android device, it wont work. Your PC is running x86/x64 based CPU, your Android device is running ARM based CPU (eg you're putting diesel fuel into a car that needs petrol).
- jc
If I had the dictionary file, I could put it on my hosted site and write an app.
Rootstonian said:
If I had the dictionary file, I could put it on my hosted site and write an app.
Click to expand...
Click to collapse
You said it like it's that easy; but if you want I'd appreciate it.
The link on the official site doesn't work anymore so I uploaded the .tar.gz file on my website. Direct link:
http://www.freewebs.com/hoitom/words-1.97Ed-linux.tar.gz
Click to expand...
Click to collapse
I already made a concept of what it could look like with the App Inventor, but I don't mind else:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Note: this is only a English to Latin example. It has to be Latin to English too.
I hope you're able to do it. I'm really bad with linux.
Good luck
http://users.erols.com/whitaker/words.htm is the page for this program. It's written in ada and the author supplies the source. It will probably not be much harder than just compiling it for android once there is a working cross compiler, GNAT AUX is working on one currently http://www.dragonlace.net/posts/GNAT_AUX_ported_to_Android/.

[APP] micro-httpd (GET / POST / CGI support) cross-compiled to Android

Hello,
A while ago I've managed to cross-compile a basic web server, resulting in a native ARM executable (you can find it here) that allows any other device to connect to port 80 (or whatever) and browse the contents of the phone.
Easy to exchange photos at a cafeteria which has wifi and both phones are connected - for example. No need for an FTP client, slow bluetooth, and so on...
However, I wanted more and since webserver was only handling GET (no POST / no CGI), I've started looking for an alternative that did the job.
Below, you will find a native ARM executable of micro-httpd, a light weight web server that supports CGI.
Download
Use it at your own risk!
mini_httpd_1.19.arm.tar.gz
It supports .htpasswd files to restrict access to folders - and it comes also with its own utility htpasswd which manipulates the password files.
micro-httpd website: http://www.acme.com/software/mini_httpd/
micro-httpd configuration options: http://manpages.ubuntu.com/manpages/maverick/man8/mini-httpd.8.html
You can use almost any CGI interpreter you want, minus PHP. The PHP 4 Android (a native implementation of PHP) has only CLI (command line support) and even if you could change the PHP code of the scripts to output the missing headers. BUT! It also outputs debug messages that you cannot control, in the output of the script!
Those messages are are considered errors in HTTP / CGI.
The creators of PHP interpreter say that is only meant for Scripting Languages for Android (SL4A) which works with what they have. You can read more here: http://groups.google.com/group/php-for-android/browse_thread/thread/79d0b5f856189675?pli=1. This topic also mentions an alternative (CGI this time) from GroomDroid but that is also unstable.
Enter PERL!
I had good success with Perl 4 Android
I can how host a blog on my phone - I've set up a big tutorial on how to configure everything here Running native CGI scripts (perl) with micro-httpd on Android.
Result
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Next step would be to try out a file manager and test file upload, then go even deeper to see if I can access various phone details and offer a sort of management interface for them on the web.
Source code
You will find the source code and the license (free) on the tutorial website above.
Seems interesting !

[Win-Linux][11/15/11]{Tool} - AndroBox, Quick + Easy ADB And Debug Tools With GUI

AndroBox
Quick and Easy to use ADB and Debug tools for professionals and beginners
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
ADB and similar command line tools for Android have been a pain for new users to learn and extra work for the Developer while working.
Personally, I got sick of typing and having to remember things so I made this tool. It is also nice because it is mucho faster than I could do it!
I will be cleaning things up and making it look nicer (more even...?) as well as releasing the source code soon. Be patient!
DOWNLOAD - WINDOWS:
http://dl.dropbox.com/u/58849669/AndroBox-Win_0.4.zip
DOWNLOAD - LINUX:
http://dl.dropbox.com/u/58849669/AndroBox.linux.zip
UPDATES:
11/15/11 UPDATES
- Linux Version Added - runs on ALL Linux standard distros
- Linux version requires device to be hooked up and present or it will not go past the first screen
- Linux version shows real time activity in the Bash terminal!
- Linux version requires you to go through the true google agreement (keeps code distro kosher)
10/27/11
- FIXED Bug-report
- DDMS Runs natively (if you do not care about DDMS, download the old version here: http://www.multiupload.com/OQSF5U7QNH)
- No longer requires a device to be plugged in to start up. check test.txt
EVERYTHING RUNS FROM WITHIN THE APPLICATION FOLDER.
This was done simply because I like to be able to carry my tools on a small flash drive and not install anything.
There is no need to install the whole SDK to get access to a few key tools.
ALL OF THE PROGRAM FUNCTION OUTPUTS ARE TXT FILES THAT SAVE TO THE APP FOLDER
This just keeps things nice and tidy. You have everything right there to look over when you want to.
READ THE INSTRUCTIONS!
This will tell you how to use each function.
LEARN ADB
Allows new users to find out just how much fun (and Linux) is in there. Yay shell!
*** DONATIONS ARE NOT GOING TO MY POCKET, THEY WILL BE DISTRIBUTED TO THE EFF AND CYANOGEN WEBSITES FOR THEIR HARD WORK! ***
*I am not resposible if you mess up your device using this tool, please don't be stupid.*
QUESTIONS? Shoot me a PM or Email that is enclosed in the instructions
Looks like an awesome tool, but i need the Linux version
Its working, I just need to make sure it works on all of the major Linux Distros.
Regular Ubuntu 10.04 is being finicky. Kubuntu, Xubuntu, and RedHat are playing nicely.
I just want to make sure that it is good for all before release. It also autohandles your path so all you have to do is a "chmod +x AndroBox", then "./AndroBox" and you are good to go!
Thanks
Great tool, thanks a lot
Updated - everything should work GREAT now. DEBUG (DDMS) runs natively and FULLY!!!!!
If you do not care about DDMS, use the older version as it is MUCH smaller since it does not need the included library files.
Great !
Waiting for tool that workin with linuxmint
Sent from my E398-EM30-S5570
HEY GUYS - I HAVE A WORKING LINUX VERSION, BUT I NEED PEOPLE WHO WANT TO DO A PRIVATE BETA!
Kubuntu, Red Hat, and Xubuntu have been tested as working.
Send me a PM or post in this thread!
Now with working linux version!!!!!!!!!!!!!!!!!!!
Testing on all major linux distros without issue!!!!!
Added Dropbox Links because of the mess with most other filehosting services ATM.
How do i start the linux version up?
Do i need to use terminal or?

[MOD][CHEF][TOOLS] AROMA Installer

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The World First ANDROID Touch and Customizable ROM Installer
Don't Forget To Donate Me:
​
Android has an advance system for installing OS and updates, unlike other mobile OS that distributed the contents of OS in static ROM image(s), Android distributing the OS and updates in a plain zip file that contains all packages files and the updater for processing the installation.
The updater split in 2 type, the binary (update-binary) and script (updater-script), while the binary was executable files, and the script was configuration script that controlling the binary executable what to install.
But this advance technology never expanded into it highest potential ability, the update-binary was simply the linux executable wrote in C that runs in root mode, and can do anything into your system, including accessing Display FrameBuffer, accessing key and touch screen, set vibrate, runs programs, parsing files, loading png(s) and zip, and also reading and writing filesystem.
Old update-binary only support few functions that can controlled only by updater-script for installing the files, and not even one function that allowed the installer to show interactive user interface for users to input something that can manipulating the installing process. There is some program called "yesno" that show Yes or No interface, but it wasn't even enough to create more customizable updater.
Now with AROMA Installer update-binary, all this limitation was gone, and this advance technology already expanded into the highest level of its pontential.
Read More in amarullz.com [+]​
What is AROMA Installer
"AROMA" was taken from Bahasa Indonesia (Indonesian Language) and it's mean "Smells", but also abbreviation of "Amarullz ROM Manifest". It was advance update-binary for Android that contains many features like Wizard Installation, Touch User Interface (AROMA UI), Customizable Packages, System Inspecting, Themeable, and User Interactive. All release version will had "Smell Things" codename, example in 1st version it has codename "Anggrek" which mean "Orchid".
How AROMA Installer Works
It works because Chuck Norris drive the high tech jet plane with high tech technology to be able to control your phone in remote and show you an awesome Installer in your phone.
No, Seriously, When user select the zip file to install it, the recovery will extract the update-binary and runs it with few arguments, all process and stuff was simply handled by update-binary, the recovery only show the information passed by update-binary via custom pipe. The great things is that update-binary can do anything if we can code it in C/C++, but not all people can easily playing with C/C++, and Its not effective and not fun at all to compiled it every time we need to change the process. That's why the custom script also used in AROMA Installer, it was simply edify script that used in normal updater-script but with expanded functions available.
It wasn't a simple thing to archive something like this, because the update-binary is simply the "linux executable" that doesn't even supported with dynamic links of libraries, not even supported basic drawing functions like drawrect, drawline, and don't expect it can included OpenGL in it's binary. It's runs on it's own. Even User Interface was wrote from scratch to manipulating directly into display framebuffer, user input was readed directly from raw of kernel input device, png and zip was readed with static link library, and the configuration was parsed in it's own program. It was result of one full month of developing, but you can use it in an instant learning without even need to know how to manage memory usage and pointers.
The AROMA Installer will read, parsing, and run the script commands to show it's UI's, Calculate partitions sizes, create-read and write temporary prop files, set & get variables, do simple integer comparisons and math sequences, do the if else or inline if conditions, configuring UI color scheme, configuring rom information, and many more.
Because it wasn't that simple and need a lot of time to developing it, did I worth to get some donations from my works?.
Go To Here: http://forum.xda-developers.com/showthread.php?t=1461712
---- http://forum.xda-developers.com/showthread.php?t=1461712
Reserved - For Development and Script Sintax...
Reserved - For Theming and UI Customization Info & Downloads
Thanks To
Sebastiaan15
Prof Peach
What exactly does this thing do? and for average minds like me how will this help in daily use
[CHEF] TAG : Only for ROM Maker.
It was for zip ROM, so User will be able to customize their rom installation...

[APP] iptraf 3.0.0 for Android (with APK Installer)

Introduction:
Here's the classic iptraf for Android!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation:
You need to have a rooted phone and busybox installed on /system/xbin
You also need to have about 1Mb free on your /system partition.
Usage:
To use iptraf, you need to either have an SSH server on your phone (for example DroidSSHd) and connect using Putty from your PC, or you can use the Terminal Emulator (please see attached screenshots).
Any terminal emulator application should work, but iptraf requires at least 80×24 characters screen so for smaller screens you might need to reduce the font size a lot to make it fit.
The price is payed for the installer and the effort to have iptraf cross-compiled for Android, since iptraf is distributed under GPL license. Put in a different way, you are just buying me a beer for making it easier for you to have iptraf on your phone!
Filters:
If you decide to connect using SSH, the trouble is that iptraf will show the SSH traffic too – something that you might not want to have there constantly updating.
It would seem intuitive to create a filter which excludes SSH port from the traffic, but once you do that, iptraf will not show anything else; iptraf actually has an “implicit no-display” policy meaning that once you apply a filter (include / exclude) nothing else is displayed, even if the filter is Exclude mode. You will need to have an additional Include entry added to the filter (after the Exclusion entry taking care of the SSH port) where everything is 0 and all the ports have an Y next to them. Please check attached screenshots as an example on how the entries of the filter should look like.
Please do not forget to “Apply filter…” every time you change something in the filters. X saves the filter, Ctrl-X cancel the changes, but even if you press X, the filter is not yet applied unless you Apply the filter.
Download
Please donate by buying it from the Google Play :fingers-crossed:
Use it at your own risk!
IptrafInstaller.apk
Source code: https://code.google.com/p/iptraf-installer/
Could you please make the sources of the iptraf binary available?
(preferably on github)
1 Euro to download from Android Market? That sucks
M66B said:
Could you please make the sources of the iptraf binary available?
(preferably on github)
Click to expand...
Click to collapse
As soon as possible ... I am working on an updated version.
defim said:
1 Euro to download from Android Market? That sucks
Click to expand...
Click to collapse
Well, you can actually download for free from few posts above.
I'm to lazy to update app by manual download .apk

Categories

Resources