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

[cli] Improve Snack support for older SDKs #117

Merged

Conversation

gabrieldonadel
Copy link
Member

@gabrieldonadel gabrieldonadel commented Dec 21, 2023

Why

Closes ENG-10972

How

Improve Snack support for older SDKs on iOS and Android

on iOS Simulators:

  • Check if Expo Go is installed and attempt to read compatible SDK versions from EXSDKVersions.plist

on iOS Real devices:

  • Only check if Expo Go is installed, we can't really do much given that we don't have access to EXSDKVersions.plist (even through HouseArrest) and we can't install specific versions of Expo Go

on Android:

  • We don't have a file equivalent to EXSDKVersions.plist on Android so we need to rely on checking the app version against the latest expo go release for a given SDK, reading from API V2 versions/latest. If the opened Snack requires a downgrade of Expo Go, first uninstall the app to avoid INSTALL_FAILED_VERSION_DOWNGRADE

Test Plan

Screen.Recording.2024-01-02.at.14.41.021.mov

Copy link

linear bot commented Dec 21, 2023

@gabrieldonadel gabrieldonadel force-pushed the @gabrieldonadel/improve-snack-multi-sdk-support branch from 2a59b87 to 2233b0f Compare December 22, 2023 03:38
'packages',
EXPO_GO_BUNDLE_IDENTIFIER
);
export async function isAppInstalledOnEmulatorAsync(
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be handy when we add support for opening updates

Comment on lines +277 to +285
const localPath = await getContainerPathAsync({
udid,
bundleIdentifier: EXPO_GO_BUNDLE_IDENTIFIER,
});
if (!localPath) {
return null;
}

const regex = /Exponent-([0-9.]+).*\.app$/;
const regexMatch = regex.exec(localPath);
if (!regexMatch) {
return null;
}
const builtInfoPlistPath = path.join(localPath, 'EXSDKVersions.plist');
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately this is only possible on simulators, I tried using the HouseArrest Service to retrieve the EXSDKVersions on a real device but that doesn't work either given that VendContainer is only supported on dev-signed apps

@gabrieldonadel gabrieldonadel marked this pull request as ready for review January 2, 2024 17:44
@gabrieldonadel gabrieldonadel merged commit 4706686 into main Jan 2, 2024
1 check passed
@gabrieldonadel gabrieldonadel deleted the @gabrieldonadel/improve-snack-multi-sdk-support branch January 2, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants