.bat (like) files - Galaxy 3 General

Is there a way to make .bat like files? Or another way to run presaved terminal commands?
Sent from my GT-I5800 using Tapatalk

You're talking about android terminal emulators or adb shell? If so, write »#/system/bin/sh« into the first line and your commands into the following lines of a text file. Give your file execute permissions when you're done. Give it any name you like.
Then just run it from a shell prompt as you would do with any other command.
If you want do delve deeper into this, ask your favorite search engine for "shell language", "Bourne shell" or "SUSv4 shell". There are control structures, variables, functions - anything you'd expect from a full-fledged computer language.
P.S.: SD cards are often mounted with no execute permission. If your command file lives there, run it using "sh /sdcard/filename".

Thanks a lot! Very helpful!
Sent from my GT-I5800 using Tapatalk

Related

root Tattoo with Mac

Hey Boys and Girls,
where i can find an manual to root the tattoo with a mac?
sorry, i have search for this, but i cant find information for this
I don't thing that there is a difference.
As soon as you have SDK installed and adb works, the commands are the same.
hi,
i'm also doing all the rooting process from mac, just put the directory contain 'adb' shell into your home/user places and executing it with 'terminal'..
Same here, using a Mac ever since and also using it for Android development. Due to the underlying Unix core of OS X you just have to follow the steps as described for Linux. If it's just adb commands it's the same on every platform anyway.
You might want to add a
Code:
export PATH=${PATH}:/Users/yourusername/android.sdk/tools
to your .bash_profile file in your home folder so you don't have to cd to the SDK tools folder everytime. Happy rooting!
Mod. edit: not dev related, moved to general
Okay thanks for yours answers but i'm a newbie.
the background story is, I want to edit the boot.mp3. Because the startsound is really annoying
So i have download SDK, open the terminal and switch to usb-debbugging mode on my tattoo.
And now? sorry, I'm still missing a few knowledge
thanks for your help
well just use the various adb commands in Terminal Just type in "adb", press enter and you'll get a list of all possible commands. Assuming you've added the path to your sdk tools folder to your bash profile. Otherwise just drag & drop the adb binary from the tools folder onto your Terminal window, et voila.
The most used commands are probably push and pull where you can, well, push stuff to your phone or pull it to your computer.
So if you want to modify the boot.mp3 you would pull the original from the phone to your computer, modify it and push it back, overwriting the original file. In Terminal speak: ;-)
adb pull /system/media/bootscreen/boot.mp3
adb push /path/to/boot.mp3 /system/media/bootscreen/boot.mp3
Please note depending on the ROM you're using the paths may be different. To browse the device via Terminal type in "adb shell" and make a simple "ls" to list the directories, "cd" to change directories etc.
Or if you just want to use another mp3:
adb push /path/to/whatever.mp3 /system/media/bootscreen/boot.mp3
Again, on the Mac you can just drag & drop files onto the Terminal to get their full Unix paths like to your custom mp3
Thanks a lot. i love it its really simple
and now i have load and edit the the boot.mp3. But i can't push it to my tattoo, because i can only read but not write
I have tried to root my phone with "adb root" but it is the message "adbd cannot run as root in production builds"
Terminal: "adb remount", then push again
damn the next bad message "remount failed: Operation not permitted"
You need to root your phone first.
http://forum.xda-developers.com/showthread.php?t=637927
Okay i have executed the instructions. But I've stop at this part:
You should get something like this:
Code:
# id
uid=0(root) gid=1000(shell) groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),3001(net_bt_admin),3002(net_bt),3003(inet)
uid=0(root) is important.
Click to expand...
Click to collapse
Yes i've root but i'cant download the "su binary" because its doesnt exist.
But its absolute essential to need the "su binary" to only copy the boot.mp3 to my phone? Or there is an other way? What are the commands to push the boot.mp3 back to may tattoo then i'm in the root mode like >> "#".
okay hope you understand me
You need "su" to do root stuff... no other way.
Download the package from 1 click root thread and find "su" there...
http://forum.xda-developers.com/showthread.php?t=644279
now, i have install the su binary. Then i does this command
user:~ user$ /Users/user/android-sdk-mac_86/tools/adb shell
$ /data/local/bin/su
#
Click to expand...
Click to collapse
And now? Is there a comand to push the boot.mp3 back to the phone in this mode >> "#" ?
I have try to open an new terminal window and type
adb push /path/to/boot.mp3 /system/media/bootscreen/boot.mp3
Click to expand...
Click to collapse
but the answer is
failed to copy '/Users/android-sdk-mac_86/boot.mp3' to '/system/media/bootscreen/boot.mp3': Permission denied
Click to expand...
Click to collapse
and adb remount doesnt work to
You also need tattoo-hack.ko file and do insmod tattoo-hack.ko to make /system writable.
Or even better... flash custom amon_ra recovery image and then a custom rom with all this already included.
Mine for example http://forum.xda-developers.com/showthread.php?t=702401
It doesnt have boot sound enabled
Okay thank you very much.
now it was successful

