Skip to content

Commit 4dc9380

Browse files
committed
installing apk
1 parent d9421f0 commit 4dc9380

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/qa-android-ui-tests.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,64 @@ jobs:
559559
echo "ANDROID_SERIAL=$SELECTED" >> "$GITHUB_ENV"
560560
echo "Using device: $SELECTED"
561561
562+
- name: Prepare device + install APK(s)
563+
run: |
564+
set -euo pipefail
565+
566+
: "${ANDROID_SERIAL:?ANDROID_SERIAL not set}"
567+
: "${NEW_APK_PATH:?NEW_APK_PATH missing}"
568+
569+
if [[ ! -s "${NEW_APK_PATH}" ]]; then
570+
echo "ERROR: NEW_APK_PATH not found or empty: ${NEW_APK_PATH}"
571+
exit 1
572+
fi
573+
574+
ADB="adb -s ${ANDROID_SERIAL}"
575+
${ADB} wait-for-device
576+
577+
INSTALLED_PKGS="$(${ADB} shell pm list packages)"
578+
PACKAGES=(
579+
"com.wire"
580+
"com.waz.zclient.dev"
581+
"com.wire.internal"
582+
"com.wire.android.internal"
583+
"com.wire.android.bund"
584+
"com.wire.android.bund.column2"
585+
"com.wire.android.bund.column3"
586+
"com.waz.zclient.dev.debug"
587+
)
588+
589+
for pkg in "${PACKAGES[@]}"; do
590+
if echo "${INSTALLED_PKGS}" | grep -qx "package:${pkg}"; then
591+
echo "Uninstalling ${pkg}"
592+
${ADB} uninstall "${pkg}" || true
593+
fi
594+
done
595+
596+
INSTALL_FLAGS="-r"
597+
if [[ "${{ inputs.enforceAppInstall }}" == "true" ]]; then
598+
INSTALL_FLAGS="-r -d"
599+
fi
600+
601+
if [[ "${{ inputs.isUpgrade }}" == "true" ]]; then
602+
: "${OLD_APK_PATH:?OLD_APK_PATH missing for upgrade}"
603+
if [[ ! -s "${OLD_APK_PATH}" ]]; then
604+
echo "ERROR: OLD_APK_PATH not found or empty: ${OLD_APK_PATH}"
605+
exit 1
606+
fi
607+
echo "Installing OLD apk..."
608+
${ADB} install ${INSTALL_FLAGS} "${OLD_APK_PATH}"
609+
fi
610+
611+
echo "Installing NEW apk..."
612+
${ADB} install ${INSTALL_FLAGS} "${NEW_APK_PATH}"
613+
614+
: "${APP_ID:?APP_ID missing}"
615+
if ! ${ADB} shell pm list packages | grep -qx "package:${APP_ID}"; then
616+
echo "ERROR: APP_ID '${APP_ID}' is not installed after install step."
617+
exit 1
618+
fi
619+
562620
- name: Install 1Password CLI
563621
uses: 1password/install-cli-action@v2
564622

0 commit comments

Comments
 (0)