2011-10-19 29 views
0

升级到Android SDK工具V14和更新现有项目,最后项目结构后,ant test失败,出现错误消息:运行“蚂蚁测试”使用Android SDK工具V14

输出的 ant -v test

[echo] Running tests ... 
    [exec] Current OS is Mac OS X 
    [exec] Executing '/opt/local/share/java/android-sdk-mac_x86/platform-tools/adb' with arguments: 
    [exec] 'shell' 
    [exec] 'am' 
    [exec] 'instrument' 
    [exec] '-w' 
    [exec] '-e' 
    [exec] 'coverage' 
    [exec] 'false' 
    [exec] 'xxx.xxx/xxx.xxx' 
    [exec] 
    [exec] The ' characters around the executable and arguments are 
    [exec] not part of the command. 
test: 
    [echo] Running tests ... 
    [exec] Syntax error: Bad substitution` 

但直接执行命令adb shell am instrument没问题。 我的环境是Mac上的Apache Ant(TM)1.8.2版。 请帮忙。

+0

这是否显示错误 - 下一行是“错误的替代”? –

回答

0

这是一个已知的r14工具问题。请参阅http://tools.android.com/knownissues

Testing ant test fails with Syntax error: Bad substitution. A last minute change introduced this error in the Ant rules file. The workaround is to edit /tools/ant/build.xml, line 318 and to change ${manifest.package} with ${tested.manifest.package}. [Issue 20979]