如何通过JVM参数在Eclipse为Android程序?参数、程序、JVM、Android

2023-09-07 09:50:02 作者:分手后难过的大全

我需要这个传递给我的Andr​​oid应用程序,所以我会得到空指针踪迹:

I need to pass this to my Android app so I will get null pointer stacktraces:

-XX:-OmitStackTraceInFastThrow

(从其他计算器的问题)本指南介绍了如何做到这一点,不过参数标签是不是有一个Android应用程序,只有普通的Java应用程序:http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Flaunchers%2Farguments.htm

所以,我该怎么办呢Android应用程序或我应该做的完全不同的东西?

So how do I do it for Android apps or should I do something completely different?

推荐答案

这是行不通的。这是一个JVM命令行参数。 Android不具有JVM。在Android中,你的字节codeS通过Dalvik的,虚拟机那是相当的,完全不同的执行。

That's not going to work. That is a command line argument for a JVM. Android doesn't have a JVM. In Android, your bytecodes are executed by Dalvik, a virtual machine that is quite, quite different.

之一在它是不同的方式是,它被启动时,或多或少,您的电话启动时。即使它没有认识到特定的命令行参数,应用程序启动时,Dalvik的已经运行了一段时间。你可以不通过命令行参数。

One of the ways in which it is different is that it is started, more or less, when your phone boots. Even if it did recognize that particular command line argument, when your application starts, Dalvik has already been running for a while. You can't pass a command line argument.