2011-10-29 3 views
10

monkey 도구의 categories 옵션은 어떻게 사용합니까?Android : 원숭이의 카테고리 사용

내 매니페스트 파일의 관련 부분은 다음과 같습니다

adb shell monkey -p my.full.package.path -vvv 3 
:
<application android:icon="@drawable/icon" android:label="@string/app_name" android:name="MyApp" android:debuggable="true" android:allowBackup="false" android:testOnly="false"> 
     <activity android:name="MyLauncherActivity" android:label="@string/app_name" android:screenOrientation="portrait"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity android:name="MyMainActivity" android:label="@string/app_name" android:screenOrientation="portrait"> 
      <intent-filter> 
       <action android:name="none" /> 
       <category android:name="android.intent.category.MONKEY" /> 
      </intent-filter> 
     </activity> 

는 내가 명령 줄에서 다음을 입력 그 다음 작동하는지 확인하기 위해 내 휴대 전화에서 응용 프로그램을 실행

잘 작동합니다.

하지만이 작동하지 않습니다

adb shell monkey -p my.full.package.path -c intent.CATEGORY_LAUNCHER -vvv 3 

을 다음과 같은 출력을 얻을 수 :

:Monkey: seed=0 count=3 

:AllowPackage: myapp.full.package.path 

:IncludeCategory: intent.CATEGORY_LAUNCHER 

// Warning: no activities found for category intent.CATEGORY_LAUNCHER 

** No activities found to run, monkey aborted. 

를 그리고 약간의 변형을 시도하는 것은 또한 작동하지 않았다 :

:Monkey: seed=0 count=3 

:AllowPackage: my.full.package.path 

:IncludeCategory: CATEGORY_MONKEY 

:IncludeCategory: intent.CATEGORY_MONKEY 

:IncludeCategory: android.intent.MONKEY 

:IncludeCategory: android.intent.category.MONKEY 

:IncludeCategory: MONKEY 

// Warning: no activities found for category CATEGORY_MONKEY 

// Warning: no activities found for category intent.CATEGORY_MONKEY 

// Warning: no activities found for category android.intent.MONKEY 

// Warning: no activities found for category MONKEY 

** No activities found to run, monkey aborted. 

을 어떻게 카테고리를 지정하십시오.

답변

8

당신은 정말로 가깝습니다. 이것은 나를 위해 일한 :

adb shell monkey -p com.JamesBecwar.test -c android.intent.category.LAUNCHER -vvv 3 

나는 문제가 당신이 경우에 원숭이가 프로그램을 시작할 수 없습니다 때문에, 너무 실행기를 포함 할 필요가 있다고 생각합니다. 하나 이상의 -c 매개 변수를 넣을 수 있으므로 걱정하지 마십시오.

adb shell monkey -p com.JamesBecwar.test -c android.intent.category.LAUNCHER -c android.intent.category.MONKEY -vvv 3 

을하고 그것을 작동합니다 : 예를 들어, 당신은 할 수 있습니다.

관련 문제