Can I debug iOS on Windows?

Hello @AndresOlivares-4330 ,

Xamarin Hot Restart enables you to quickly test changes to your app without a Mac machine during development. You need to download iTunes and install it, then sign in your Apple Dev account and enable Automatic Provisioning. For more details, refer to //docs.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/hot-restart
There are also some limitations, you cannot use Xamarin Hot Restart to create app bundles for publishing, it just for development.

Best Regards,
Wenyan Zhang

If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


I recently came to an awkward situation, unsure how to resolve it. Thanks to the help of inspect.dev, I was able to find my issue and continue development.

A few weeks ago I began working on a small freelance project, using Flask, MongoDB, and some vanilla HTML/JS/CSS. I had separated my project into the frontend application as its own Flask application, and the API as its own Flask application. I primarily did this because I didn’t want to expose database models to the client, as well as simplify the development process [I am working with a buddy who handles primarily the frontend side of our project].

Project’s folder structure

Context:

I had deployed both applications to Heroku, which is configured for easy deployment of applications, with options of free tiers to users. Everyone has most likely faced a CORS [Cross-Origin Resource Sharing] issue before, as have I. Everyone had been tested and validated locally, and on my chrome browser in Windows 10. All is great, right? Nope.

Issue I had faced:

I had tested all browsers on Windows 10, however I knew the application may be used at some point on iOS. I luckily own an iPhone and iPad I was able to test it on [if I would have had a mac, things would be a lot easier].

I noticed that none of the data I was expecting was loading, and the Heroku logs only indicated that I was receiving OPTIONS requests from my apple device. I searched and searched why I was only receiving OPTIONS requests from my device, and came to learn that Apple has a different set of restrictions for Preflight requests.

Preflight Requests: Small request that is sent by the browser before the actual request. It contains info like which HTTP method is used, as well as if any custom HTTP headers are present. This gives the server a chance to examine what the actual request looks like before it’s made. [source]

So now I know that, although I was getting a successful preflight response status [200], I couldn’t figure out the custom header it wasn’t liking.

Remember I have been doing this on an iPad, and no dev-tools are easily viewable on the actual device. Here is where the magic happens

Debugging an iPad’s browser with Windows 10:

Inspect has thankfully built an npm package for debugging iOS devices from your chrome browser on your machine. Prerequisite for this would be to ensure you have Node.js installed.

Step 1: Install the npm package

npm install remotedebug-ios-webkit-adapter -g

Note that this has technically been migrated to inspect.dev’s application, however for the sake of this project this package was sufficient.

Step 2: Plug in your apple device

Step 3: Start the remote debug package on an unused port:

remotedebug_ios_webkit_adapter --port=9000

Step 4: Open chrome on windows, and navigate to device inspection

chrome://inspect/#devices

Step 5: Select Configure ‘Discover network targets’

Select configure…

Step 6: Add the port you have opened from running the debugger

For me, this was ‘localhost:9000’

Step 7: Enable web inspection from your iOS device

Settings > Safari > Advanced and toggle Web Inspector

Step 8: Click inspect under the target

You should now be able to inspect your device and its devtools!

Summary:

I found out after viewing the network logs, that my server’s CORS configuration had a response header of Access-Control-Allow-Origin set to “*”, meaning the origin was not locked to one url. This doesn’t work with iOS’s preflight request policies. I altered this to map to the app’s url, redeployed, and all was successful.

I was thankful to see the logs on my iOS device, right from my work station. It was hard to research, but quick to debug and will definitely be used in the future.

Can I debug iOS app on Windows?

Also, you can go to App live and upload this file to run the test on the device that you prefer. Now that you have an iOS app ready, you can deploy this into the windows platform to test the application and check for its compatibility. Now, let's launch the Live Browserstack tool to test the application on windows.

How do you inspect element on iPhone Windows?

Download and install LT Browser on your system. Open the browser, select the iPhone device viewport from the left device panel, and enter the website URL you want to inspect. Press the debugger button to open the web inspector and start inspecting elements on an iPhone or an iPad.

Is there USB debugging on iOS?

Using Safari Remote Debugging Apple's iOS 6 update introduced Safari Remote Debugging, which allows you debug web pages in the Safari app on iOS devices. To get started, follow the steps below: Connect your iOS device to your machine via USB cable. On your device, open the Settings app.

How do I debug iOS in Chrome?

Near the top of the menu you should see your iPad or iPhone listed. Hover over your device in the menu and you'll see Safari with each tab listed below. Click the one you want to debug. The Web Inspector should then appear, now debug it: Elements, Console, Sources, Network, all of it should work!

Chủ Đề