Uninstallation Testing Using ADB Commands Notes By ShariqSP

Uninstallation Testing for Candy Crush Using ADB Commands

1. Setting Up ADB for Uninstallation Testing

Uninstallation testing ensures that the Candy Crush app is removed completely and that the system behaves as expected afterward. Follow these steps to set up:

  1. Install ADB on your computer and configure it properly.
  2. Connect your device and verify the connection:
    adb devices
  3. Enable USB Debugging on your device:
    • Navigate to Settings > Developer Options and enable USB Debugging.

2. Uninstalling Candy Crush

Use ADB commands to uninstall the Candy Crush app from your device:

  • List Installed Apps:
    adb shell pm list packages
    • Use grep to filter for Candy Crush:
      adb shell pm list packages | grep 'candy'
    • The output might look like this:
      package:com.king.candycrushsaga
  • Uninstall Candy Crush:
    adb uninstall com.king.candycrushsaga
    • This command removes the app along with its data.
  • Uninstall but Retain Data:
    adb shell pm uninstall -k com.king.candycrushsaga
    • Use the -k option to retain the app’s data and cache.
  • Verify Uninstallation:
    adb shell pm list packages | grep 'candy'
    • If the app is uninstalled successfully, it will not appear in the list.

3. Testing System Behavior After Uninstallation

After uninstalling Candy Crush, test the following scenarios:

  • Check App Data:
    adb shell ls /data/data/com.king.candycrushsaga
    • If the app is fully uninstalled, this directory should not exist.
  • Check App Cache:
    adb shell ls /data/user/0/com.king.candycrushsaga
    • This verifies if the app’s cache directory is removed.
  • Reinstall Candy Crush:
    adb install path/to/candycrush.apk
    • Verify if the app behaves correctly after a fresh installation.

4. Practical Uninstallation Scenarios

Simulate various scenarios to ensure proper uninstallation:

  • Uninstall During Gameplay:
    • Open Candy Crush, start a level, and uninstall the app using:
      adb uninstall com.king.candycrushsaga
    • Verify that the system handles the uninstallation gracefully.
  • Uninstall and Reinstall:
    1. Uninstall the app:
      adb uninstall com.king.candycrushsaga
    2. Reinstall the same app:
      adb install path/to/candycrush.apk
    3. Verify that progress and user data are retained only if -k was used during uninstallation.
  • Uninstall Large Applications:
    • Test system performance when uninstalling Candy Crush or similarly large apps.

5. Edge Case Testing

Validate app uninstallation under unusual circumstances:

  • Uninstall During Low Battery:
    • Simulate a low-battery condition and uninstall Candy Crush to ensure system stability.
  • Uninstall During Software Update:
    • Test system behavior when uninstalling Candy Crush during an OS update.
  • Uninstall Without Internet:
    • Disable internet connectivity and attempt to uninstall Candy Crush.

6. Automating Uninstallation Testing

Automate the uninstallation process for Candy Crush and other apps using a script:


              #!/bin/bash
              apps=("com.king.candycrushsaga" "com.other.app")
              for app in "${apps[@]}"
              do
                echo "Uninstalling $app..."
                adb uninstall "$app"
                echo "$app uninstalled."
              done
                

Save this script as uninstall_apps.sh and run it to batch uninstall apps.

By using ADB commands, you can thoroughly test the uninstallation process for Candy Crush, ensuring proper cleanup and system stability.