相关疑难解决方法(0)

通过Gradle和Android Studio构建和运行应用程序比通过Eclipse慢

我有一个多项目(~10个模块),每次建筑大约需要20-30秒.当我在Android Studio中按Run时,我必须每次都等待重建应用程序,这非常慢.

是否可以在Android Studio中自动化构建过程?或者您对如何更快地完成此过程有任何建议?

在Eclipse中,由于自动构建,在模拟器上运行相同的项目大约需要3-5秒.

这是我的build.gradle文件(app模块):

buildscript {
    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.4'
    }
}
apply plugin: 'android'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':libraries:SharedLibs')
    compile project(':libraries:actionbarsherlock')
    compile project(':libraries:FacebookSDK')
    compile project(':libraries:GooglePlayServices')
    compile project(':libraries:HorizontalGridView')
    compile project(':libraries:ImageViewTouch')
    compile project(':libraries:SlidingMenu')
}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 16
    }
}
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio build.gradle

456
推荐指数
13
解决办法
22万
查看次数

在shell中的一行中运行多个命令

说我有一个文件/templates/apple,我想

  1. 把它放在两个不同的地方然后
  2. 删除原始.

所以,/templates/apple将被复制到/templates/usedAND /templates/inuse 然后之后我想删除原始.

cp最好的方法,然后rm呢?或者,还有更好的方法?

我想在一行中完成所有操作,所以我认为它看起来像:

cp /templates/apple /templates/used | cp /templates/apple /templates/inuse | rm /templates/apple
Run Code Online (Sandbox Code Playgroud)

这是正确的语法吗?

bash shell

349
推荐指数
4
解决办法
42万
查看次数

如何从命令行启动Android应用程序?

如何从命令行启动Android应用程序?

有类似的问题,但我找不到任何答案.

command-line android

62
推荐指数
3
解决办法
11万
查看次数