CLI on the nexus? - Nexus One Q&A, Help & Troubleshooting

can you enter the phone with a CLI on the nexus? CLI=Command Line Interface.... that is to say... can i connect to the device and manipulate its programming through commands?
hope nobody gets mad but what about the iphone?

magicalan said:
can you enter the phone with a CLI on the nexus? CLI=Command Line Interface.... that is to say... can i connect to the device and manipulate its programming through commands?
hope nobody gets mad but what about the iphone?
Click to expand...
Click to collapse
You can SSH into your phone as well as use a terminal emulator for shell. You also have the ability to use ADB.
Are these not what you are asking about?
Yes, you can do the same with an iphone. You can ssh into your iphone and use the mobile terminal app.

Related

[Developement] Computer App to Control Phone

i know we have a few applications that allow us to use our phone's screen and keyboard to control our computer, and while it is cool, it's just not something that i have a use for currently. i was wondering if there were any apps that you know of that allow me to have a window on my comp that is my home screen on my phone and control things on the phone from the comp. i hate when i am working on my themes and i get 100 texts and i have to go from using the comp it using the phone and back and forth. WM had several apps like that and i loved them when i was running windows but now i run linux(ubuntu 8.10) and i would love to be able to type texts and run apps on my phone while using the computer keyboard.
i have looked through the market and can't seem to find anything on there and i was hoping someone could point me to one elsewhere or if i missed one on the market. thanks in advance
That would be cool. A VNC Server has already been ported to iPhone, so it's probably not too difficult for someone who knows what they're doing (i.e, not me =P)
It would definitely be great to be able to type text messages and whatnot using the computer's keyboard and screen instead of that tiny little G1 keyboard.
or if there are some commands i can run from adb shell that would work too, all i have been able to figure out how to do is play an mp3 on the phone by typing the command. cool but not what i would like.
alright, for those that care i have figured out how to start an app on the phone by using the adb shell commands, and i can even start to compose a text if i do it correctly
to start the messaging app you need to type in the adb shell(or android terminal but the point is to be able to do it from the comp
adb shell
am start -a android.intent.action.MAIN -n com.android.mms/com.android.mms.ui.ConversationList
the above line brings up the conversation list to allow you to choose a list, but i have yet to figure out how to atually pick a convo from that page
to bring up the compose message to start a new text type in the following
am start -a android.intent.action.MAIN -n com.android.mms/com.android.mms.ui.ComposeMessageActivity
from there i can input the number to send the message to but not what i want the text to say,
input text <string> #that inputs a single word and no more after the word text
so if i were to type
'input text hello android' my phone would act as if i had just typed hello, this also works on the home screen to search your contacts. i am working on in[utting more than one word and also choosing your conversation from the comp
Cool! nice progress. Maybe other Android intents can be used...
progress
i know i can start any app by knowing the commands for it now and typing it in. but for right now my main concern is getting a multi word string to appear in the text box. if i can get that then i just need to figure out how to attach "input keyevent 66" to it as well so it runs cleanly. key 66 is the enter key and i figured out several others along the way but i will list them later. i pulled the input file from the /system/bin directory and maybe someone else should have a look at it and figure out how to acheive multi word texts without placing "_" between all the words, cause right now that's where i'm at. i'm attaching the file for the guru's to take a look at. obviously it isn't saved as a .txt file on the phone but that's how i uploaded it to here.
CALLING THE ANDROID GURU'S TAKE A LOOK AT THIS
Cool. Once you figure out a bunch of commands, I could try making a user interface for it as a project...
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
juangil said:
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
Click to expand...
Click to collapse
Im not sure if you know that your posting in a forum dedicated to the G1/android but MPT supports, as the name would suggest, motorola phones only.
juangil said:
just wanna drop this lines here, there is an app from motorola MPT Motorola Phone tools, and it does all that you want and more, the phone can be connected to the pc via USB or Bluetooth... you can send receive msg, phone calls, see and edit contacts, drop images, ringtones browse the files etc
Click to expand...
Click to collapse
does said program work with the G1? i can't imagine moto being nice and making a program that works for everyone else's phone
kp126 said:
Im not sure if you know that your posting in a forum dedicated to the G1/android but MPT supports, as the name would suggest, motorola phones only.
Click to expand...
Click to collapse
yeah I know, my bad.. just wanted to put an example of an app (that of course is only for motorola) for any1 wanting to do something like it
i know there's several out there for different phones, but nothing for android. hell i'd be satisfied if i could just have the emulator read from my phone and let me control it that way. right now i don't like what i have to do to send a text
input text hello
input keyevent 62
input text android
input keyevent 66
that is a whole lot of typing for a simple text that says "hello android" and then sends it
would it be possible to write a program that takes what you type and breaks it into one word or one letter segments and runs the proper keyevent for each charecter there?
from what i remember of my programming in java and visual basic from years ago is that it would basically be set to read an input and use a case method to say if $input=="hello" then adb shell input text hello. it would be easier i would assume to just break it down into words and place "adb keyevent 62" between each word to input the spaces, and at the end of the line of input you would have to have the code "input keyevent 66"
i have the keyevent mapped out for each button and such on the phone if anyone is interested. i will see what i can come up with on my own though for now
Hope!
I would <3 who ever release's this in some form or another =)
I could really use an application that lets me use my phone from my computer. Preferably it'd show the desktop of the phone, and allow remote access to all the features.
I don't know if it's possible, but it sounds like some of you are progressing, so I hope for the best.
that is the goal, but right now i think i want to just get a java script written by the end of the week next week that reads the key i press on the computer and inputs it into the phone. so i have a lot of relearning to do since i haven't written javascript in 4 years and even then it was just simple stuff to be run in a console. if someone wants to take whatever i get done and run with it to make a FREE APP then by all means. if i find my work in a paid app then you better hope the US gov't can't find you cause i'll be at your door ready to kick your ass.
i'm not sure how one would go about coding the computer to display the phone desktop, but however it gets done i would prefer it to be written in java so all users of linux, mac, and windows can use it.
alright i have found a program that allows me to display the phone screen on the computer using java *hooray* but it does not switch to landscape when the phone does, and i can't control the phone from the app. it was written so that people could do presentations with the phone instead of using the emulator. the gist of it is described here
http://groups.google.com/group/cw-android/browse_thread/thread/d2dbcabee6bcba1a
i have already emailed the developer asking politely to see the code and for permission to try and run with it to make the ideal app. at this point the only thing i could come up with would be to make a javascript that had a case for each key on the keyboard and when a key is pressed it sends the corresponding command(adb shell input keyevent ##) to the phone. this would work fine to use the arrow keys to control the phone, and i am not sure how to code the mouse into it yet. i will be waiting for a response from the dev hopefully he will give his permission and blessing for us to use the app.
Tubaking182,
Perhaps I could offer some help. Brad Fitz has written a program that injects keys into the Linux input layer. Perhaps the source code to his project can help you. It appears to contain a key code map. Here is the link to his code:
http://github.com/bradfitz/android-misc/blob/master/type.pl
Also, here is a link to his live journal entry regarding his program.
http://brad.livejournal.com/2400054.html
All of this would be wonderful to have with my G1. I wish all involved the best of luck!
the developer of the program i posted gives his blessing but he claims what we are trying to do is impossible without certain firmware. he claims that android does not support remote control. i have already proven it can be done though but you have to use keyvalues instead of the mouse. i don't know much java, but i know i need a case switch that executes adb shell input keyevent when i press a key on the computer. if someone wants to tell me the proper syntax and java command to run a run a command then awesome i can write this up *hopfully* and start testing it.
would it work if i typed it as
int key = evt.getKeyCode();
switch (key){
case 65: run.exec(adb shell input keyevent 29);
break;
what would be the proper way to execute the adb command
tubaking182 said:
the developer of the program i posted gives his blessing but he claims what we are trying to do is impossible without certain firmware. he claims that android does not support remote control. i have already proven it can be done though but you have to use keyvalues instead of the mouse. i don't know much java, but i know i need a case switch that executes adb shell input keyevent when i press a key on the computer. if someone wants to tell me the proper syntax and java command to run a run a command then awesome i can write this up *hopfully* and start testing it.
would it work if i typed it as
int key = evt.getKeyCode();
switch (key){
case 65: run.exec(adb shell input keyevent 29);
break;
what would be the proper way to execute the adb command
Click to expand...
Click to collapse
I've been doing Java for about 4 or 5 years now, nothing to fancy, but anyway,
Code:
int key = evt.getKeyCode();
switch (key)
{
case 65:
Runtime.getRuntime().exec("adb shell input keyevent 29"); // I dont know if this is what you "run" variable is referring to. and you would need quotes around your command as it takes a String parameter.
break;

How to determine current CPU Speed?

Hey there,
I'm wondering if my CPU is ramping up and stepping down appropriately. Is there an ADB command that can be ran at any time to see what the CPU speed is set to? I tried dumpsys but it wrapped my screen so fast I couldn't find anything. basically it took a dump on me literally. Should have expected that.
I'd like it to be in ADB as that way I can check when the screen is off and keep from interacting with the screen as I'm sure that would ramp it up to full speed. Thanks!!
****EDIT*****
Found what I was looking for from an ADB standpoint, although I would still like to know how to do it from DDMS also, as that tool is my new friend.
1. start a shell session (adb shell),
2. then run "cat /proc/cpuinfo" to get the BogoMIPS.
And then your good friend the up arrow to save some typing
Go into tools directory and just run ddms, not adb. Should open up a convenient window. Lotsa goodies in there.
i am interested in this as well, or maybe even an app that shows what the current clock is, like on windows mobile i used homescreen ++ to show in the system tray what the cpu was doing.
but then again, i used to watch that and obsess over it so maybe that's a bad idea
HeroMeng said:
Go into tools directory and just run ddms, not adb. Should open up a convenient window. Lotsa goodies in there.
Click to expand...
Click to collapse
Wow, what a wealth of cool info!
However, I'm still enough of a noob to this particular tool that I can't find the CPU speed. Can you steer me in the right direction HeroMeng or others? Thanks!!
****EDIT*****
Found what I was looking for from an ADB standpoint, although I would still like to know how to do it from DDMS also, as that tool is my new friend.
1. start a shell session (adb shell),
2. then run "cat /proc/cpuinfo" to get the BogoMIPS.
And then your good friend the up arrow to save some typing
awesome tip!

Need help regarding remote connection

Ok so this is the scenario i have 2 computer at 2 different locations (Home and Office). On my main computer there is software which i would like to use on my another computer simultaneously. Like i am using the software on my home computer(Main PC) and brother wants to use the same software at our office, so i have created 2 users on my main PC and i would like my brother to use 2nd user to login remotely and use that software. Let me tell software has capability to be used at 2 place simultaneously.
Waiting for your help
Thankyou
Omg is that so much difficult, ,, no reply yet.
Sent from my HTC Desire using XDA App
umm, yeah its possible. all you need is a citrix server ( or similar ), i think there area few bits of software that do work on desktop machines. but i can't remember any of the top of my head. i know i have iraap for my mac, i will take a quick look for you now. But a quick warning if you wanting to do this over the internet. its going to be much harder working out port forwarding ETC over doing it in a lan enviroment. so you possible could use hamachi. ok i'll get back to you in a bit.
and yes this is quite an advanced thing todo. what your technically trying to do is create a server in which multiple members can connect to and do things simultaneously. so your not going to want to do this very much as it will cause a reasonable amount of strain on your system and certainly slow it down. if you are going to do this alot i would recommend investing on a cheap server
ok check this out, fire me off a pm if you need any help. i'm happy to help
Unless your computer is setup as a server (or hacked to allow so) you're only allowed one desktop connection at a time?
Please someone correct me if I am wrong?
Edit: NM, people replied whilst I had the page open without refreshing....
captainstu72 said:
Unless your computer is setup as a server (or hacked to allow so) you're only allowed one desktop connection at a time?
Please someone correct me if I am wrong?
Edit: NM, people replied whilst I had the page open without refreshing....
Click to expand...
Click to collapse
just thought you might be intrested. i believe normally a windows machine will allow remote desktop connections, which means you can control the computer from another machine, very much similar as vnc. but a terminal server (citrix) allows multiple users to connect and run completely seperate sessions, but there are program that run the services needed to run terminal server witout a full blown server operating system.
just thought i would clear this up for you
I udnerstand that part, but as his PC is likely to be a standalone windows enviroment, and with him working on it, his brother will not be able to log in from the second location, as standard, due to that policy. I know there is a dll that can be hacked to allow it though. I have an understanding the RDP side, but he is using a windows machine not a terminal server/virtualised server etc, so from my perspective, his question was is it possible as is, not how do I make this possible by throwing money at it.
captainstu72 said:
I udnerstand that part, but as his PC is likely to be a standalone windows enviroment, and with him working on it, his brother will not be able to log in from the second location, as standard, due to that policy. I know there is a dll that can be hacked to allow it though. I have an understanding the RDP side, but he is using a windows machine not a terminal server/virtualised server etc, so from my perspective, his question was is it possible as is, not how do I make this possible by throwing money at it.
Click to expand...
Click to collapse
no these are completely free peices of software that require no dll hacking, they create there own server services that replicate terminal services.
Thanks for the help slamming, but i must tell you i am a noob concerning this.
I have checked out the link. Can you be more specific without all the jargons how should i go about achieving it,i would be really grateful.
samy.3660 said:
Thanks for the help slamming, but i must tell you i am a noob concerning this.
I have checked out the link. Can you be more specific without all the jargons how should i go about achieving it,i would be really grateful.
Click to expand...
Click to collapse
ok well, what your are wanting to create is a terminal server, this is used alot in enterprise and it allows multiple user to connect to the same machine and use all the same applications and share data. But in enterprise they will use a machine called a thin client, this machine will boot straight from the network and connect to the terminal server. but you aren't going to want to buy a thin client so you are going to have to download another application on the second computer. but we will come to that later. what i think would be a good idea is if you were to read up on terminal services, terminal servers and maybe even thin cleints, as i think you do need to be able to understand the majority of the jargon that is going to be used. i would recommend you don't under take this task if you don't have quite abit of time or aren't confident in your IT skills
slaming said:
ok well, what your are wanting to create is a terminal server, this is used alot in enterprise and it allows multiple user to connect to the same machine and use all the same applications and share data. But in enterprise they will use a machine called a thin client, this machine will boot straight from the network and connect to the terminal server. but you aren't going to want to buy a thin client so you are going to have to download another application on the second computer. but we will come to that later. what i think would be a good idea is if you were to read up on terminal services, terminal servers and maybe even thin cleints, as i think you do need to be able to understand the majority of the jargon that is going to be used. i would recommend you don't under take this task if you don't have quite abit of time or aren't confident in your IT skills
Click to expand...
Click to collapse
Ok i will learn it by tommorow all i could about terminal services, and do you think if there is a software available which will be able to this, preferably free, or if not i wont mind paying for it.
Thankyou.
samy.3660 said:
Ok i will learn it by tommorow all i could about terminal services, and do you think if there is a software available which will be able to this, preferably free, or if not i wont mind paying for it.
Thankyou.
Click to expand...
Click to collapse
alright then while your learning about terminal server, i will begin looking into software for you for both ends both server and cleint.

Use PC keyboard/mouse on Phone

I see lots of people using their phones to control their computer....
Is there any way to do this the other way around?
Like I wanna use my mouse and keyboard to control my phone
Via bluetooth or some other means?
EDIT: did more searching and found this
http://forum.xda-developers.com/showthread.php?t=557717
ive only seen it done on the computer end. i used an app called web key for hero witch will let u completly control your hero from your computers web browser.
yeah that app I linked in the OP looks pretty cool, However my "adb" commands only work from within the Boot menu... I can't do adb devices while my phone is up and running android.

Ubuntu for Vivid

Saw a thread a while back asking about the super-cool Ubuntu for Android on the Vivid. Unfortunately, we'll probably never see this for the Vivid, but we do have a comparable alternative...
Using the images from the Linux on Android Project we can run a virtual instance of Ubuntu and VNC into it.
This will probably work on any ROM, so long as you're rooted with busybox.
Before we start, install android-vnc-viewer and Android Terminal Emulator. Other VNC / Terminal apps will probably work, but the following instructions will be for these apps, specifically.
Okay, now...
Make an "ubuntu" directory on your SD card (internal/external, doesn't matter. You'll need at least 3 gigs of space though). For the purpose of these instructions, I'll refer to it as /sdcard/ubuntu.
Grab this script and unzip it as /sdcard/ubuntu/ubuntu.sh
Then download either (or both, whatever) the full-sized, Gnome-based image, or the smaller, LXDE image. Unzip as /sdcard/ubuntu/ubuntu.img
Open up Terminal Emulator, type "su" and hit enter. A superuser prompt will pop up (or that SuperSU thing, whatever you use). Accept/Agree/Whatever to allow root.
Now you're at a root shell. Go to your ubuntu directory by typing "cd /sdcard/ubuntu" (/sdcard/ext_sd/ubuntu for external card) and pressing enter.
Type "sh ubuntu.sh" and hit enter. This will start the launch script.
When it asks for a screen resolution, type "960x540" (the resolution of the Vivid).
A bunch of stuff will fill the terminal. When you see "[email protected]:/#", celebrate! You have Ubuntu running!
Now, unless you want CLI only... hit your home button (leave terminal running in the background) and launch android-vnc-viewer.
Enter whatever for the nickname, and the following settings:
Password: ubuntu
Address: localhost
Port: 5900
Color Format: 24-bit color (4 bpp)​
Now click "Connect" in the top-left corner. Hopefully you'll see Ubuntu! Now add a bluetooth keyboard/mouse and an MHL, and proceed to rubbing it in your Apple-fanboy-friends faces.
When you're done, head back into Android Terminal Emulator and type "exit".
NOTES:
I don't take credit for any of this. This is 100% Zachary Powell et al @ the Linux on Android Project.
I really don't see how anyone could screw a phone up with this, but standard disclaimer applies. I'm not responsible for anything, anywhere, ever.
This post is kind of long, but this is really super easy. Good luck!
The problem is this need this loop support in the kernel and none of the kernel people in this thread responded to my request for it.
Kernel stuff was not my cup of tea so never could get this running
Works perfect on Virtuous, which uses the Faux kernel. I don't know of any kernels that DON'T support loopback, which is why I said it should work on just about any ROM. Haven't tested on any others though.
Did this aeons ago. It works flawlessly, but the GUI is mad slow. Works fine for command-line business, though.
Cool story. It's been out for less than six months, but I guess that could be aeons. This is for people who haven't seen it.
Also, the GUI is extremely fast. With an MHL it's totally usable as a full computer. Did you try with LXDE?
kxhawkins said:
Cool story. It's been out for less than six months, but I guess that could be aeons. This is for people who haven't seen it.
Also, the GUI is extremely fast. With an MHL it's totally usable as a full computer. Did you try with LXDE?
Click to expand...
Click to collapse
I just realized that we are not talking about the exact same thing.
This has existed for aeons (Feb 1 2011). Same theory and application, but based on Karmic 9.10 and very slow indeed.
Hmm, might have to give this one a try.
Yea, ran that on my old X10. Bad hardware + bad implementation. This is 10.10, and they have a working beta for 12.10.
The LOA project really got it right. Especially running LXDE. Gnome is obviously slower.
IMO it's a good replacement for the official Ubuntu project.
It would be nice to install a custom arch linux or a debian netinstall with only the necessary things to work, fluxbox, xfce, lxde or some lightwheight desktop manager and see what happens. With the micro usb 2 hdmi cable and attached to a big screen it would be a real killer.
With some time I can prepare a custom debian or arch linux image to our devices.
Sent from my HTC PH39100 using Tapatalk 2
Archector said:
It would be nice to install a custom arch linux or a debian netinstall with only the necessary things to work, fluxbox, xfce, lxde or some lightwheight desktop manager and see what happens. With the micro usb 2 hdmi cable and attached to a big screen it would be a real killer.
With some time I can prepare a custom debian or arch linux image to our devices.
Click to expand...
Click to collapse
The micro usb to hdmi is an MHL adapter. And yes, it makes it awesome.
LOA has a working debian image (http://sourceforge.net/projects/linuxonandroid/files/Debian/Image/) and are working on Arch.
A bare bones Arch installation with LXDE would be amazing, but alas, I have no spare time for side-projects anymore =(. I'm sure I wouldn't be the only one very appreciative if you could put it together.
I'm personally thinking about doing a portable HDD installation of a completely barebones Ubuntu from CLI, and just dropping pure XFCE on it. I think I've just found my testing platform.
I just made the switch from Mint Debian Edition to Arch. I love it, but I just can't get used to XFCE. Gnome 3 is just too awesome.
However, if I had Arch with LXDE / XFCE on the Vivid, I would probably replace a few computers with Monitor+Keyboard+Mouse+MHL terminals.
kxhawkins said:
I just made the switch from Mint Debian Edition to Arch. I love it, but I just can't get used to XFCE. Gnome 3 is just too awesome.
Click to expand...
Click to collapse
I like Gnome 2 and 3. LXDE has a few issues with the way it runs hardware (primarily its ability to manage laptop touchpads) as tested on Lubuntu 11.10, and that's when I made the switch to using XFCE instead. I'm not really a fan of Unity.
Anybody know why I get this error when running the scripy?
No, that's strange. Have you tried with the Terminal Emulator from OP?
And I know it shouldn't matter, but try cd'ing into /sdcard/ubuntu and then trying to execute the sh.
kxhawkins said:
No, that's strange. Have you tried with the Terminal Emulator from OP?
And I know it shouldn't matter, but try cd'ing into /sdcard/ubuntu and then trying to execute the sh.
Click to expand...
Click to collapse
Same result with terminal/cding, .
Try better terminal emulator app that worked for me.
Sent from my HTC PH39100 using xda premium
Mjones307 said:
Try better terminal emulator app that worked for me.
Sent from my HTC PH39100 using xda premium
Click to expand...
Click to collapse
Same result. 'qt' isn't even in the script so I don't know what's up. I can run other other scripts np.

Categories

Resources