【发布时间】:2014-02-12 20:04:53
【问题描述】:
我试图通过gradletask 启动应用程序。
task runDebug(dependsOn: ['installDebug', 'run']) {
}
task run(type: Exec) {
commandLine 'adb', 'shell', 'am', 'start', '-n', 'com.example.myexample/.ui.SplashScreenActivity'
}
但是这段代码不起作用,我得到错误:a problem occurred starting process 'command 'adb''
但是,当我明确指定 adb 的路径时,应用程序就会启动。
task run(type: Exec) {
commandLine 'D:\\android\\android-studio\\sdk\\platform-tools\\adb', 'shell', 'am', 'start', '-n', 'com.example.myexample/.ui.SplashScreenActivity'
}
那么我怎样才能得到一个包含路径的变量并将其传输到commandLine?
【问题讨论】:
标签: android gradle android-studio adb gradlew