每当我尝试将我的android项目运行到intellij 13中的usb设备时,日志会在下面给出错误,无法安装/启动应用程序。该应用程序在模拟器中启动良好。我在Mac上。
//Log
Launching application: com.example.app/com.example.app.MainActivity.
DEVICE SHELL COMMAND: am start -n "com.example.app/com.example.app.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.app/.MainActivity }
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.app/.MainActivity } from null (pid=27490, uid=2000) not exported from uid 10222
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1790)
at com.android.commands.am.Am.runStart(Am.java:463)
at com.android.commands.am.Am.run(Am.java:108)
at com.android.commands.am.Am.main(Am.java:81)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:1)
项目默认缺少此代码
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
这已在Intellij IDEA 13.0.1
中修复