在我的測試項目中,在java-> androidTest(com.company.xyx.test)文件夾中我寫了所有的android instrumentation測試來測試external.apk(不是app-debug.apk),我有一個單獨的apk測試項目(com.company.xyz)的包名稱相同,我想要的是當我運行測試時,它應該安裝external.apk和androidTest.apk來運行所有測試。如何告訴android testrunner測試external.apk insted生成的app-debug.apk?
請有人告訴我如何告訴測試運行器運行外部apk或如何從〜/ output/apk/app-debug.apk替換app-debug.apk到Externalapp.apk,以便它應該安裝該Externalapp.apk不是應用程序調試
在此先感謝..
這裏是我的應用程序的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.tri.rec"
testInstrumentationRunner "com.zutubi.android.junitreport.JUnitReportTestRunner"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile files('src/androidTest/java/com/tri/re/libs/android-junit-report-1.5.8.jar')
compile files('src/androidTest/java/com/tri/re/libs/robotium-solo-5.2.2-SNAPSHOT.jar')
compile files('src/androidTest/java/com/tri/re/libs/spoon-client-1.1.1.jar')
}
androidTest的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
請告訴我如何告訴測試運行器運行外部apk或如何將〜/ output/apk/app-debug.apk中的app-debug.apk替換爲Externalapp.apk,以便它應該安裝Externalapp.apk
試着區分這兩個文件的sha1 – 2015-04-03 09:17:53
@penta感謝您的評論,但我想要的是當我運行測試時,它不應該測試寫入測試的應用程序,我希望它測試external.apk它與測試項目具有相同的包名,我希望你明白我的觀點。就像使用apk的robotium錄像機測試一樣。 – 2015-04-03 10:22:56