adb weirdness - Galaxy S I9000 Q&A, Help & Troubleshooting

Hi all,
I recently installed JG5 on my SGS, but when I I do a directory list, I get all sorts of weird characters in the filenames;
Code:
ls *.apk
←[0;0mAccountAndSyncSettings.apk←[0m ←[0;0mMyFiles.apk←[0m
←[0;0mApplicationsProvider.apk←[0m ←[0;0mNetworkLocation.apk←[0m
←[0;0mAxT9IME.apk←[0m ←[0;0mOtaProvisioningService.apk
←[0m
←[0;0mBadgeProvider.apk←[0m ←[0;0mPackageInstaller.apk←[0m
←[0;0mBluetooth.apk←[0m ←[0;0mPersonalization.apk←[0m
←[0;0mBluetoothOPP.apk←[0m ←[0;0mPhone.apk←[0m
←[0;0mBluetoothServices.apk←[0m ←[0;0mPhoneCrashNotifier.apk←[0m
←[0;0mBluetoothTestMode.apk←[0m ←[0;0mPhoneErrService.apk←[0m
←[0;0mBrowser.apk←[0m ←[0;0mPhone_Util.apk←[0m
←[0;0mBuddiesNow.apk←[0m ←[0;0mPicoTts.apk←[0m
←[0;0mCSC.apk←[0m ←[0;0mPreconfig.apk←[0m
←[0;0mCallSetting.apk←[0m ←[0;0mRilFactoryApp.apk←[0m
←[0;0mCamera.apk←[0m ←[0;0mRoseEUKor.apk←[0m
←[0;0mCameraFirmware.apk←[0m ←[0;0mSecDownloadProvider.apk←[0
m
←[0;0mCertInstaller.apk←[0m ←[0;0mSettings.apk←[0m
←[0;0mChocoEUKor.apk←[0m ←[0;0mSettingsProvider.apk←[0m
←[0;0mClockPackage.apk←[0m ←[0;0mSetupWizard.apk←[0m
←[0;0mContacts.apk←[0m ←[0;0mSisoDrmProvider.apk←[0m
←[0;0mContactsProvider.apk←[0m ←[0;0mSnsAccount.apk←[0m
←[0;0mCoolEUKor.apk←[0m ←[0;0mSnsProvider.apk←[0m
←[0;0mDataCreate.apk←[0m ←[0;0mSoundPlayer.apk←[0m
←[0;0mDays.apk←[0m ←[0;0mStk.apk←[0m
←[0;0mDialerTabActivity.apk←[0m ←[0;0mStreet.apk←[0m
←[0;0mDivx.apk←[0m ←[0;0mSuperuser.apk←[0m
←[0;0mDlna.apk←[0m ←[0;0mSwype.apk←[0m
←[0;0mDownloadProvider.apk←[0m ←[0;0mTATLiveWallpapersAurora.ap
k←[0m
←[0;0mDrmProvider.apk←[0m ←[0;0mTATLiveWallpapersBlueSea.a
pk←[0m
←[0;0mDrmUA.apk←[0m ←[0;0mTATLiveWallpapersDandelion
.apk←[0m
←[0;0mDualClock.apk←[0m ←[0;0mTATLiveWallpapersOceanWave
.apk←[0m
←[0;0mEmail.apk←[0m ←[0;0mTalk.apk←[0m
←[0;0mEnhancedGoogleSearchProvider.apk←[0m ←[0;0mTalkProvider.apk←[0m
←[0;0mFMRadio.apk←[0m ←[0;0mTelephonyProvider.apk←[0m
←[0;0mFactoryTest.apk←[0m ←[0;0mTouchWiz30Launcher.apk←[0m
←[0;0mFlashPlugin.apk←[0m ←[0;0mTouchWizCalculator.apk←[0m
←[0;0mFlashSVGPlayer.apk←[0m ←[0;0mTouchWizCalendar.apk←[0m
←[0;0mGallery3D.apk←[0m ←[0;0mTouchWizCalendarProvider.a
pk←[0m
←[0;0mGlobalSearch.apk←[0m ←[0;0mTtsService.apk←[0m
←[0;0mGmail.apk←[0m ←[0;0mTwWallpaperChooser.apk←[0m
←[0;0mGmailProvider.apk←[0m ←[0;0mUNAService.apk←[0m
←[0;0mGoogleApps.apk←[0m ←[0;0mUserDictionaryProvider.apk
←[0m
←[0;0mGoogleCheckin.apk←[0m ←[0;0mVending.apk←[0m
←[0;0mGoogleContactsSyncAdapter.apk←[0m ←[0;0mVideoPlayer.apk←[0m
←[0;0mGooglePartnerSetup.apk←[0m ←[0;0mVisualizationWallpapers.ap
k←[0m
←[0;0mGoogleSearch.apk←[0m ←[0;0mVoiceRecorder.apk←[0m
←[0;0mGoogleSettingsProvider.apk←[0m ←[0;0mVpnServices.apk←[0m
←[0;0mGoogleSubscribedFeedsProvider.apk←[0m ←[0;0mWlanTest.apk←[0m
←[0;0mHTMLViewer.apk←[0m ←[0;0mWriteandGo.apk←[0m
←[0;0mIcsService.apk←[0m ←[0;0mYouTube.apk←[0m
←[0;0mInfoAlarm.apk←[0m ←[0;0mase_mcr_r25.apk←[0m
←[0;0mInputEventApp.apk←[0m ←[0;0mcom.google.android.apps.ma
ps.apk←[0m
←[0;0mLbsTestMode.apk←[0m ←[0;0mcom.google.android.voicese
arch.x.apk←[0m
←[0;0mLiveWallpapers.apk←[0m ←[0;0mcom.keramidas.TitaniumBack
up.apk←[0m
←[0;0mLiveWallpapersPicker.apk←[0m ←[0;0mcom.layar.apk←[0m
←[0;0mLogsProvider.apk←[0m ←[0;0mgtalkservice.apk←[0m
←[0;0mMagicSmokeWallpapers.apk←[0m ←[0;0mlcdtest.apk←[0m
←[0;0mMarketUpdater.apk←[0m ←[0;0mserviceModeApp.apk←[0m
←[0;0mMediaProvider.apk←[0m ←[0;0mshutdown.apk←[0m
←[0;0mMediaUploader.apk←[0m ←[0;0msignin.apk←[0m
←[0;0mMms.apk←[0m ←[0;0msyncmldm.apk←[0m
←[0;0mMobileAP.apk←[0m ←[0;0msyncmlds.apk←[0m
←[0;0mMobileTrackerEngineTwo.apk←[0m ←[0;0mthinkdroid.apk←[0m
←[0;0mMobileTrackerUI.apk←[0m ←[0;0mwipereceiver.apk←[0m
←[0;0mMtpApplication.apk←[0m ←[0;0mwssomacp.apk←[0m
←[0;0mMusicPlayer.apk←[0m ←[0;0mwssyncmlnps.apk←[0m
$
First of all, it's really weird that it does the listing in a two-column format, and secondly... what's with all those weird characters? They don't show up in Terminal Emulator on the phone itself, and the correct file names are still recognised if I type them in.
Anyone have any idea?
Thanks,
unfunk.

Those are color codes for the terminal. ADB (at least for Windows) doesn't support such color codes.

OK, so why am I seeing them? I never saw them until this last flashing.
...also, is there a way to hack colour code support into adb for Windows? That would be sweet.

Related

adb output

Hi guys,
when i use the shell's ls command i get different outputs depending on if i use my htc phone or the android emulator.
example:
emulator output: tty41
phone's adb output: [1;35mtty41
i used adb for the same folder.
where do these strange symbols (they look different when using the shell than online) come from? they make interpreting the output data hard...
fabsn said:
Hi guys,
when i use the shell's ls command i get different outputs depending on if i use my htc phone or the android emulator.
example:
emulator output: tty41
phone's adb output: [1;35mtty41
i used adb for the same folder.
where do these strange symbols (they look different when using the shell than online) come from? they make interpreting the output data hard...
Click to expand...
Click to collapse
This goes in Q&A, and also you spelled linux wrong in your signature
ok, if any mod reads this: pls move the topic to Q+A
First I'll say the obvious of course. Questions belong in q&a section. To answer your question though. It probably is related to the way the windows cmd.exe handles linux formatting. Personally I don't like to use adb w/ windows unless just doing basic things because of this. As an examples using the 'less' command, 'vi', or 'bash' (although that could be my bashrc file) all get corrupted output using adb from windows (xp at least). These all work fine using adb from linux.
You can use an alternative terminal tool like ConEmu. ConEmu works better than the default command line with adb.

[Q] How did I screw up the "ls" command in adb shell?

I don't know how I did it. I don't even know if it's a windows 7 thing, or a adb shell thing. But...
When I open adb shell and enter the "ls" or "ls -l" command, it returns the name of the file/dir in a strange format. Instead of just the name like "sdcard" I get:
<-[1;34msdcard<-[0m
I'm pretty sure it didn't always do this, so I must have enabled a switch somewhere (or I'm misusing the "ls" command). I do not have this problem with Terminal Emulator on the Captivate itself... just when using ADB shell on a Windows 7 machine. How do I turn this off? Any help would be greatly appreciated.
Thanks!
dc41 said:
I don't know how I did it. I don't even know if it's a windows 7 thing, or a adb shell thing. But...
When I open adb shell and enter the "ls" or "ls -l" command, it returns the name of the file/dir in a strange format. Instead of just the name like "sdcard" I get:
<-[1;34msdcard<-[0m
I'm pretty sure it didn't always do this, so I must have enabled a switch somewhere (or I'm misusing the "ls" command). I do not have this problem with Terminal Emulator on the Captivate itself... just when using ADB shell on a Windows 7 machine. How do I turn this off? Any help would be greatly appreciated.
Thanks!
Click to expand...
Click to collapse
ugh, this isn't garbage information or a mistake. this is windows command prompt (which isn't a proper terminal emulator) not being able to deciper the color coding techniques used in *NIX shells.
all these odd numbers are are simply color coding to "prettify" the shell if you're using a *NIX shell
Kaik541 said:
ugh, this isn't garbage information or a mistake. this is windows command prompt (which isn't a proper terminal emulator) not being able to deciper the color coding techniques used in *NIX shells.
all these odd numbers are are simply color coding to "prettify" the shell if you're using a *NIX shell
Click to expand...
Click to collapse
Thanks for the info! Now that I know what's going on, I should be able to find solution on the web.
Thanks!
dc41 said:
I don't know how I did it. I don't even know if it's a windows 7 thing, or a adb shell thing. But...
When I open adb shell and enter the "ls" or "ls -l" command, it returns the name of the file/dir in a strange format. Instead of just the name like "sdcard" I get:
<-[1;34msdcard<-[0m
I'm pretty sure it didn't always do this, so I must have enabled a switch somewhere (or I'm misusing the "ls" command). I do not have this problem with Terminal Emulator on the Captivate itself... just when using ADB shell on a Windows 7 machine. How do I turn this off? Any help would be greatly appreciated.
Thanks!
Click to expand...
Click to collapse
I've never had this happen when I use the adb shell on my Win7 machine. Which distro are you using? I have Home Premium x64.
miztaken1312 said:
I've never had this happen when I use the adb shell on my Win7 machine. Which distro are you using? I have Home Premium x64.
Click to expand...
Click to collapse
Ultimate 64, but like I said, it wasn't always like this. Some point in the lady week I must have changed a setting or something. Now I just have to figure out what I did and how to undo it.
I am guessing you switched ROMs? Seems to be the color setting in some of the ROMs on the LS command. It is not a windows bug, any terminal/shell that doesn't support colored directory/file names will give you this behavior.
See this thread for a fix:
http://forum.xda-developers.com/showthread.php?p=7714491
I have been having this issue since I upgraded to JH3 and SRE 1.2.1a (which included a new busybox 1.17.1 and proper symbolic links). SRE 1.2.1a also remove the stock ls command. I did not start looking into fixing it until tonight. Setting an alias for every adb shell session is annoying. Android does not include any of the profile start scripts like linux does or we would be able to stick an alias in some place like a .bashrc or /etc/bashrc.
Here is a permanent solution. I normally have a permanent alias setup on my linux machines with the switches below, you can modify the switches to your liking.
create a file in notepad with the following:
"ls -alh --color=never [email protected]" do not include the quotes.
Note the switches I am using:
a = show all files including hidden (the ones that start with a "." as a prefix on the name)
l = show files in long listing format/layout
h = show file size in human readable format eg and 1k instead of 1000.
Save the file as "ll" without an extension. You can use another name if you wish.
Use adb to push the file into /sdcard then adb shell to copy it to /system/xbin or copy via root explorer.
#assuming ll is in your SDK tools folder - move to sdcard
adb push ll /sdcard
#move to xbin folder
adb shell
su
mv /sdcard/ll /system/xbin/ll
I didn't touch the permissions (its working with -rw-rwxr-x) but just in case you can set permissions on the file.
chmod 755 ll
I rebooted my phone and I was still good to go using "ll" from adb shell.
adb shell ll
or adb shell
$ll
enjoy.
Mine does the same, looks nice when I am using on Ubuntu. I had flashed JH3 + SRE 1.2.1a also.
Did you try using the "dir" command? I think it comes with busybox 1.7.1. That one outputs fine for me when I am using the cmd prompt. Only little quirk is that I have to remember not to use ls when logged on Win7.
color codes were removed in SRE 1.2.2a: http://forum.xda-developers.com/showthread.php?t=751934
tikidroid said:
I have been having this issue since I upgraded to JH3 and SRE 1.2.1a (which included a new busybox 1.17.1 and proper symbolic links). SRE
Click to expand...
Click to collapse
Your fix worked perfectly for me!
Thanks!
tikidroid said:
Here is a permanent solution. I normally have a permanent alias setup on my linux machines with the switches below, you can modify the switches to your liking.
create a file in notepad with the following:
"ls -alh --color=never [email protected]" do not include the quotes.
Click to expand...
Click to collapse
Ahhh.... thank you so much for this post. This has been driving me crazy for a few hours, and I almost considered putting an alias to ll in init.rc (but I much prefer this less invasive method)
Useful workaround, thanks. Still needed, some two years later!

[Q] Please help me use adb to root JI6 on a mac!!

I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Ok, so if you can see your phone through adb, then you are definitely on the right track. Unfortunately, I'm not really familiar with OS X anymore so I'm not quite sure how to do it. Just sit tight for now until someone who does use a Mac, or has more of a clue then I do can help you out.
But seriously, don't pull your hair out. It won't stay on your head forever ya know...
Edit: oops, just saw this is JI6 (Froyo) not JF6, so I can't help you, but here is a general overview:
from terminal inside Android sdk main directory:
tools/adb devices -> list all devices connected that ADB can see
tools/adb shell -> gets a normal user shell on your phone
tools/adb reboot recovery -> reboots into recovery mode, suitable for update.zip root method
--------------------------------
Place the root update.zip on internal sdcard.
from terminal inside Android sdk directory:
tools/adb reboot recovery
Select the update software option, and you will be done.
laxwillsch said:
I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Click to expand...
Click to collapse
Start simple:
If you open a terminal on the mac, and go to your android SDK tools folder; what happens when you type ADB shell?
Or if you type any of the ADB push commands?
You need to give more detail around what you are seeing for us to help you.
Ok so if I am in terminal and i type in my /android-sdk-mac_x86/tools nothing happens and it just says /android-sdk-mac_x86/tools is a directory. But if I type the same but with /tools/abd it opens the abd command lines, like how to write code. Then when I try to "adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin"
it says "-bash: adb: command not found"
however when I type laxwillsch$ /android-sdk-mac_x86/tools/adb shell
it does give me the drop down $
but when I then try to write the next line of code "chmod 0755 rageagainstthecage-arm5.bin"
it says "chmod: rageagainstthecage-arm5.bin: No such file or directory"
I am stumped I am beginning to think i need to buy a pc as I am very interested in android development and want to learn more, but it seems all the tutorials are run assuming you are on a PC
EDIT** I have downloaded the android SDK started pack, and the 2.2 root pack and they are all in my /android-sdk-mac_x86/tools folder that is directly on my Macintosh HD for simplicity
Do you know how to change directories (cd command)?
The problem is that you are trying to work in one directory, but all your tools are in another.
So change directories to the tools directory:
cd /android-sdk-mac_x86/tools/
now run your adb commands - you may have to type ./adb to tell your mac to look in the current directory for the adb command (that is what ./ means "start here")
Also, try to understand what is happening so you can more easily troubleshoot: chmod is a command to change permissions, and you are running it on the phone. If you can't push the file to the phone, then you can change it's permisssions. I guess you never got rageagainstthecage on the phone, so there is no way to chmod it.
If you can't do this on a mac, a PC is not easier. I use both, and like both, but you need to learn basic commands first - they apply to the mac terminal and the windows cmd prompt.
Getting root means moving in and out of the phone - adb shell - puts you in a terminal on the phone. So you really need to understand cd (change directory); pwd (present working directory - shows you where you are); cp (copy); and know your current path - what the ./ does.
I hope this helps, not trying to sound condescending - maybe practice a linux terminal tutorial would help
Thanks so much, I am at school right now and cant test out all that but you are really helping me understand all this! I will post tonight and let you know how it goes. again thank you
ok so i dont have my usb cable with me but I was playing around with the commands that you suggested and ureka! i finally got to a point where it says "h70-33-65-19:tools laxwillsch$" thats a first! and when i type pwd it shows "/android-sdk-mac_x86/tools" so that means I am working out of the right directory right? and from here I enable usb debugging connect my phone then just copy and paste the codes from the thread correct?
yes, it sounds like you are on the right track. But take it nice and slow when you follow the steps. It is very important that the commands are entered exactly as you see them.
Also, one step tells you to wait for something to run and kick you out of ADB - wait just like it says - takes about 45 seconds but feels like forever.
If you are in the tools directory - just by typing "adb" no quotes will give you whole page of adb commands - if you get a "command not found", then you need to add the ./ and make it ./adb
Hope this helps and again, read the commands step by step a couple times first so you understand what is happening.
In a nutsell, you push the rage file;
change its permissions, run it;
get kicked out of ADB and then open a new ADB shell;
you are now root;
remount the system partition to give you write access when it reboots;
reboot;
push over some files;
change permissions on files you pushed;
reboot;
Some things to know - SU is a command for gaining root access; when you use SU your prompt changes (in adb shell) from $ to #
If you are succesful you should see the SuperUser app listed in your apps.
Done and Done just rooted successfully couldnt have done it without you! thanks so much

[Q] output of 'adb devices'

All,
I follow the http://forum.xda-developers.com/showthread.php?t=532719 to setup the adb. Here is my output:
D:\>cd D:\Program Files\Android\android-sdk-windows
D:\Program Files\Android\android-sdk-windows>cd platform-tools
D:\Program Files\Android\android-sdk-windows\platform-tools>adb devices
List of devices attached
I89613ba062a device
D:\Program Files\Android\android-sdk-windows\platform-tools>adb shell
$
Does the output look correct to you? Note that I got '$' instead of '#' prompt, is that ok?
My PC assign two drive letters for the phone's SDs. The phone is a Samsung I896(from Rogers)
I have installed the latest JDK 6 and the latest Android SDK from the respective main site.
thanks,
That looks to be correct. The $ sign means you are running the standard shell. The get to the #, you need to typ 'su' without ticks. Then make sure you allow that on your phone for superuser priviledges. Now you will be the root and you will see the # prompt.
My comptuer also gives two drive letters. One for the internal, the other for the external SD card. However in shell when you cd /sdcard, I believe it goes to the internal card.
Cappy is found by adb and yes the $ is what you should see - so looks good
trekie86 said:
... The $ sign means you are running the standard shell. The get to the #, you need to typ 'su' without ticks. Then make sure you allow that on your phone for superuser priviledges. Now you will be the root and you will see the # prompt...
Click to expand...
Click to collapse
A followup question, I type the su and got the following:
su: not found
does this mean that I need to 'root' the unit first before getting the '#' prompt?
sorry for the noob question
cheve said:
A followup question, I type the su and got the following:
su: not found
does this mean that I need to 'root' the unit first before getting the '#' prompt?
sorry for the noob question
Click to expand...
Click to collapse
No, that's a very good question. I'm still new to this as well. The reason you can access su is because you need to install busybox. Sorry I don't have the market place link. There are plenty of posts about it around here. So you need to install busy box, run it's utility, then you will have options like su available. The shell through adb is a very stripped down unix shell. Hope that helps.
Oh, and yes. You would have to root the unit to get su permissions. If you aren't doing anything that requires elevated permissions, you can still use adb for push/pull of data.

[Q] Pull data with broken screen

Hello,
I googled and searched the forum but none o the threads apply to my problem as far as I can see. :/
So my old phone finally dies more or less... and I am trying to get the picture from the internal storage.
My setup: I9000, running CM11 (not sure which nightly exactly), rooted, BUT usb-debugging could be off I dont know for sure.
I can go to recovery mode but as the screen is broken I am limited with my actions. So using
Code:
adb devices
I can see my device
Code:
<long number here> recovery
Here is what I tried:
Code:
adb pull / H:/backup
This does not work because after a short while it aborts with an error message: "... no such file or directory"
Using
Code:
adb shell
followed by cd sdcard gives me a "cant cd to sdcard"
If I try to cd into other directories they are empty when trying to list them with ls.
su is also not found but adb root shows that it is already running as root.
Afterwards I tried Android Commander but that also did not work for me because Android Commander did not show my device and it also crashed after a while.
To make a long story short I am desperate...
What else can I try to get my data?
push
no one?
SaphirX said:
push
no one?
Click to expand...
Click to collapse
I don't think you can just PULL the whole "/" partition. The long number you listed there is likely to be your IMEI number (Just a guess).
EDIT: You might want to check this out: http://stackoverflow.com/questions/19225467/backing-up-android-device-using-adb

Categories

Resources