[Error] Unable to apply PUSH Command in ADB

Hello mates,
I am trying to Copy the BUSYBOX file to my /data/local/bin directory. But when i use the 'push' command it say adb: command not found. Hereby i have attached the image of my terminal.
Would you please help me in copying my files to the directory "/data/bin/local"
Also, where should i put the files which i need to copy. Eg. Since i need to copy 'busybox' to the /data/local/bin/, should i put the busybox in my Desktop, i.e. /home/android/platform-tools directory?
You should've not run the command from within the adb shell. Just go to the tools folder and type "adb push busybox data/local/bin" ofcourse without the ""
The busybox should be indeed be present in the folder from witch you run adb, in your case the "tool" folder.
Good luck!
Erwin
Sent from my HTC Wildfire using XDA App
@ErwinP.
Thanks for rectifying this mistake.
It worked.
You're welcome! I had to learn it the hard way myself, so I'm happy ik I can help someone! ;-)

[Q] Shell, terminal emulator, how to...?!

Greetings to all!
Can You tell me how can i use shell in WF, what can i do in/with shell, is shell useful for working with, where can i find commands for android shell...?!
I'v installed it but when i type "Su" there is no action only "command not found" also when i type some other commands...
You must be rooted and have Superuser installed to allow terminal emulator to access SU.
Im rooted!
Have you got the Superuser App? Because, at the very least, atleast the "su" command should work on the terminal emulator, irrespective of others.
Anyway, some read through threads for shell and it's commands:
http://forum.xda-developers.com/showthread.php?t=718264
http://forum.xda-developers.com/showthread.php?t=826769
Yes, i have...Thats why is strange for me...
I rooted WF on my Linux Ubuntu 10.10...
You'll need the android development kit from google. Extra the tools to your personal user bin folder. (~/bin) add into your path statement. Open interval in you should not have adb working. In the terminal using adb issue adb shell. You will now be in a shell on your phone through your computer
Sent from my Incredible using Tapatalk
I know about Adb using phone shell with my Pc but i dont want that, i thought that shell can use only with phone without Pc...To bad...
Or i didnt understand you...!?

ADB Pull Error

I am getting the following error when I try to pull a TWRP backup from my Nexus 4. Can anyone please help?
Code:
remote object '/sdcard/TWRP' does not exist
It doesn't exist there. /sdcard/ is really a symlink. The actual location is /data/media/0/TWRP, but try /storage/emulated/0/TWRP as well.
Next time type "adb shell" to go into the phone, then type:
find / -type d -iname twrp
this will search the entire phone for folders with the name TWRP and list their path.
/ is the root folder of the phone to search in
-type d means search for folders only, leave it out if you want to search for file names
-iname means to search for terms case insensitive
sent from xda premium app
Thanks for the help eksasol. I've tried to pull many different paths and they all return the same remote object does not exist error. I've even tried sudo adb pull, with the same result. I've tried this, find / -type d -iname twrp but, all I get is Permission denied. If anyone else has got some ideas I'd be happy to hear them. Thanks. :good:
If you are using Ubuntu or linux, typing 'find' only search what is in your PC. You get permission denied because you want to search in a root directly that required root permission.
To search for files in your phone, you need to log into your phone by typing "adb shell". TWRP give you root by default, then you can use the find command.
Since you have root by default in TWRP, you don't need to use sudo, also Android do not have "sudo" installed. The correct way to gain root privilege in linux (Android) is by typing: su -
To tell if you have are root, you should see # where your user name is in the command window.
Once you are done finding the path, you need to exit the adb shell in order to make contact with your PC, so just type exit. Only then you can start using "adb pull".
by the way, its "adb pull /data/media/0/TWRP/ \home\username\backup\"
Rememer in linux (Android), it's case sensitive.
OK, I see my mistakes now. I was not exiting adb shell when typing adb pull. Anyway, thanks to your help, everything is working correctly now. Thank you again, I really appreciate it. Now I can flash the 4.4 update safely.
eksasol said:
If you are using Ubuntu or linux, typing 'find' only search what is in your PC. You get permission denied because you want to search in a root directly that required root permission.
...
by the way, its "adb pull /data/media/0/TWRP/ \home\username\backup"
Rememer in linux (Android), it's case sensitive.
Click to expand...
Click to collapse
Thanks for helping me re-learn that linux (Android) is case sensitive

Execute code in a terminal emulator from application

Hi, I'm looking for a way to execute a couple of line of code through a terminal emulator.
Let me clarify,
I have an app that I want to execute the code by calling the terminal emulator and having it run that.
Obviously, I know that normally
Code:
getRuntime.exec()
would normally work, but for me that's not the case.
Any help would be greatly appreciated.
Are you capturing the command's response? stdio and stderr?
Sent from my SM-G925I using Tapatalk

Categories

Resources