Intellij Idea不允许在真实设备上运行应用程序

时间:2013-02-19 21:32:52

标签: android intellij-idea

我使用已配置的Oracle SDK 1.6和Android SDK,

$ ./adb devices
List of devices attached 
S5830c10eb068   device

此外,Eclipse允许我直接在物理设备上运行项目,但Idea只能在某些窗口中看到该设备 - S5830c10eb068(Samsung gt-s5830,android 2.3.6):

enter image description here

但即使我在“运行配置”中选择“USB设备” - 也没有任何反应:

enter image description here

我该怎么办?

此外,设备插入后logcat中存在错误:

02-20 03:59:35.419: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/9
02-20 03:59:35.419: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/9
02-20 03:59:35.439: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/9
02-20 03:59:35.439: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/9
02-20 03:59:35.539: ERROR/MountService(158): ### notifyShareAvailabilityChange :: method = ums, avail = false
02-20 03:59:35.549: ERROR/MountService(158): notifyShareAvailabilityChange :: send ACTION_UMS_CONNECTED
02-20 03:59:38.609: ERROR/MountService(158): ### notifyShareAvailabilityChange :: method = ums, avail = true
02-20 03:59:38.619: ERROR/MountService(158): notifyShareAvailabilityChange :: send ACTION_UMS_CONNECTED
02-20 03:59:39.639: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/42
02-20 03:59:39.639: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/42
02-20 03:59:39.919: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/42
02-20 03:59:39.919: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/42
02-20 03:59:40.219: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/42
02-20 03:59:40.219: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/42
02-20 04:00:12.689: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/9
02-20 04:00:12.689: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/9
02-20 04:00:12.699: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/9
02-20 04:00:12.699: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/9
02-20 04:00:12.809: ERROR/MountService(158): ### notifyShareAvailabilityChange :: method = ums, avail = false
02-20 04:00:12.819: ERROR/MountService(158): notifyShareAvailabilityChange :: send ACTION_UMS_CONNECTED
02-20 04:00:22.859: ERROR/MountService(158): ### notifyShareAvailabilityChange :: method = ums, avail = true
02-20 04:00:22.889: ERROR/MountService(158): notifyShareAvailabilityChange :: send ACTION_UMS_CONNECTED
02-20 04:03:52.719: ERROR/MountService(158): ### notifyShareAvailabilityChange :: method = ums, avail = false
02-20 04:03:52.729: ERROR/MountService(158): notifyShareAvailabilityChange :: send ACTION_UMS_CONNECTED
02-20 04:04:25.659: ERROR/MountService(158): ### notifyShareAvailabilityChange :: method = ums, avail = true
02-20 04:04:25.669: ERROR/MountService(158): notifyShareAvailabilityChange :: send ACTION_UMS_CONNECTED
02-20 04:59:09.369: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/9
02-20 04:59:09.369: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/9
02-20 04:59:09.389: ERROR/RingtoneManager(158): getActualDefaultRingtoneUri : content://media/internal/audio/media/9
02-20 04:59:09.399: ERROR/RingtoneManager(158): Uri.parse(uriString) : content://media/internal/audio/media/9

另外,如果我选择“显示选择器对话框”然后从“运行”菜单中选择“运行” - 则会打开与第二张图片相同的窗口。

5 个答案:

答案 0 :(得分:3)

您正在尝试修改默认值,但您需要改为创建运行配置。

请参阅this documentation section for details

创建配置后,您可以在工具栏的下拉列表中选择它,并且“运行/调试”按钮将可用。

答案 1 :(得分:1)

Run --> Edit Configurations... --> General --> Show Chooser Dialog --> OK

然后再次运行。

答案 2 :(得分:0)

选择“显示选择对话框”,然后显示带有设备ID的对话框

答案 3 :(得分:0)

在构思13中,在运行配置中 - >一般 - >目标设备 - > USB设备

答案 4 :(得分:0)

可能与在选择器中看到设备有关:在我的机器上,设备仅在我手动杀死ADB进程后才在列表中(任务管理器 - >" adb.exe * 32")。在此之前,列表中没有设备或“确定”按钮变灰。 (IntelliJ IDEA 13.0.2社区)