Skip to content

Commit

Permalink
Delete apks after using them (#1947)
Browse files Browse the repository at this point in the history
  • Loading branch information
tokou authored Aug 30, 2024
1 parent 0eb21d5 commit 95ee50b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ class AndroidDriver(
val appNameResult = runCatching {
val apkFile = AndroidAppFiles.getApkFile(dadb, appId)
val appName = ApkFile(apkFile).apkMeta.name
apkFile.delete()
appName
}
if (appNameResult.isSuccess) {
Expand Down Expand Up @@ -775,7 +776,9 @@ class AndroidDriver(
private fun setAllPermissions(appId: String, permissionValue: String) {
val permissionsResult = runCatching {
val apkFile = AndroidAppFiles.getApkFile(dadb, appId)
ApkFile(apkFile).apkMeta.usesPermissions
val permissions = ApkFile(apkFile).apkMeta.usesPermissions
apkFile.delete()
permissions
}
if (permissionsResult.isSuccess) {
permissionsResult.getOrNull()?.let {
Expand Down Expand Up @@ -964,6 +967,7 @@ class AndroidDriver(
if (!isPackageInstalled("dev.mobile.maestro")) {
throw IllegalStateException("dev.mobile.maestro was not installed")
}
maestroAppApk.delete()
}

private fun installMaestroServerApp() {
Expand All @@ -981,6 +985,7 @@ class AndroidDriver(
if (!isPackageInstalled("dev.mobile.maestro.test")) {
throw IllegalStateException("dev.mobile.maestro.test was not installed")
}
maestroServerApk.delete()
}

private fun installMaestroApks() {
Expand Down

0 comments on commit 95ee50b

Please sign in to comment.