how to open a local web project in ios simulator in Visual Studio? - debugging

Let say I have an angular project on local, separating back-end and front-end. After starting my BE, I am able to consume my front-end accessing http://localhost:4200/ in browser.
If both my BE and FE have been started, is there a way to access http://localhost:4200/ or http://[myipaddress]:4200/ in an iOS simulator safari, so that I can see my staging result in the simulator?
I know Chrome and any other browser is able to simulate mobile devices in device mode, unfortunately, there are results in a real device that are different than that in device mode. Thus I really want to find a way to see the bug fixing result in an iOS simulator without deploying to production.
I tried to set inbound rule for port 4200 and accessed http://[myipaddress]:4200 in safari in a simulator , it said 'Safari could not open the page because the server stopped responding'. (myipaddress = IPv4 Address in ipconfig).
Any hints?

You may have something in your specific setup stopping you from doing so, but you could just use the simulator included with Xcode, which should have no issues connecting to your localhost address on a given port.

Related

Cannot view mobile app for tab development

I am trying to create a layout for our teams channel tab app but when running the app locally and inspecting it as a mobile device, teams throws an error that the browser is not supported.
Can anyone point me in the correct direction to develop my app for mobile use or how I can view the mobile app from the VS Code Teams Toolkit debugging tools?
I have tried to run the app in chrome and in MS Edge browsers and use the inspector device emulators in both but get the same error. I have also tried connecting via my local machine's IP /the FE port 53000 and also have had no luck there.
I used directly my mobile device (android) with Teams App installed for debugging teams custom tab (both phone and tablet worked fine). Connect your android device to your laptop/desktop (using USB), and then on the phone:
Enable USB debugging
Enable "Developer Preview" in Teams options
In the desktop chrome, navigate to chrome://inspect/devices and you should see your device there in the list available for inspection/debugging. You could probably also connect using local WIFI (?), but I have not tried that. Also never tried that with Edge, so not sure if it works.
https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/developer-tools#access-devtools-from-an-android-device
It's not possible to debug a Teams tab on iOS using Windows (or Mac). Using Dev Tools, we can debug Teams tab in desktop and Android clients.
Ref Document: https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/developer-tools

Xamarin Android 10 UDP Client In Background (Release Mode Only)

I am having an issue with the UDPClient in Android 10 (worked fine in Android 9) so Im assuming Im missing from Android 10 that I have yet to be able to find so far.
I have a UDPService (background service) running which is a pretty standard implementation (Port is 64200)
m_udpSocket = new UdpClient(m_port);
m_udpSocket.Client.ReceiveTimeout = (int)m_healthTimeout.TotalMilliseconds;
m_healthSocket.Client.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, (int)m_healthTimeout.TotalMilliseconds );
I wont post the sending and receiving code at this stage as I think its more permissions related.
The client periodically sends some UDP data to the server for processing. Its all local network based (not internet) and the data is sent via the WiFi on the device.
In Android 9, it all works as expected with the app in the foreground or the background.
In Android 10, it works perfectly when the app is in the foreground, but when the app goes to the background, when I try to issue the send on the socket
System.Net.Sockets.SocketException (0x80004005): Access denied
This error only happens in release mode on Android 10. If Im running in Debug Mode attached to the device, I can put the app into the background and the UDP traffic works as expected.
Based on all the above, Im assuming there is something else I need to do to allow the socket to work in the background in release mode but I cant seem to put my finger on what it is. Ive read about INTERNET permission and how Debug mode automatically adds this so is there something else I may be missing in the Android Manifest that could cause this.
Any help would be greatly appreciated.
Thanks in advance.
For anyone experiencing similar problems, in the end it had nothing to do with the actual code, but it was the Battery Optimisation Settings in Android.
Once I removed the app from the automatic battery optimisations, everything worked as expected.

How do I force my Google home to download latest version of the local app

I'm developing the smart device handler using Google Home Local SDK.
How do I force device to reload and restart the app? (now I have to unplug the power cord, it does not looks good as it sparks)
also I have a couple of Google Home devices, how do I tell which of them should execute requests, is it possible to pin 'master' device?
I'm developing the smart device handler using Google Home Local SDK. How do I force device to reload and restart the app? (now I have to unplug the power cord, it does not looks good as it sparks)
Currently (during developer preview) you have to reboot the Home device to reload your local app. In an upcoming release, you will be able to refresh your app inside of Chrome DevTools but there is currently a known issue preventing this.
While unplugging your device may be the fastest way to reboot it, you can also reboot your device from within the Google Home app. Select the device, choose Settings, and you'll find Reboot in the overflow menu in the app toolbar.
I have a couple of Google Home devices, how do I tell which of them should execute requests, is it possible to pin 'master' device?
Local execution currently relies on the Home Graph to determine whether to send a command locally. If the Home device and end device are configured in the same structure (and the device can be locally identified), then EXECUTE will be sent locally.

Not able to debug phonegap app running on windows 8 mobile

I have a phonegap application that has some layout problems. I can run the app in browser for the most part, and this usually get me over the line. But with a new design I need to debug the application layout on windows phone 8.
I'm currently looking at weinre but its not showing anything on the desktop when browsing the local server, I have added the link to my application I have cleaned up everything I can think of. Still blank. Any good tuts around the ones I have read just copy and paste the original docs or are not on my same error.
There's a public weinre server available here:
https://the-weinre.herokuapp.com/
You may have better luck with that than with your local server. There's a demo available on that page, give that a try and see if it works on your windows 8 mobile device.

Debugging network requests with iOS Simulator, network request data is not showing

I am trying to debug the network requests for a hybrid/webview cordova based application in the ios simulator, actually see the network requests in the Safari Web Inspector. I am trying to use the Web Inspector within Safari to monitor the network requests to the server but all I see is the "timeline" graph, I don't see the actual URI requests. Is there a way to enable this?
I build my application through xcode. Launch the iOS simulator with iPad2 selected/iOS 8.1. I then launch Safari and select the "ios simulator/index.html" to launch the web inspector. And then click on network requests. The resources tab pane is empty when I make web request calls. Is there a way to fix this so I can see the url requests?
Xcode: 6.1.1
Safari: 7.1.3
OSX: 10.9.5
I'm not quite sure if it's even possible to do that via web inspector or not but put option 1 just in case. I highly recommend you to go with Option 2 tho.
Option 1
First make sure you don't have anything filtered, then make sure recording is on as shown in picture.
Option 2. RECOMMNDED
Use an http monitoring tool. They are design to do that specific task plus you get many more options such as breakpoints, etc.
Charles Proxy. (MAC) The best IMHO. You can set breakpoints and alter request/response if needed. And many other features.
HttpScoop (MAC) Easier to use, but less functionality.
fiddler (WINDOWS) Just in case.
PS. Some one might say Wireshark, I know but it's too complicated for such work.
[UPDATE 1]
To make it clear you don't need to set any proxy on iOS simulator to get these tools working. In case of SSL connections you want to use charles and follow their SSL guideline.
I use Proxyman to monitor network traffic from the iOS simulator for the following reasons -
It has a clear set of instructions on how to set it up with both iOS
simulators and Android emulators.
It has a simple, intuitive UI, which makes it easy to work with.
Also, you might find it worthwhile going through this stackoverflow post.

Resources