The following is my AndroiManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
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>
</manifest>
I want to launch my app using monkeyrunner but when I give the command
device.startActivity(component='com.exmaple.helloworld/com.example.helloworld.MainActivity')
It doesn't start my app. Am I missing anything. I read Issues using monkeyrunner startActivity but still it didn't work.
在AndroidManifest.xml文件中为activity
添加android:exported="true"
行
device.startActivity(component='com.exmaple.helloworld/com.example.helloworld.MainActivity')
have you tried fixing the typo (exmaple instead of example) ?
device.startActivity(component='com.example.helloworld/com.example.helloworld.MainActivity')
您是否尝试过device.startActivity(component ='com.exmaple.helloworld / .MainActivity')?
You should change activity name in manifest, from:
android:name=".MainActivity"
to
android:name="com.example.helloworld.MainActivity"
then your script will work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.