starting zygote from command line (x86)

by Zia » Thu, 05 Feb 2009 01:41:13 GMT


Sponsored Links
 I got myself in a console now after compiling installer img with
zygote service commented out in the init.rc file. Instead I placed /
system/bin/sh service in the init.rc .

After reboot, I got the prompt. On the command line when I attempt to
start zygote (to enter Android UI),
app_process -Xzygote /system/bin --zygote

first I got ANDROID_SOCKET_zygote environment variable error. I fixed
that, and now I am getting error when binding to socket 666. Seems
like i'm missing /dev/socket/zygote. The problem is, I dont know how
to create socket on this command shell now. Another thing could be the
missing socket binder service.

Any ideas or suggestions to recover from this?

Ultimately, I'm planning to enter a console, start zygote to enter
Android UI. On the console I plan to run dropbear or telnetd to
remotely connect to the box.

Thanks,

Zia
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



starting zygote from command line (x86)

by dingerjun » Thu, 05 Feb 2009 02:31:43 GMT


 There is another method to start the zygote from command line.

You could add the lines after the service zygote.
like:
on property:zygote.enable=1
    start zygote
on property:zygote.enable=0
    stop zygote

and add a line "setprop zygote.enable 0" in front of file /init.rc

----- Original Message ----- 
From: "Zia" <zia.cha...@gmail.com>
To: "android-porting" <android-porting@googlegroups.com>
Sent: Thursday, February 05, 2009 9:40 AM
Subject: [android-porting] starting zygote from command line (x86)


--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


starting zygote from command line (x86)

by dingerjun » Thu, 05 Feb 2009 02:33:42 GMT


 When you want to start the zygote, you could input setprop zygote.enable 1 in 
command line
----- Original Message ----- 
From: "dingerjun" <dinger...@163.com>
To: <android-porting@googlegroups.com>
Sent: Thursday, February 05, 2009 10:31 AM
Subject: [android-porting] Re: starting zygote from command line (x86)


--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



starting zygote from command line (x86)

by Weihua Wu » Thu, 05 Feb 2009 03:07:30 GMT


 The init.rc is not a shell script in normal linux. You have to register the
service in init.rc during Android init. The following line in init.rc is to
create the socket. The socket is created when the init.rc is parsed by
android init.
    socket zygote stream 666
Android use that way to create socket for security concern probably.

You could learn more about init.rc from system/core/init/readme.txt

Hope it's helpful.
Weihua(Jackie) Wu





--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



starting zygote from command line (x86)

by Zia » Fri, 06 Feb 2009 20:32:35 GMT


 Thanks for your replies. However, so far not much luck here. I got the
zygote socket created in /dev/socket and the environment variable
ANDROID_SOCKET_zygote set to 666.

Now i'm getting

java.lang.RuntimeException: Error binding to local socket '666'
 at com.android.internal.os.ZygoteInit.registerZygoteSocket
(ZygoteInit.java:164)

the command line i'm using is
#app_process -Xzygote /system/bin --zygote

and the init.rc is like this

setprop zygote.enable 0

service zygote /system/bin/app_process -Xzygote /system/bin --zygote --
start-system-server
       socket zygote stream 666
           on property:zygote.enable=1
              start zygote
           on property:zygote.enable=0
              start zygote

----
typing setprop zygote.enable 1 on the command line doesn't do anything
either. What am I missing here now?

Thanks,

-Z




--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



starting zygote from command line (x86)

by Weihua Wu » Mon, 09 Feb 2009 03:38:01 GMT


 hat dingerjun wrote is :
on property:zygote.enable=1
start zygote
on property:zygote.enable=0
stop zygote

But yours are
on property:zygote.enable=1
start zygote
on property:zygote.enable=0
start zygote

So I think in your case, the zygote has been started when you run command.
You can check with ps first.
If the zygote is started through command line, other lines after that in
init.rc should be also changed since some depend on the zygote, which is the
most important to start Android.

Why do you need to start that on command line? Did you start zygote
successfully with normal way instead of command line?

Thanks
Jackie Wu
On Sat, Feb 7, 2009 at 4:32 AM, Zia <zia.cha...@gmail.com> wrote:


--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



starting zygote from command line (x86)

by Zia » Tue, 10 Feb 2009 01:07:55 GMT


 h dang it. thanks for spotting that. I will try the fix tonight and
post the results.

The reason I would like to enter commandline mode before UI:
1) to understand how everything stacks up
2) run any sort of SSH/Telnet server and access the box remotely.

-Zia.

On Feb 8, 7:37pm, Weihua Wu <wwh.andr...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



starting zygote from command line (x86)

by jerryfan2000 » Fri, 10 Apr 2009 14:01:07 GMT


 f set service option to disabled, how do I manually start the service
by command line?

On 20 97 Zia <zia.cha...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Other Threads

1. StackOverflow Exception while using TabActivity

Hi,

I have a TabActivity, there are 4 tabs. In each tab I have put a
single Activity. One of the activities contains a Custom List View
which uses a CustomAdapter which extends the BaseAdapter.

I get this excpetion, when I try to open the tab containing this
activity. It seems to be thrown at a point when probably the
TabActivity is being re-drawn. Can anybody please suggest some
alternatives, or solutions to avoid this problem. Here is the stack
trace.

java.lang.StackOverflowError
at android.text.SpannableStringBuilder.drawText
(SpannableStringBuilder.java:1042)
at android.graphics.Canvas.drawText(Canvas.java:1273)
at android.text.Styled.each(Styled.java:119)
at android.text.Styled.foreach(Styled.java:249)
at android.text.Styled.drawText(Styled.java:302)
at android.text.Layout.drawText(Layout.java:1346)
at android.text.Layout.draw(Layout.java:339)
at android.widget.TextView.onDraw(TextView.java:3921)
at android.view.View.draw(View.java:5838)
at android.view.ViewGroup.drawChild(ViewGroup.java:1486)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319)
at android.widget.ListView.dispatchDraw(ListView.java:2820)
at android.view.View.draw(View.java:5944)
at android.widget.AbsListView.draw(AbsListView.java:2121)
at android.view.ViewGroup.drawChild(ViewGroup.java:1486)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.View.draw(View.java:5841)
at android.widget.FrameLayout.draw(FrameLayout.java:352)
at android.view.ViewGroup.drawChild(ViewGroup.java:1486)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.View.draw(View.java:5841)
at android.widget.FrameLayout.draw(FrameLayout.java:352)
at android.view.ViewGroup.drawChild(ViewGroup.java:1486)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
at android.view.View.draw(View.java:5841)
at android.widget.FrameLayout.draw(FrameLayout.java:352)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw
(PhoneWindow.java:1847)
at android.view.ViewRoot.draw(ViewRoot.java:1217)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3948)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
at dalvik.system.NativeStart.main(Native Method)

Thanks,

Dexter
--~--~---------~--~----~------------~-------~--~----~

2. Bug in activity stack if launching from Home icon?

This is just an issue with how ADT launches the application, effectively
under a different identity so resulting in two instances running if you also
try to launch it from home.

On Thu, Jul 23, 2009 at 10:22 PM, adamphillips12





-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

3. How to generate the public key file in recovery rootfs

4. Eclipse: Your project contains errors, please fix them: - How to find ??

5. About sending structured data between C/C++ and JAVA Code

6. Why the method IWindowManager.setRotation can't do the right thing ?

7. How can i get the notification of new email without email client?