ioops / osoops

os stuck from my OSes
0 stars 0 forks source link

Commands to CLI Android Developrt #6

Open ioops opened 9 years ago

ioops commented 9 years ago

Uploading file local path: C:\Users\hz\AndroidStudioProjects\ImageViewExam5\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/com.example.hz.imageviewexam5 Installing com.example.hz.imageviewexam5 DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.hz.imageviewexam5" pkg: /data/local/tmp/com.example.hz.imageviewexam5 Success Launching application: com.example.hz.imageviewexam5/com.example.hz.imageviewexam5.MainActivity. DEVICE SHELL COMMAND:am start -D -n "com.example.hz.imageviewexam5/com.example.hz.imageviewexam5.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hz.imageviewexam5/.MainActivity }

ioops commented 9 years ago

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.example.hz.listview1"
    minSdkVersion 22
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        `minifyEnabled false`
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }

ioops commented 9 years ago

command: android -v create project -n exam2 -a mainActivity -k top.itmp.hz -t 1 -v 1.3.0 -g -p ./exam2

cat gradle/wrapper/gradle-wrapper.properties

Wed Apr 10 15:27:10 PDT 2013

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http://services.gradle.org/distributions/gradle-2.4-all.zip

buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' } } apply plugin: 'com.android.application'

android { compileSdkVersion 'android-23' buildToolsVersion '23.0.1'

buildTypes {
    release {
        minifyEnabled false
        proguardFile getDefaultProguardFile('proguard-android.txt')
    }
}

}

ioops commented 9 years ago

每次使用 android -v create project -n exam2 -a mainActivity -k top.itmp.hz -t 1 -v 1.3.0 -g -p ./exam2 命令创建 project 之后 不能很好的gradle 模板; 修改 android-sdk-linux/tools/templates/gradle 即可

ioops commented 9 years ago

android-sdk-linux/tools/lib/build_gradle.template

android { compileSdkVersion 'TARGET' buildToolsVersion 'BUILD_TOOL_REV'

buildTypes {
    release {
        minifyEnabled false
        proguardFile getDefaultProguardFile('proguard-android.txt')
    }
}

}

ioops commented 9 years ago

vim /apk/android-sdk-linux/tools/lib/build_gradle.template

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:ARTIFACT_VERSION'
    }
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 'TARGET'
    buildToolsVersion 'BUILD_TOOL_REV'

    defaultConfig {
        applicationId "com.example.hz.listview1"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFile getDefaultProguardFile('proguard-android.txt')
        }
    }
}
ioops commented 9 years ago

/apk/android-sdk-linux/tools/templates/gradle/wrapper/gradle/wrapper/gradle-wrapper.properties

Wed Apr 10 15:27:10 PDT 2013

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http://services.gradle.org/distributions/gradle-2.4-all.zip