Android的:如何利用亚行壳分开始与strace一个应用程序应用程序、Android、亚行壳分、strace

2023-09-04 04:11:10 作者:皓雪殇

我需要stracing在SDK模拟器Android应用程序帮助。

I need help on stracing Android apps in the SDK emulator.

下面是我的设置:

我有一个Android SDK模拟器运行Android API的4.03亚行外壳连接到仿真器。

I have an Android SDK emulator running the Android API 4.03 ADB shell connected to emulator.

我能够使用ADB安装filename.apk来安装APK

I am able to install an APK using the ADB install filename.apk

我能够运行使用亚行的shell应用程序我开始-a -n android.intent.action.Main com.akproduction.notepad / com.akproduction.notepad.NoteList

I am able to run the app using the ADB shell am start -a android.intent.action.Main -n com.akproduction.notepad/com.akproduction.notepad.NoteList

我尝试使用与strace(ADB壳) strace的上午开始-a -n android.intent.action.Main com.akproduction.notepad / com.akproduction.notepad.NoteList 但我什么也得不到!

I try to strace using (ADB shell) strace am start -a android.intent.action.Main -n com.akproduction.notepad/com.akproduction.notepad.NoteList but I get nothing!

你如何跟踪Android应用程序的运行时行为及其安装?

How do you trace the runtime behavior of Android apps and their installation?

(PS测试程序位于这里。

推荐答案

在正在启动命令不直接运行应用程序;它只是告诉机器人做一切必要努力,在你的榜样,启动特定的活动。

The "am start" command does not directly run your application; it simply tells Android to do whatever is necessary to, in your example, start a specific activity.

strace的命令通常用作 strace的命令名称命令的args 并启动命令名称 - 轻松,但在这种机器人的使用情况下,不会有帮助。但是,strace的具有 -p 选项,这对你有帮助:的strace -p<步骤ID> 将让你开始跟踪该过程,并指定ID。

The strace command is normally used as in strace commandname command args and it launches commandname -- easy, but in this Android use case, not helpful. However, strace has a -p option which is helpful to you: strace -p <process id> will let you start tracing the process with the specified id.

如果您键入 PS 您的Andr​​oid系统上,你可以找到该进程的名称 com.akproduction.notepad (可能是,默认情况下过程被命名为他们的Andr​​oid包,但它可以改变,在清单)。然后,你就可以开始stracing它,无论它正好是。

If you type ps on your Android system you can locate the process with the name com.akproduction.notepad (probably; by default processes are named for their Android package, but it's possible to change that in the manifest). Then you can start stracing it, wherever it happens to be.

如果您的需要的在过程早期发现的东西,你要么需要修改code,以使其推迟,直到你准备跟踪它,或者你' LL至少需要在开始活动之前得到的进程在运行。第二个选项有常作为首发活动,然后使用后退按钮,然后让你的跟踪准备好了,然后再次启动该活动一样容易 - 但是这始终是code-特定于应用程序

If you need to catch things early in the process, you'll need to either modify the code to cause it to delay until you're ready to trace it, or you'll at least need to get the process running before you start the activity. The second option there is often as easy as starting the activity, then using the back button, then getting your trace ready, then starting the activity again -- but this is always code-specific to the application.