Safari Web Inspector network throttling - debugging

I'm currently remote-debugging a website on my iPhone using Safari v8 and need to simulate different network speeds.
The Chrome Developer Tools have the functionality to throttle the network connection (simulate 3G, wifi etc.) or even to completely switch it off.
Does the Safari Web Inspector have similar functionality?
At the moment I'm getting around it by just switching off my wifi as I just need to test no network for now, but might need the functionality in the future.

There is currently not a way to do that natively in Safari but you might try using something like Charles Proxy that can throttle your browser or system connection (win, mac, linux).

Just found a way to do it without having to use a proxy like Charles:
Install XCode
Connect iPhone to mac via USB
Launch XCode
Access developer settings on iPhone
Use "Network Link Conditioner"
Longer blog post I wrote: Enable network throttling on iPhone in 5 steps
Hope this helps!

Update for 2023 and later
Other answers are no longer up to date and don't work anymore. Today you need to use an add-on from Apple called Network Link Conditioner.
You can download it with additional tools for xCode.

Related

How to disable SIP on macOS VMs for macOS UI testing in CI/CD environment?

I have been trying to run my macOS UI tests on a remote machine(VM), and it does not work. On a local machine, it works after giving the permissions related to accessibility. After digging through, I realised that you need to have SIP disabled and add the relevant permission.
So, how can I disable SIP on a headless machine in a CI/CD?
Unfortunately, it is not possible to disable SIP on a remote machine. You have to boot in safe mode and disable it from the terminal. And that requires direct access to the machine.
You can ask your provider if they can disable SIP for a specific machine for you, or you can look for providers that do.
There are a few out there, with Codemagic being one of them.
We released SIP disabled macOS images with the latest and beta Xcode versions so you can run macOS UI tests without any extra configuration.
It was frustrating not being able to test the UI of a Mac app, but I’m happy with what we managed to release.
I also wrote a blog post if you are interested in getting started with macOS UI testing.
Full disclosure - I’m a DevRel at Codemagic CI/CD, focusing on helping the community build for Apple platforms.

Remote Desktop for Mac - issue with JavaFX app - PDFBOX

I have written a JavaFX app running on Windows 10 machine in the office which has problems showing (painting/rendering) certain embedded controls such as a Pane with PdfBox when I connect to it with Remote Desktop for Mac. It shows only a black screen in the app instead of the pdf document.
When I connect using RDP from my Windows 10 machine at home to my Windows 10 machine at work, the app works just fine (the pdf is shown in the app).
I have the same problems using AnyDesk and Teamviewer.
The app only shows PDFs properly using a connection from Windows 10 to Windows 10 with Microsoft RDP.
It might be a JavaFX issue. Similar issues are described here (although not 100% identical):
https://bugs.openjdk.java.net/browse/JDK-8239589
https://bugs.openjdk.java.net/browse/JDK-8229394
However, since I guess Microsoft Remote Desktop for Mac is using the same technology as the Windows Desktop client, I would have expected it to work fine.
I have a Mac Mini M1 running the latest OS (Monterey) at the time of writing this post. I am also using the latest Remote Desktop client for Mac.
This problem is not new and was also present in older releases.
I have tried to play around with screen resolutions, both on Host and Client but nothing good came out of those tests.
Disabled also hardware acceleration in Remote Desktop for Mac preferences but it didn't change anything.
The machine at the office has the following specs (which I cannot change nor update)
Edizione Windows 10 Pro
Versione 20H2
Data installazione: ‎10/‎09/‎2021
Build sistema operativo 19042.1415
Esperienza Windows Feature Experience Pack 120.2212.3920.0
Anyone else who has seen this problem and perhaps resolved it?
Could it be a bug in either PdfBox or Remote Desktop for Mac?
Except for the above issue, the Remote Desktop Client for Mac is working great (not lagging as TeamViewer or AnyDesk) and the user experience is phenomenal.
PS: While this might be considered a programming question (since I wrote the app with JavaFX) but it might be better to post on another forum? If yes, which one? On the other hand, many similar posts (look at the suggested thread on the right) have been upvoted despite not dealing with programming issues.
Thanks.
How do you use PDFBox? I ask because this is not a JavaFX component. If you use a SwingNode for that it might be interesting to try one of my two PDFViewer demos here and see whether the problem persists.
https://github.com/mipastgt/JFXToolsAndDemos#awtimage
The difference is in how I do the rendering and maybe that makes a difference for your use-case too. But of course this is just a wild guess and I can't promise anything.

How do I fix xamarin.ios app crash on launch in iPhone 8 cellular data?

