Skip to content

Mobile/android questions #4492

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

Open
soulgalore opened this issue Apr 1, 2025 · 2 comments
Open

Mobile/android questions #4492

soulgalore opened this issue Apr 1, 2025 · 2 comments

Comments

@soulgalore
Copy link
Member

Your question

Hey @soulgalore could you help me understand the mobile emulation part on sitespeed.

I have read the documentation for mobile emulation. Referred links are as follows

https://www.sitespeed.io/documentation/sitespeed.io/mobile-phones/
https://www.sitespeed.io/documentation/sitespeed.io/mobile-phones/#test-on-emulated-mobile
https://www.sitespeed.io/documentation/sitespeed.io/cpu-benchmark/
https://www.sitespeed.io/documentation/sitespeed.io/configuration/
So below are my questions regarding it

Android

When I run sitespeed.io --android https://www.sitespeed.io do I need to have Android real device as documentation asks to enable developer mode after installing apt-get install android-tools-adb .Reference link

Mobile

I was able to use --mobile for testing the website on default device that is Moto G4 but I was not able to understand how to pass width/height. Also can I select any other mobile device using this option?

--browsertime.chrome.mobileEmulation.deviceName

This allowed me to select another mobile device which is great but then whats the difference between --mobile and --browsertime.chrome.mobileEmulation.deviceName argument. Like which argument has what benefits? Is it CPU throttling

Also one followup question is why the --android argument asks for developer mode but the other arguments work without it.
Is it because --android option allows us to test it on real device?

@soulgalore
Copy link
Member Author

--android

Yes that is the switch to use a real Android mobile phone/tablet. The documentation for that is: https://www.sitespeed.io/documentation/sitespeed.io/mobile-phones/#test-on-android

--mobile
The name is confusing because it was added before we had the possibility to run on real devices. It really means "run a desktop browser and emulate it as a mobile browser".

I was able to use --mobile for testing the website on default device that is Moto G4 but I was not able to understand how to pass width/height. Also can I select any other mobile device using this option?

If you one of these for emulated, the width and height should be set automatically: https://github.com/sitespeedio/browsertime/blob/main/lib/support/getViewPort.js#L10-L36

--mobile and --browsertime.chrome.mobileEmulation.deviceName argument.

--mobile just takes the default one (Moto G4). Setting another device name will give another user agent and width/height. For CPU throttling you need to specify that yourself.

@Domanicfaf
Copy link

Ohh thanks for creating another issue and helping me on this 🙏. Now I get it.
Will remember to not hijack another issue next time 💯 😊

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

No branches or pull requests

2 participants