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

Add doc for android startup scenario local testing. #4664

Merged
merged 8 commits into from
Feb 4, 2025

Conversation

LoopedBard3
Copy link
Member

Add first iteration of a doc for android startup scenario local testing.

@LoopedBard3
Copy link
Member Author

Lint failures are unrelated to this PR, or markdown we manage. The failures are in eng/common/template-guidance.md.

@LoopedBard3 LoopedBard3 force-pushed the AddAndroidDocumentation branch from 131d373 to 081ab90 Compare January 27, 2025 22:40
Copy link
Member

@matouskozak matouskozak left a comment

Choose a reason for hiding this comment

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

Thanks a lot for submitting the doc!

docs/android-startup-scenarios.md Outdated Show resolved Hide resolved
docs/android-startup-scenarios.md Outdated Show resolved Hide resolved
Copy link
Member

@matouskozak matouskozak left a comment

Choose a reason for hiding this comment

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

These are no longer necessary I believe

docs/android-startup-scenarios.md Outdated Show resolved Hide resolved
docs/android-startup-scenarios.md Outdated Show resolved Hide resolved
caaavik-msft
caaavik-msft previously approved these changes Jan 28, 2025
```sh
python test.py devicestartup --device-type android --package-path <path to apk (e.g. .)>/<apkname>.apk --package-name <apk package name> [--disable-animations]
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add information about where the results of the performance test can be found or an example of what the output should look like.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added section on this.

docs/android-startup-scenarios.md Outdated Show resolved Hide resolved
cd helloandroid
```

3. Copy the APK into the `helloandroid` directory.
Copy link
Member

Choose a reason for hiding this comment

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

Is there any correlation between dotnet version used for building the .apk and the one used as part of the environment?

Copy link
Member

Choose a reason for hiding this comment

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

This script should work with any .apk, cc: @LoopedBard3

Copy link
Member Author

Choose a reason for hiding this comment

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

There should not be any correlation if using a separately built APK. There are scenarios that this does not currently cover where the dotnet version would matter, e.g. when building Maui apps with pre.py the dotnet version will matter.

Copy link
Member

Choose a reason for hiding this comment

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

I am a bit confused, could you please clarify:

  • Is this doc specific to HelloAndroid (the dotnet/runtime) sample, or it refers to any Android app - any .apk?
    • If it is the former - only HelloAndroid sample, there are couple of issues I can see with it:
    • If it is the latter, then we should rename the scenario to avoid confusion (or create a new one which would be just for this purpose). Maybe androidstartup or something like that, the point is that it shouldn't refer to HelloAndroid in any way for the above mentioned reasons

Copy link
Member Author

Choose a reason for hiding this comment

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

The doc is more general for any APK, so I went ahead and added a new scenario folder named genericandroidstartup to make it more clear that it can be used for any APK. The reason we have the specific scenarios for some of the other apps is some of the pre.py files can build the apps (like the mauiandroid), but most of the test.py's for the android testing are interchangeable.

docs/android-startup-scenarios.md Outdated Show resolved Hide resolved
docs/android-startup-scenarios.md Outdated Show resolved Hide resolved
matouskozak
matouskozak previously approved these changes Jan 31, 2025
Copy link
Member

@matouskozak matouskozak left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 30 to 32
```sh
python/(py -3 on Linux) test.py devicestartup --device-type android --package-path <path to apk (e.g. .)>/<apkname>.apk --package-name <apk package name> [--disable-animations] [--use-fully-drawn-time --fully-drawn-extra-delay <delay in sec> (**see below for note**)]
```
Copy link
Member

@ivanpovazan ivanpovazan Feb 3, 2025

Choose a reason for hiding this comment

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

This looks cryptic when observed as a shell command.
I suggest splitting it into multiple commands for example:

  • non-Linux
python test.py devicestartup --device-type android --package-path <path-to-apk> --package-name <apk-package name> [--disable-animations] [--use-fully-drawn-time --fully-drawn-extra-delay <delay-in-sec>]
  • Linux
py -3 test.py devicestartup --device-type android --package-path <path-to-apk> --package-name <apk-package name> [--disable-animations] [--use-fully-drawn-time --fully-drawn-extra-delay <delay-in-sec>]
  • Please refer to the Notes below about specifying --use-fully-drawn-time --fully-drawn-extra-delay parameters

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems we can use python for both windows and Linux, so I kept just 1 reference. Also added the reference to the notes separately.

Copy link
Member

@matouskozak matouskozak left a comment

Choose a reason for hiding this comment

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

I'm unsure about the py -3 suggestion for Linux... Isn't py -3 specific to Windows Python Launcher? In my experience, I always use python or python3 on Ubuntu or macOS.

I think we should have example for:

  • Windows
  • Unix-based (that should work for both Linux and macOS)

…d and updated the python reference to only have python.
@LoopedBard3
Copy link
Member Author

I'm unsure about the py -3 suggestion for Linux... Isn't py -3 specific to Windows Python Launcher? In my experience, I always use python or python3 on Ubuntu or macOS.

I think we should have example for:

  • Windows
  • Unix-based (that should work for both Linux and macOS)

Looked again. It seems we should be able to get away with using just python on both Linux and Windows. So I switched to just using python in the doc.

Copy link
Member

@ivanpovazan ivanpovazan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@LoopedBard3 LoopedBard3 merged commit 0f9ce0f into dotnet:main Feb 4, 2025
71 of 84 checks passed
@LoopedBard3 LoopedBard3 deleted the AddAndroidDocumentation branch February 4, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants