使用DS5调试取不到Devices的解决办法
##问题
想用DS-5来做cocos2d-x的android native app 调试, 结果设置DS-5 debugger的时候总是取不到devices; 并且看到eclipse的ERROR窗口报错”A DS-5 script encountered an error”, 点开看详情:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Traceback (most recent call last):
File "C:\Program Files (x86)\eclipse\plugins\com.arm.debug.configdatabase.data.community_5.17.0.20131213_202909\Boards\Android Application Debug\Native Application Library Debug\getDevices.py", line 46, in <module>
devices = adb_common.get_devices()
File "C:\Program Files (x86)\eclipse\plugins\com.arm.debug.configdatabase.data.community_5.17.0.20131213_202909\Boards\Android Application Debug\Native Application Library Debug\adb_common.py", line 125, in get_devices
adb_start_server()
File "C:\Program Files (x86)\eclipse\plugins\com.arm.debug.configdatabase.data.community_5.17.0.20131213_202909\Boards\Android Application Debug\Native Application Library Debug\adb_common.py", line 111, in adb_start_server
p = subprocess.Popen("adb start-server", shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
File "__pyclasspath__/Lib/subprocess.py", line 751, in __init__
File "__pyclasspath__/Lib/subprocess.py", line 1236, in _execute_child
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
at org.python.core.PyException.fillInStackTrace(PyException.java:70)
at java.lang.Throwable.<init>(Throwable.java:181)
at java.lang.Exception.<init>(Exception.java:29)
at java.lang.RuntimeException.<init>(RuntimeException.java:32)
at org.python.core.PyException.<init>(PyException.java:46)
at org.python.core.PyException.<init>(PyException.java:43)
.....
总之就是subprocess.py里有null point了;
##解决办法:
修改”EXPLISE_HOME\plugins\com.arm.debug.configdatabase.data.community_5.17.0.20131213_202909\Boards\Android Application Debug\Native Application Library Debug\adb_common.py”文件 形如
subprocess.Popen("adb start-server", shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
的都要修改为
subprocess.Popen("adb start-server", shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)