2012-02-10 6 views
3

アンドロイドフレームワークのシステムサービスをデバッグすることはできますか?アンドロイドフレームワークサービスをデバッグする方法は?

私はこれらのリンクに出くわしましたが、システムサービスをデバッグするのに十分ではありませんでした。

http://android.opensourceror.org/2010/01/18/android-source/

+0

http://source.android.com/source/downloading.html –

+0

[デバッグAndroidのJavaフレームワークサービス]をご確認くださいます(http: //apienthusiast.blogspot.com/2014/06/debugging-android-java-framework.html)。 – videoguy

答えて

2

Androidフレームワークサービスをデバッグできるようにするには、Eclipseプロジェクトが必要です。 AOSPのためのEclipseプロジェクトを作成するプロセスはそれほど単純ではありません。 Androidソースサイトの説明には詳細がたくさんあります。プロジェクトが壊れたり、AOSPビルドが壊れたりすることになります。 AOSPビルドを壊した場合は、おそらく、eclipseプロジェクトが成果物を作成して手動で削除する各フォルダーに移動する必要があります。

記事Debugging Android Java framework servicesは、プロジェクトの作成からAndroid Javaフレームワークサービスのデバッグにそのプロジェクトを使用するまでのステップバイステップチュートリアルを提供します。そのリンクを確認してください。

1

それは、Androidのフレームワークシステムサービスをデバッグすることは可能ですか?

独自のファームウェアをコンパイルして構築している場合は、はい。 the Using Eclipse page in the AOSP docsの「エミュレータのデバッグ」を参照してください。

+0

ご返信ありがとうございます。私はOn-Device Debuggingをやっています。 \ packages \ apps \ Launcher2 \にあるlauncher2アプリをデバッグします。これは、frameworks \ base \ services \ java \ com \ android \ serverにあるシステムサービスWallpaperManagerServiceを使用します。今は、このフォルダをEclipseにインポートして、WallpaperManagerServiceのコードをデバッグすることができません。 EclipseからEclipseへのコードをインポートする方法をお勧めしますか?ありがとう、Priju – prijupaul

5

私は、Android Studioのhereのためのいくつかの作業指示を発見し、テストした:

I choose API 17 because it doesn't have emulator rotate bug. 

important steps: 
0) make sure your android studio has downloaded sdk 17 with sources. 
1) create any simple android project. make target sdk 17. min sdk 17 and compile with 17. build tools version doesn't matter. (File-> Project Structure-> app under Modules -> Flavor) 
2) create emulator instance with api 17 
3) open ddms, highlight system_process, that is it. (Tools -> Android - > Android Device Monitor) 
4) for the simple project, config debug profiles: remote 8700, Run->Edit Configurations -> + -> Remote -> port 8700 
5) from the simple project. launch debug with the profile. (now you will notice ddms's system_process has an special bug icon) 
6) open file $(Android_Studio)/sdk/sources/android-17/com/android/server/am/ActivityStack.java in android studio, and then set a breakpoint at: realStartActivityLocked(…) func 
7) IMPORTANT STEP: in android studio, from bottom pane, select Debugger -> Threads, WAIT threads are populated. because it means studio is connected with ddms now. 
8) from emulator, launch any app/ or your simple app. 
9) breakpoint will be intercepted, if not try restart the app in emulator again. 

two refs: 
http://apienthusiast.blogspot.com/2014/06/debugging-android-java-framework.html 
http://source.android.com/source/using-eclipse.html 
http://jmlinnik.blogspot.kr/2011/12/debug-built-in-applications-in-eclipse.html 
https://software.intel.com/en-us/articles/android-system-level-javac-code-debugging 

http://apienthusiast.blogspot.ca/2014/07/debugging-android-native-applications.html 
関連する問題