We have develop a xamarin.ios app thats work fine on all iPhone and iPad except iPhone 8. Its crashed on launch in iPhone 8 on cellular data. Its working good on wifi. I don’t have iPhone 8 device right now, so I am checking it on simulator. But simulator using wifi and its working good on simulator. How can I identify the problem and how to solve it?
FYI we are consuming a service on app launch that need an active internet. Any idea, Please reply.
This should really be a comment, but I don't have the reputation for one.
Without knowing what is happening when your app has launched, have you tried testing your app without a Wi-Fi or data connection?
The issue might be that your clients device is getting a different response from the service that you have not accounted for and this might be causing exceptions etc.
We are checking on IPv6 network but our API was not compatible to IPv6. When we change the network to IPv4, Its work perfectly. But as per apple guidelines we must have to compatible our API to IPv6 network.

No devices detected when remote debugging in Chrome Developer Tools from Windows 7 Enterprise to Samsung Galaxy Tab A

I am having problems with a web application on Chrome in Samsung Galaxy Tab A.
I want to troubleshoot them with Chrome's Developer Tools.
On tablets you do not have access to Chrome's Developer Tools, so you need to set up Remote Debugging.
The process, according to Google's official documentation, should essentially be:
1) Install the required driver on the PC so the tablet can be recognised.
2) Connect the tablet to the PC via USB cable.
2) On PC, go to Chrome > Developer Tools > Menu > More Tools > Remote devices
The tablet is not showing up as a device in developer tools in chrome on PC.
What I've Tried
I chatted to Samsung and they said to install Smart Switch PC_Setup.exe which would install driver so that Android device can be recognised.
As that didn't work I followed various post suggestions and installed:
SAMSUNG_USB_Driver_for_Mobile_Phones.zip (15.3MB) from here
SDK Platform-Tools for Windows (7.16MB) from here
sdk-tools-windows-3859397 (132MB) from the bottom of the page here
All of these contain exe files that I don't know how to use - if I double click them they just open and close a terminal.
Desired Behavior
To have tablet show as a device in Chrome developer tools.
To get my Samsung S7 to connect, I did the following.
Download Samsung's USB Driver for Windows from here: http://developer.samsung.com/galaxy/others/android-usb-driver-for-windows
Install the driver
Uninstall the driver. It's important to do this step, as your device won't connect until you uninstall. Strange, I know!
I initially reported this solution in the comments section here but I didn't think it was a legitimate solution. I've since been able to reproduce this on 2 Windows 10 Pro devices and others have also confirmed.
2019-05-10 Update
After a Windows Update, this stopped working so I went through the process outlined above again. Installed driver then uninstalled driver and everything started working again.
This was my solution to show device in Chrome Developer Tools:
1) Download SDK Platform-Tools for Windows (7.16MB) from here.
2) Extract zip file.
3) In Windows terminal run your equivalent of:
D:\Users\You\path_to_extracted_folder\adb.exe devices
At first I got:
[5203253125 - long number] unauthorised
And then I think I unplugged and replugged USB cable from tablet and there was a prompt on the tablet:
Allow USB Debugging?
The computer's RSA key fingerprint is:
blah blah etc
to which I click OK
And I can now see device in Chrome Developer Tools!
I find the best approach these days is to not use vendor-provided drivers. They're often difficult to install, and frequently come bundled with tools that aren't required and which get in the way. I tend to use the "universal" driver that can be downloaded from http://adbdriver.com/, which comes with a very simple, easy-to-use installer: run the installer, it gives a list of phones or tablets attached to your computer via USB, press a button and it installs the driver for the selected device.
Update for 05-2019
See the comment from Johnny Oshika in the approved answer. This works every time for me.
I think this is purely coincidental, but after I installed and
uninstalled Samsung's USB Driver for Windows from here
developer.samsung.com/galaxy/others/…
(SAMSUNG_USB_Driver_for_Mobile_Phones.zip (15.3MB) to be exact),
Chrome's dev tools detected my device. Not sure what made this work.
It could have been the numerous times I connected and disconnected the
cable. Not sure though. – Johnny Oshika Oct 18 '17 at 21:17

Getting Network Link conditioner to only affect iOS Simulator, not the entire Mac?

Is there a way to use Apple's Network Link Conditioner in such a way that it only affects the iOS Simulator, and not the rest of the Mac?
My KB+M is connected to the Mac via a program called Synergy, which lets me share my Windows KB+M with it, and attempting to run unit tests on the iOS Simulator with any packet loss profiles selected in the Network Link Conditioner makes it almost impossible to control the Mac at all.
I have had the same issue for a while and have been trying to find a solution.
I eventually gave up and started using the Charles Web Proxy instead because it's free (they claim only for 30 days but it works forever) and it allows you to choose which websites you want to throttle internet access for.
Please share if you can do something like that with the network link conditioner.

Resources