-
Notifications
You must be signed in to change notification settings - Fork 19
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
Unable to handle application bundles zipped with a parent directory #32
Comments
The unzip mechanism is currently working as expected, but Tophat should definitely handle this better to avoid the issue you described, so I'm open to ideas. The reason you're observing this behaviour is likely because you're zipping the Tophat should probably be smart enough to detect a |
This should be pretty easy to validate as well. Try compressing this way, from inside the cd MyApp.app
zip -r ../MyApp.app.zip . |
Thank you for your response. By compressing the contents of the I have been archiving for the iOS Simulator using [IMO] It might be a good idea to check whether the |
Yes, definitely agree with that. Not sure what the best approach is; checking |
Description
The application bundle(
.app
format) has a directory structure, so I stored it in cloud storage as a zip archived file.I want to use a hosted application bundle in
.zip
format, likehttp://localhost:29070/install/ios?virtual=https://#{host}/#{path}/myapp.app.zip
, in Tophat. However, due to an incorrect unpacked path, installation fails.Steps to reproduce
myapp.app
.myapp.app
into a zip archive namedmyapp.app.zip
.http://localhost:29070/install/ios?virtual=file:///path/to/myapp.app.zip
Expected behavior
It should be possible to install an application bundle that has been archived in zip format.
Screenshots
System
Other details
Based on local testing, the likely root cause appears to be as follows:
After downloading
myapp.app.zip
, theextractArtifact
method is executed inArtifactUnpacker
due to the zip file format.tophat/Tophat/Utilities/ArtifactUnpacker.swift
Lines 27 to 28 in de01ef9
The
extractArtifact
method unzipmyapp.app.zip
into amyapp.app
directory (without the.zip
extension), resulting in a nested structure like$DOWNLOADED_DIRECTORY/myapp.app/myapp.app
. The method returns$DOWNLOADED_DIRECTORY/myapp.app
as a destination.tophat/Tophat/Utilities/ArtifactUnpacker.swift
Lines 58 to 65 in de01ef9
The unpack method is then called again with extractedURL as an argument.
tophat/Tophat/Utilities/ArtifactUnpacker.swift
Lines 28 to 29 in de01ef9
Since artifactURL is
$DOWNLOADED_DIRECTORY/myapp.app
, the file format is interpreted as applicationBundle, andAppleApplication(bundleURL:)
is returned. However, the correct bundleURL should be$DOWNLOADED_DIRECTORY/myapp.app/myapp.app
.As a result, the incorrect download path prevents the bundle from being installed on the iOS simulator.
tophat/Tophat/Utilities/ArtifactUnpacker.swift
Lines 35 to 36 in de01ef9
The text was updated successfully, but these errors were encountered: