Easy terminal emulator startup. - Galaxy Tab 2 Q&A, Help & Troubleshooting

Well currently i am using jackpal.androidterm emulator and always needed to type 2 commands bf new entriws would be allowed.
Namely the following commands. 1. startup su by running su command. 2. mounting r/o to r/w of /system mount blabla.
Well here comes in my helpfull hint (^o^)
go into settings menu and alter the startup command send to shell into this line of text.
su && busybox mount -o remount,rw /system
now ur emulator will always start with su approved (#) and /system
running as r/w mounted. u could add more commands as long as u
add these symbols btween commands && . take note there aint spaces inbetween or it wont work.
ohh and easy command help for terminal u get by typing the next
line of text. replace the COMMAND with desired item.
busybox COMMAND --help
use the busybox command on its own to see commands it can use..
hope helps someone who wanna know more about busybox and terminal emulator commands.
And if u wanna use bash scripts just add it to the startup command.
su && busybox mount -o remount,rw /system && bash
u need bash installed of course, and i used an alternate path so the program stays clean. i used /data/local/foldername to store my bash, busybox, android toolbox so they wouldnt get corrupted. the android toolbox i found in my /system/bin and i put bash and busybox into /system/xbin and all seems to work fine.
Sent from my GT-P3110 using XDA Free mobile app

Related

[Q] Getting a script in init.d to execute on boot in Android??

I want to place a script I have written in init.d, so that it will be executed on every startup.
Here's what I am doing:
busybox mount -o rw,remount /system"
busybox cp -f /sdcard/*******/script /system/etc/init.d/script
busybox chmod +x /etc/init.d/script
update-rc.d script 99
The "update-rc.d script 99" line is where I run into trouble, it fails with an "update-rc.d not found" error.
Does anyone know what the proper command would be to make this work in Android??
i am not sure if it is different.... but I have always used a script that I made by naming it a number between 1 and 99 depending on when you want it to be read in the boot up. Like my favorite "86supersettings" and placing it it /system/etc/init. d and chmod to 750.
does this help?
Sent from my HTC Vision using XDA Premium App
Thank you so much... thats EXACTLY what I needed!

[i9003][Mod] Root XXKPM without CWM

Hi everyone,
this method helps you to achieve root in XXKPM without CWM (which will be available shortly). You will need the attached files and Linux with installed Android SDK. Credits go to ChainsDD for the Superuser binary and APK and to Skin1980 for his normalboot.img repack script. This method is more time consuming than flashing CWM and more risky. Beware!
Flash XXKPE followed by XXKPM via Odin.
Flash the modified normalboot.img as PDA via Odin and do a full wipe. This enables the adb shell to run as root on the device, allows debugging and mock locations.
Now start up Linux and hook up your device to your PC. Do not forget to activate USB debugging in the settings. Follow these directions very carefully, otherwise you might have to reflash or even loose your IMEI!
Run Terminal. In Terminal, gain root access and start adb:
Code:
su
adb start-server
To be sure adb is running and recognized your device, issue
Code:
adb devices
Now the delicate part: Mount /system read-write:
Code:
adb shell
su
At this point, the "$" at the beginning of each line should change to "#". Otherwise, you're not root and can not continue.
Code:
mount -o remount,rw -t yaffs2 /dev/block/stl9 /system
exit
And now push the Superuser files to the device (I am assuming they are lying in your home directory. Otherwise, adjust the path. For example, "su" could be in "/home/user/i9003/su"):
Code:
adb push su /system/bin/su
adb push Superuser.apk /system/app/Superuser.apk
And finally set the correct permissions and remount /system read-only:
Code:
adb shell
chmod 6755 /system/bin/su
sync
mount -o remount,ro -t yaffs2 /dev/block/stl9 /system
exit
Reboot.
After this, you will typically install busybox from the market. But this is up to you. Have fun!
Thanks for the info..r we really need this?coz I've no linux on my desk
Sent from my GT-I9003 using xda premium
AmirolAhmad said:
Thanks for the info..r we really need this?coz I've no linux on my desk
Sent from my GT-I9003 using xda premium
Click to expand...
Click to collapse
it can be done by using command prompt in windows with adb setuped in ur pc..
Anyone tried this method?
confirmed this method works
@g5abiera: I sure hope so
You mention an error in the OP. Can you specify?
Works!
Rooted and Deodexed...
i really don't know what went wrong the first try, i was getting an error telling me there isnt enough space in the partition where the su binary goes. then again, i simply reflashed kpm, and viola, it works.

[GUIDE][ADB]Basic Linux/Unix Commands

Basic Linux/Unix Commands
[HIGHLIGHT] DISCLAIMER - You know the drill. I don't deem myself responsible in case you screw up your phone. Always make a backup if you don't trust yourself and if you know that you screwing up is your forte[/HIGHLIGHT]
Thanks -
mihir287 for his FAQ
sweetnsour for his extensively detailed thread
Shen - advice
Zayed from www.addictivetips.com
http://www.linuxtopia.org
This guide aims to give you a background on some of the linux commands available to you once you obtain an adb shell.
In order to obtain an ADB shell, you must have adb set up on your computer (all ADB really consists of in windows is adb + 2 dlls + adb drivers.
However it makes sense to fully set up the Android SDK if you plan on developing for Android.
You need to install adb or get Terminal Emulator. To install adb and get more info about it visit here.
NOTE = All commands in linux/unix are CASE SENSITIVE.
Shell Commands
These commands are to be typed after typing
Code:
adb shell
In the Command Prompt.
Or, you can proceed normally if you are using a Terminal Emulator.
1. cd - Change Directory
To change to any directory, simply type:
Code:
cd <dirname>
dir name is the path. For instance, to switch to system/etc, type:
Code:
cd /system/etc
'..' will allow you to go back one directory. In our example, typing:
Code:
cd ..
would take you back to /system
2. ls - List Files
To list all the files in whatever directory you're in, simply type:
Code:
ls
pressing enter after, of course. This will list all NON-HIDDEN files/directories.
Code:
ls /system/etc
will list the contents of system/etc
Code:
ls -l
will list all NON-HIDDEN files in your current directory with additional details
Code:
ls -a
will list all files/directories(including hidden) within your current directory
Code:
ls *.extension
will list all the files wit the specified extension in the directory
For example i wanna list all apps -
Code:
cd /system/app
ls *.apk
3. su - SuperUser
The standard adb shell (unless you're on an insecure kernel/ramdisk), will be a non-root shell ($)
To obtain root priviliges (if your phone is rooted), simply type:
Code:
su
on obtaining superuser priviliges, you will be presented with a # symbol, which represent a root shell.
4. chmod - Change Mode
The two most commonly used 'modes' you'll come across in Android are '777' and '755'
These numerical pemissions have different meanings, of course. This can be a little confusing, so I hope this explains it in a simple to understand way.
As you can see, there are three numbers in the following example; 'chmod 755'
So, to break that down: The first number in the sequence, '7', represents the USER (aka, you). The second number in the sequence, '5', represents the GROUP (users who are members of the file's group) and the third number, '5' represents OTHERS (aka, everyone else).
Now to explain why they are 755, and the significance of those numbers, see the following list:
7 Full
6 Read/Write
5 Read/Execute
4 Read Only
3 Write/Execute
2 Write Only
1 Execute
0 None
So in the instance of 777, you can see that USER, GROUP and OTHERS have FULL access to the file in question.
To change the permissions of one file (apns-conf.xml for example, type:
Code:
chmod 777 /system/etc/apns-conf.xml
To change the permissions of all files in a directory, use the -R (recursive)option:
Code:
chmod 777 -R /system/etc
5. pwd - Print Working Directory
Couldn't be more simple. if you want to find out which dirctory you're currently in, type:
Code:
pwd
and press enter.
6. cat - Concatenate (evolved from)
The cat command if used to list a file's contents on your screen; or pass via pipeline to use with other Linux commands.
cat /proc/mounts
will output the various mount points in your android OS.
Note that there are many other uses for the cat command.
7. mount - remount as r/w or r/o
The mount command is used to mount a directory as r/w[Read-Write which allows you to modify it] or r/o[Read-Only]
Mount info -
Code:
mount
To mount as r/w and r/o respectively use -
Code:
mount -o remount rw <dirname>
or
mount -o remount ro <dirname>
To mount /system i will use
Code:
mount -o remount rw /system
or
mount -o remount ro /system
8. cp, mv, rm - Copy, Move, Remove
Use the 'cp' and 'mv' commands to copy, move a file/directory respectively and 'rm' to remove one. They are equivalent to copy+paste and cut+paste and delete
If you are planning to copy/move/remove from your android to anywhere else or viceversa you need to mount as r/w prior to this and mount as r/o after it.
They can be used as
Code:
cp <source> <destination>
or
mv <source> <destination>
or
rm <source>
For example i wanna copy/move/delete my zip file to system/media [after mounting system]
Code:
cp /sdcard/bootanimation.zip system/media
or
mv /sdcard/bootanimation.zip system/media
or
rm /sdcard/bootanimation.zip
9. Auto - Install Applications To SDCard
Type the following -
Code:
pm setInstallLocation 2
10. logcat
A logcat is basically a command to view messages in one of the system logs.
Logcat is the command to view the internal log of the Android system.
Viewing logcat is often the best way - and sometimes the only way - to diagnose a problem.
Dev's always need proper and useful feedback. So if you are testing something, you can always obtain the errors an report back to the dev who in turn can solve your problem efficiently.
Code:
su
logcat > /sdcard/log.txt
Will obtain the logcat to your sdcard as log.txt
Googlers have a sense of humour so even 'lolcat' works identically as 'logcat'
Code:
lolcat
Some dev's require extensive logcat info. To know more about it continue reading here.
ADB Commands
The following commands are to be type in your adb folder directory.
For instance, mine is in C:\android-sdk-windows\platform-tools so i will type
Code:
cd C:\android-sdk-windows\platform-tools
and then proceed with the following code lines
Alternatively you can change your PATH variable
Setting Path on Windows
For Windows XP:
Start -> Control Panel -> System -> Advanced
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Close the window.
For Windows Vista/Windows 7:
Right click “My Computer” icon
Choose “Properties” from context menu
Click “Advanced” tab (“Advanced system settings” link in Vista)
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Click to expand...
Click to collapse
1. Check Connected Phone
To display list of available devices, type
Code:
adb devices
You will get the following output
Code:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 21342737ft6273
where the number indicates your devices serial number usually the one one the back of your phone[needs citation]
2. Login To Android Shell
Code:
adb shell
After pressing enter you will either see '$' or '#'
If you get ‘#’ after typing adb shell, you have already get root access on the phone, no need to type su. Otherwise if you get ‘$’ , type ’su’ to get root access (only for rooted device).
3. Install Application
This command installs the app whose directory is specified by you.
Code:
adb install appname.apk
Note that the name of the application should be without any blank spaces in between. Say i have an app called pes 12.apk, I rename it to pes_12.apk - Also don't miss out the .apk extension
example
Code:
adb install C:\programfiles\pes_12.apk
4. Files From Phone To PC And Vice Versa
For Phone - PC
Code:
adb pull <source> <destination>
For PC-Phone
Code:
adb push <source> <destination>
Example
Code:
adb pull /sdcard/bootanimation.zip C:\programfiles
Code:
adb push C:\programfiles\bootanimation.zip /sdcard
^Self Explanatory
5. Reboot To (Normal/Recovery/Bootloader)
Type the following to reboot normally or to recovery/bootloader respectively
Code:
adb reboot
Code:
adb reboot recovery
Code:
adb reboot bootloader
Some Useful Codes-
I do not know many. If you have any suggestions please do tell me
Type them in line by line and don't type in the '$' and '#'
1. Rooting
Code:
adb devices
adb shell
$ echo 1 > /data/local/lge_adb.conf
Then you can proceed onto using SuperOneClick
2. Installing Custom Recovery
The recovery.img and flash_image files must be in /sdcard
Code:
adb shell
$ su
# mount -o remount rw /system
# cat /sdcard/flash_image > /system/xbin/flash_image
# chmod 755 /system/xbin/flash_image
# flash_image recovery /sdcard/recovery.img
# mount -o remount ro /system
# exit
$ exit
adb reboot recovery
Will add FAQ later if needed
Ohh ! so much detail !
As far as i can see its very well written.
Will read tomorrow
Awesome guide! Thank you!
Sent from my LG-P500 using xda premium
MaKTaiL said:
Awesome guide! Thank you!
Sent from my LG-P500 using xda premium
Click to expand...
Click to collapse
Glad You Like It
Rutuj said:
Glad You Like It
Click to expand...
Click to collapse
I knew Half of this but the way you put it is basically noob written and easy to follow through. Thumbs up for this guide. I wish someone posted this when I first started playing with android. This would've made life easier for me >.<
Sent from my LG-P500 using XDA App
purple1 said:
I knew Half of this but the way you put it is basically noob written and easy to follow through. Thumbs up for this guide. I wish someone posted this when I first started playing with android. This would've made life easier for me >.<
Sent from my LG-P500 using XDA App
Click to expand...
Click to collapse
This doesnt make life easier, if one command wrong, bam! A fresh brick phone...
Sent from my Nexus One using Tapatalk
and how to uninstall app from adb ?
nice guide btw
Great guide. I would suggest you add details on how to get logcat as well, since many developers will find it useful if users post logs of bugs
Code:
su
logcat > /sdcard/log.txt
mihir287 said:
Great guide. I would suggest you add details on how to get logcat as well, since many developers will find it useful if users post logs of bugs
Code:
su
logcat > /sdcard/log.txt
Click to expand...
Click to collapse
Thanks !
Added !
Bump !
Thanks commands working perfect.
Tell me onething..how did you get time to type all of this?
royalflusher9 said:
Thanks commands working perfect.
Tell me onething..how did you get time to type all of this?
Click to expand...
Click to collapse
Compiling info takes time.
Type time = 30 mins
Nice thread for n00bs like me !!!! Thanks very much!!!1
Bumping this thread
very helpful guide ......
thanxxxx

GOOGLE TV & Better Terminal Emulator V4.0.3

First of all I would like to thank my intuitions on this discovery! the SONY Google TV can be rooted, well, at least the /system partition can be changed to read/write. I have not actually executed the command to do so, but I do know the necessary path to the Google TV's /system partition. I recently discovered that the the Google TV uses Better terminal Emulator pro V4.0.3, and I was looking around on the magicandroidapps.com WIKI and noticed that there was an application called TV Terminal Emulator Pro, but I think that was a throw-off. Better Terminal Emulator Pro version 4 works perfectly when trying to access system level permissions on SONY's (notice I said SONY) Google TV. Here are the facts. Hopefully someone can try the usual remount command and switch the system to read/write
1.install Better Terminal Emulator Pro (version 4.0.3 ONLY!) no other version will work
Hit the menu button in your SONY Google TV remote once the terminal has opened and in the default shell setting, choose the Almquist shell as the default!
2.type this command in the terminal
\ $/system/bin/ash
This will give you permission to execute all /system/bin commands(ash=advanced shell)
you will now have a prompt like this one below
\w \ $
3.you can now type this command to see all files in /system/bin directory:
\w \ $ls /system/bin
4. type this command:
\w \ $/system/bin/mount
NOTE: This command will give you a list of all partitions within the TV's file system!
NOTE:The system partition will be in the list of mounts called /dev/block/sda5. It is the only one of two mounts that is in read only mode.
NOTE: This directory is a ext3 file system, and this should be added in the remount command in terminal. Plaese give me some feedback on this matter because I know you GTV fans have been waiting on something like this!!
GOOGLE TV & Better Terminal Emulator Pro V.4.0.3 [UPDATE]
So have figured out how to issue the command to remount the system partition to rw, but it appers that I am not in root? For those who do not know the command, here it is:
\w \$ mount -o remount,rw -t ext3 /dev/block/sda5 /system
mount: permission denied (are you root?)
This is no big deal, this just means that we are getting closer to seeing just what this giant tablet can go. This also means that the command is corrects as well, for one to get an output like the one above., I will try to use another shell and see what commands will have to be executed and get back with all you GTV users.
NOTE: This is post is related to the (SONY Internet TV) and NOT the LOGITECH Revue
ALSO: Those of you who are trying to use ADB to control the television, The \$ adb root command cannot be executed in a production build of GOOGLE TV, which led me to go with Better terminal Emulator Pro.
GOOGLE TV & Better Terminal Emulator Pro V4.0.3 [UPDATE]
Hay guys, I was playing around some more with the terminal and I see that there ARE busybox commands present in the application.
I think the trick to rooting the SONY NSX32GT1 would be the CHMOD command. Entering this command while in the BASH shell when the emulator starts will give you the options for executing the command properly. if smeone can help me out with this command to change the permissions of the /system file system, that would be great. The CHOWN command may be of some use as well. I am almost 100 percent sure that if we change the permissions of the filesystem with one of these commands, we will be on our way to getting proper root access to out TVs!
If you are familiar with linux commands, please post a reply with the proper execution, and I will, in return, provide some very exclusive information about the television!
Here are some pics of the terminal up and running with busybox v1.16.2 built in.
i believe u may be speaking of commands like chmod -R 777 /system to give read write and execute permissions to user group owner .or chown root:root but to do any of that u must be root (the owner of most system files) or owner of said files in order to change owner group permissions and more. those commands come after a su or sudo in full bash. so u would still have to remount as rw. but the fact u got busybox installed is nice perhaps we can start looking at other root options if the busybox commands can be found during zerg or other overflow
Sent from my SPH-D710 using xda premium

[Q] Impossible to use ls -t from BusyBox

Hi,
Sorry if it's not the good forum, I have looked for the good one but I'm not very easy with English.
I want to sort out files by date in directories to delete automatically oldest backup files with a script. I have Cyanogenmod 11 on a Samsung Galaxy S2. I have installed Busybox (Stephen Stericson) on my phone from the Playstore to use the command ls -t because in standard we have only ls and ls -l. But when I tape ls -t, I have an error message "Unknown option". I've tried with Cyanogenmod 12 but I have the same problem.
I would want to know if ls -t doesn't function in BusyBox or if I have another problem.
Thank you.
No response :crying: .
Can somebody tell me if he haves a BusyBox which enables to use the command and which is this BusyBox : ls -t?
Thank you .
Are you sure you are using busybox?
try running: busybox ls -t
Ok, I have to type "busybox" first. I will try it, thank you.
Ok, it works when I add "busybox" in the command . I'm just a little surprised, I had understood the busybox commands replaced the shell commands.
You can also add: busybox sh
to your script and after that you could easily use ls -t without busybox.
Ok, thank you but it's not annoying to add "busybox". I don't create a lot of scripts .
Now I try to solve the problem to move files to the sdcard. It worked fine in 4.1.2 but with Cyanogenmod 11, I have a cross device link. I tried also "cp -p" to keep initial attributes but I have "Operation not permitted".

Categories

Resources