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: Avoid unzipping of real device .ipa bundles #2388

Merged
merged 17 commits into from
Apr 26, 2024

Conversation

mykola-mokhnach
Copy link
Contributor

We can install iOS apps on real devices without unzipping them. This should allow to save time on session startup as we don't need to unzip anymore. Also the installation itself should perform better as the size of a compressed .ipa file is lower than the size of an uncompressed one, and we are always limited by the (USB2.0) transfer speed.

@KazuCocoa
Copy link
Member

KazuCocoa commented Apr 23, 2024

Will this drops ios-deploy as well? I may need to find better test app which worked with ios-deploy but not in current installation method in the past if this implementation can cover such a case. It will take a bit time to prepare test app (maybe the test app should not be a small sample app)

@mykola-mokhnach
Copy link
Contributor Author

Will this drops ios-deploy as well? I may need to find better test app which worked with ios-deploy but not in current installation method in the past if this implementation can cover such a case. It will take a bit time to prepare test app (maybe the test app should not be a small sample app)

Yes it does. I did not see any cases where ios-deploy worked while we were not able to install the app using appium-ios-device lib

@KazuCocoa
Copy link
Member

KazuCocoa commented Apr 24, 2024

Sounds reasonable. I'll prepare testing app first, which could have kind of large amount of size.
btw, this change makes sense since for example in case an ipa has 70 MB, the unzipped one could be 200MB. The amount diff 100MB+ impact the file transfer

@KazuCocoa
Copy link
Member

70mb ipa, which is 200mb+ app

this pr:

2024-04-26 06:22:48:442 - [XCUITestDriver@2bdf (3020466d)] App 'com.kazucocoa.sample' is not installed yet or it has an offload and cannot be detected, which might keep the local data.
2024-04-26 06:22:48:442 - [debug] [XCUITestDriver@2bdf (3020466d)] Installing '/Users/kazu/Desktop/sample.ipa' on the device with UUID '242bfcc998fd156df0bd0ad1dde8ab8e0a032114'...
2024-04-26 06:22:54:884 - [debug] [XCUITestDriver@2bdf (3020466d)] A new application installation is going to be performed. Will timeout in 474158.760375 ms

default:

[debug] [XCUITestDriver@8235 (c10fbeef)] Installing '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/2024325-656-guiwmj.x8x4s/sample.app' on the device with UUID '242bfcc998fd156df0bd0ad1dde8ab8e0a032114'...
[debug] [XCUITestDriver@8235 (c10fbeef)] Using 'serial' app deployment strategy. You could change it by providing another value to the 'appInstallStrategy' capability
[debug] [XCUITest] Getting bundle ID from app '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/2024325-656-guiwmj.x8x4s/sample.app': 'com.kazucocoa.sample'
[debug] [XCUITest] Successfully scanned the tree structure of '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/2024325-656-guiwmj.x8x4s/sample.app'
[debug] [XCUITest] Got 303 folders and 742 files to push
[debug] [XCUITest] Successfully created the remote folder structure (304 items)
[debug] [XCUITest] Proceeding to serial files push
[debug] [XCUITest] Successfully pushed 303 folders and 742 files within 21292ms

parallel:

[debug] [XCUITestDriver@a904 (d1b51063)] Installing '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/2024325-527-4st004.jyqlt/sample.app' on the device with UUID '242bfcc998fd156df0bd0ad1dde8ab8e0a032114'...
[debug] [XCUITestDriver@a904 (d1b51063)] Using 'parallel' app deployment strategy. You could change it by providing another value to the 'appInstallStrategy' capability
[debug] [XCUITest] Getting bundle ID from app '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/2024325-527-4st004.jyqlt/sample.app': 'com.kazucocoa.samole'
[debug] [XCUITest] Successfully scanned the tree structure of '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/2024325-527-4st004.jyqlt/sample.app'
[debug] [XCUITest] Got 303 folders and 742 files to push
[debug] [XCUITest] Successfully created the remote folder structure (304 items)
[debug] [XCUITest] Proceeding to parallel files push (max 8 writers)
[debug] [XCUITest] Successfully pushed 303 folders and 742 files within 12770ms

Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

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

Not so large file, but I have tested improvements in a real device (over USB) in some file format, zipped ipa, ipa, zip, app. The behavior itself seems good for now

lib/real-device.js Show resolved Hide resolved
@mykola-mokhnach
Copy link
Contributor Author

2024-04-26 06:22:48:442 - [XCUITestDriver@2bdf (3020466d)] App 'com.kazucocoa.sample' is not installed yet or it has an offload and cannot be detected, which might keep the local data.
2024-04-26 06:22:48:442 - [debug] [XCUITestDriver@2bdf (3020466d)] Installing '/Users/kazu/Desktop/sample.ipa' on the device with UUID '242bfcc998fd156df0bd0ad1dde8ab8e0a032114'...
2024-04-26 06:22:54:884 - [debug] [XCUITestDriver@2bdf (3020466d)] A new application installation is going to be performed. Will timeout in 474158.760375 ms

So this means we took 6s to push the file? Seems a bit slow for 70MB. If we assume the average USB2 transfer limit is 30MB then it should only take 2-3s

@mykola-mokhnach
Copy link
Contributor Author

Could you also please check the application upgrade path on real devices @KazuCocoa ?
The scenario is:

  • Install older .ipa via capabilities
  • Using installApp extension install a newer version of the same .ipa

@KazuCocoa
Copy link
Member

Yea, tested the same file with the log

2024-04-26 07:02:31:423 - [debug] [XCUITest] Successfully pushed the file payload (75.30 MB) to the remote location '/sample.ipa' in 5918ms

@mykola-mokhnach mykola-mokhnach marked this pull request as ready for review April 26, 2024 07:10
@KazuCocoa
Copy link
Member

Yea, I did that. appium:enforceAppInstall combination was also

Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

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

lgtm

@mykola-mokhnach
Copy link
Contributor Author

Thanks for your help on this PR @KazuCocoa
I appreciate it

@mykola-mokhnach mykola-mokhnach merged commit 520168a into appium:master Apr 26, 2024
18 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 26, 2024
## [7.15.0](v7.14.0...v7.15.0) (2024-04-26)

### Features

* Avoid unzipping of real device .ipa bundles ([#2388](#2388)) ([520168a](520168a))
Copy link
Contributor

🎉 This PR is included in version 7.15.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