天天看點

程式調試技術(JUnitTest)

調試是自己沒事試試的,呵,有不詳細的地方,多多包涵啦,有好的資料記得共享

哦。

    1.檔案目錄大概如上圖所示,但還不夠,還需要在

AndroidMinifest.xml檔案中添加如下幾句:

<?xml version="1.0" encoding="utf-8"?> 

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 

      package="com.mzh.www" 

      android:versionCode="1" 

      android:versionName="1.0"> 

    <uses-sdk android:minSdkVersion="8" /> 

    <application android:icon="@drawable/icon" android:label="@string/app_name"> 

        <uses-library android:name="android.test.runner"/> 

        <activity android:name=".JUnitTestActivity" 

                  android:label="@string/app_name"> 

            <intent-filter> 

                <action android:name="android.intent.action.MAIN" /> 

                <category android:name="android.intent.category.LAUNCHER" /> 

            </intent-filter> 

        </activity> 

    </application> 

    <instrumentation  

        android:name="android.test.InstrumentationTestRunner" 

        android:targetPackage="com.mzh.www" 

        android:label="Testing" 

    /> 

完成以上操作後即可右鍵進行單元調試,因為以上是我個人臨時做的筆記,如有不清楚的地方,包涵下,我也在邊學習

邊試的,謝謝啦,吼吼。。O_O

當然也可以用Debug斷點調試程式:。。。Debut調試按鍵在此不一 一贅述F5、

F6等:

在工程上右鍵單擊:Debug As-->Android Applicaton即可進入打斷點的地方啦,簡單吧。

     本文轉自華華世界 51CTO部落格,原文連結:http://blog.51cto.com/mzh3344258/689728,如需轉載請自行聯系原作者

繼續閱讀