This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Android and the fly likes Logging as root and using the android emulator's terminal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Logging as root and using the android emulator Watch "Logging as root and using the android emulator New topic
Author

Logging as root and using the android emulator's terminal

VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Hi everyone,

Does anyone have any idea , how to log-on to the android device emulator's terminal using root id. I tried some of the linux commands on the terminal and except for a few, I got "access denied" as the reuslt for all.

I read in a book(Begining Android-by Mark Murphy) that executing adb pull/push commands, we can transfer the device database from an to the emulator respectively. But I got access denied even on this command.


Copy Paste is a design error!!
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

If you are using the emulator bundled with the SDK, you should already have root access, which means you should be able to browse folders, push/pull files onto and from the emulator. Run all linux commands available from adb shell prompt. However, if you have Android device connected and you are trying to broswe through the file system, you would get access denied messages since you dont have root access on the phone.


[List of FAQs] | [Android FAQ] | [Samuh Varta]
VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Hi Monu,

I am using the device emulator bundled with the sdk. Still I keep getting the access denied message.Has it something to do with the AVD target we create for application execution?
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

By default, you always run as the root.

Try adb root command (here is what it means; copy-pasted from adb command usage text):
adb root - restarts adb with root permissions

Hope that helps...
VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Hi Monu

It doesn't seem to work in anyway. I tried various other options also, but all I get is access denied message. I am using android sdk 1.5r1. Can it be the case that root login is possible only in previous versions, because wherever I read about this feature, the writers always referred to older versions(0.9 in the book I was talking about).
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

VineetK Singh wrote:Hi Monu

It doesn't seem to work in anyway. I tried various other options also, but all I get is access denied message. I am using android sdk 1.5r1. Can it be the case that root login is possible only in previous versions, because wherever I read about this feature, the writers always referred to older versions(0.9 in the book I was talking about).


That is strange. I dont think the problem is with the version of SDK; I have been using SDK1.5 and never have had any such issues browsing the emulator file system.

What happens when you type adb root on the command prompt? When I type the command I get a messsage which reads- abdb is already running as root which is very obvious given that I run always as root.

Perhaps the problem is with the image of the file system mounted on the emulator. My knowlege of that area is not very good.
A crude method would be:
1. Delete the SDK installation
2. delete the .android folder created in C:/DocumentandSettings/%userProfile%/
3. Resinstall the SDK
VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Hey Monu
I finally got it.. thank you!!
Preetam Bhosle
Greenhorn

Joined: Feb 12, 2011
Posts: 6
VineetK Singh wrote:Hey Monu
I finally got it.. thank you!!


hi vineetK, i tried to root my emulator, tried almost all methods, still no method worked. i use android 1.5,1.6,2.1,2.3 emulator, and i am not able to root it.
how did you do it, please help. i need it urgently..!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logging as root and using the android emulator's terminal