tim-smart / dart_emulators

A utility library to automate mobile emulators.
MIT License
22 stars 9 forks source link

Status bar elements that shouldn't be there #22

Open Francesco-FL opened 10 months ago

Francesco-FL commented 10 months ago

Hi, thanks for the plugin you created, it's very useful.

I encountered some situations on the status bar that I'll list for you:

  1. Android "cellular signal": the signal at the beginning is full and normal, as required by the Google Play lines, but sometimes after a few seconds, taps and other, it becomes not completely full, and at the same time sometimes writings like "LTE" and "3G". Example devices: Google Pixel 4 XL, Nexus 5x
cellular signal
  1. On some iOS devices such as iPhone 8 Plus, the name of the network is displayed (localized based on the language of the device), and if I create screenshots for different languages ​​using the "locales" that you make available, I find the app showing a different language from the network name in the status bar, which is not good for screenshot.
rete iphone 8 plus
  1. The time on the iOS device is the computer's time, not a default time like "12:00". This is not good aesthetically and if I take several screenshots for the same device that need to perform animations and then wait some time, I risk having perhaps one screenshot with the time "15:25" and one with "15:26"
rete iphone 8 plus
  1. Trying to take screenshots with the iPad Pro 6th gen I noticed the same error as point 2, but this time the localized writing is the date, which remains so regardless of the locale set.
giorno e ora

Unless you have other ideas, I thought of this: For the writings, remove them if possible, or otherwise set the locale as the system language, but I still don't know if it's possible. For the cellular signal, it would be enough for me to have the possibility of not putting it on at all, not even in the previous screenshots I had it.

tim-smart commented 10 months ago

Hi, I don't have the time to look at this sorry.

But you can submit a PR. You will need to change: https://github.com/tim-smart/dart_emulators/blob/92eec729a6078ac6a9c2a65b592ecc92d9a49336/lib/src/device/platforms/android_device.dart#L91 https://github.com/tim-smart/dart_emulators/blob/92eec729a6078ac6a9c2a65b592ecc92d9a49336/lib/src/device/platforms/ios_device.dart#L72

Francesco-FL commented 10 months ago

I did some research and this is what I found:

  1. I removed the mobile data by editing android_device.dart: 'shell am broadcast -a com.android.systemui.demo -e command network -e mobile hide', I was unable to resolve the anomalous change in the signal bars, so I decided to remove them

  2. For this need to add two parameters in the iOS launch, namely <--cellularBars> <4> to show the 4 signal lines as requested by Apple https://developer.apple.com/app-store/marketing/guidelines/#section-products and <--operatorName> <> to delete the name of the telephone operator. I tested with ios 16.4 and 16.0, and got nothing, while with ios 15.5 it was successful, so I would say it only works with ios 15.5 or lower.

  3. The problem is the version of iOS in the simulator. After iOS 16 it seems that Xcode has a bug that doesn't allow you to edit the status bar https://stackoverflow.com/questions/74507031/xcrun-simctl-status-bar-not-working-on-xcode-14-1

For the language I did a lot of research, but unfortunately I didn't find anything that worked.