Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: uninstall the test app once and install that again when MismatchedApplicationIdentifierEntitlement installation error occurs #2050

Merged
merged 38 commits into from
Oct 2, 2023

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Sep 28, 2023

I saw an app installation got failed as mismatch provisioning profile identifier error even the OS did not have the given bundle id on the device via isAppInstalled check.

So, according to isAppInstalled, the app should not be on the device but an installation error occurred since the app was installed with another provisioning profile.

Not clear the reason, but based on the device log, potentially the OS internally cached some information. Some installation steps worked, but haven't been completed. The uninstall (device.remove) could help to clear such cache.

Another note in my investigation related to this, if the app under test remained in the device as an offload app (maybe not "cache"), the app is not "present" on the device (isAppInstalled is false, expected based on the available information) but the OS keeps the data. driver.remove uninstalls all of them for sure.

Thus, current fullReset/enforceAppInstall capabilities won't clear the local data if the application remains as offline application. Users must call mobile: removeApp explicitly to call the remove method for sure,

@KazuCocoa KazuCocoa changed the title fix: calls remove app every time fix: do not check device.isAppInstalled(bundleId) for the device.remove call Sep 28, 2023
@KazuCocoa KazuCocoa marked this pull request as ready for review September 29, 2023 05:30
@KazuCocoa
Copy link
Member Author

KazuCocoa commented Sep 29, 2023

I wondered if like this offloaded app was in a similar situation. The app was not listed in the result of lookupApplications. I don't have an app to try to install with another profile etc, but the app existed in the IPad Storage section in the settings app. So the OS itself probably identified the app as a special state (?)
Screenshot 2023-09-28 at 11 30 14 PM

@KazuCocoa KazuCocoa changed the title fix: do not check device.isAppInstalled(bundleId) for the device.remove call fix: add uninstall when app installation failed Sep 29, 2023
@KazuCocoa KazuCocoa marked this pull request as draft September 29, 2023 20:45
@KazuCocoa KazuCocoa changed the title fix: add uninstall when app installation failed fix: add app uninstallation when MismatchedApplicationIdentifierEntitlement occurs when app installation failed when enforeceInstall/fullReset Sep 29, 2023
@KazuCocoa
Copy link
Member Author

Updated some changes, especially offload application case, that requires explicit mobile: removeApp to remove the local application data in current implementation basis

I'll update further later.

@KazuCocoa KazuCocoa changed the title fix: add app uninstallation when MismatchedApplicationIdentifierEntitlement occurs when app installation failed when enforeceInstall/fullReset fix: add app uninstallation when MismatchedApplicationIdentifierEntitlement occurs in app installation failure with enforeceInstall/fullReset Sep 30, 2023
@KazuCocoa
Copy link
Member Author

KazuCocoa commented Sep 30, 2023

On my local testing, I observed that when app installation failed, such a case also the "offload" state happened.

So, the most easiest way to reproduce this is:

  1. failed to install an app because invalid provisioning profile (from a fresh installation)
  2. Then, the failed to install app remained on the device as "offload" app icon
    • Then, the app did not present via usbmuxd info
  3. Install the same bundle id with another signature
  4. The issue happens

So, actually this case requires app deletion explicitly to avoid before the app installation. I'll update this branch further

@KazuCocoa KazuCocoa changed the title fix: add app uninstallation when MismatchedApplicationIdentifierEntitlement occurs in app installation failure with enforeceInstall/fullReset feat: uninstall the test app once and install that again when MismatchedApplicationIdentifierEntitlement installation error occurs Sep 30, 2023
lib/driver.js Outdated Show resolved Hide resolved
@KazuCocoa
Copy link
Member Author

Updated

lib/driver.js Outdated Show resolved Hide resolved
@@ -0,0 +1,122 @@
import chai from 'chai';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@KazuCocoa KazuCocoa merged commit 0c561f5 into master Oct 2, 2023
22 checks passed
@KazuCocoa KazuCocoa deleted the tune-remove-in-install branch October 2, 2023 22:00
github-actions bot pushed a commit that referenced this pull request Oct 2, 2023
## [5.5.0](v5.4.1...v5.5.0) (2023-10-02)

### Features

* uninstall the test app once and install that again when MismatchedApplicationIdentifierEntitlement installation error occurs ([#2050](#2050)) ([0c561f5](0c561f5))
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

🎉 This PR is included in version 5.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants