ser*_*g3z 8 android run-configuration android-studio
我想在 android 项目中为我的脚本设置脚本路径,而不使用严格的路径(/User/Documents/MyApp/tools/script.sh)以及“工作目录”。
我知道我可以使用“外部工具”,但此解决方案不起作用,因为所有项目开发人员都必须使用“外部工具”设置导入我的 jar 文件
到目前为止,还没有直接的方法在配置的路径值中使用这些变量。
或者,您可以创建一个gradle taskinapp/gradle文件来运行 shell 脚本:
task runSS {
doLast{
exec {
// chmod u+rwx demo.sh to make file executable
executable "../demo.sh"
}
}
}
// other gradle tasks
Run Code Online (Sandbox Code Playgroud)
确保使用 将该文件的权限更改为可执行文件
chmod u+rwx file_name。
现在运行该文件:
输出:
| 归档时间: |
|
| 查看次数: |
227 次 |
| 最近记录: |