Is it possible debug iOS Chrome on Windows 10? - ios

As the title says, I need to debug a website opened with mobile Chrome on an iOS device (iPod, iPad etc.) on Windows 10. I have successfully set up iOS Safari debugging on Windows 10 via Chrome DevTools (GitHub repo , helpful comment). I would love to do the same thing except with Chrome or Firefox and not Safari. Is it even possible?

Yes it is. You'll need node first and (web inspector enabled on iOS>Settings>Safari) then...
Install weinre sudo npm -g i weinre (or) npm i -g weinre
Run weinre weinre --boundHost YOUR_IP:PORT
When it runs copy paste the following script to your code
<script src="http://YOUR_IP_ADDRESS:PORT/target/target-script-min.js"></script>
Connect your iOS device via USB
Go to http://YOUR_IP_ADDRESS:PORT/client/ from your browser (your pc) where you want to debug and you'll see your device.
Error in Step 2
If you see any error in step 2, first check your IP via ipconfig and then bound a similar IP with a free port that is not being used. For example my local ip is 192.168.1.5 so I used the same with a free port - 192.168.1.5:4576
Error in Step 5
If you can't see your device try adding a name myDevice to the script in Step 3 as follows
<script src="http://YOUR_IP_ADDRESS:PORT/target/target-script-min.js#myDevice"></script>
Then in Step 5, when reaching your device add the device name to the URL as
http://YOUR_IP_ADDRESS:PORT/client/#myDevice
SUCCESS
If everything runs fine, you'll be able to inspect your code, read indexedDB, session and localStorage and see outputs in Console among other dev tools.

I found this link very helpful.
No other answer or article on web is more straight forward than this: washamdev
It's a verbose article so I cannot put everything here. Hope the link does not break.

Related

Chrome Devtools Remote IOS Debugging Network Domain Not Found

I am trying to setup remote debugging between a Win 7 laptop running chrome and an Apple iPhone running Safari. I am using chrome-devtools to establish the connection. I am using an ios-webkit-debug-server on the laptop and a python3 local http.server on the iPhone. I can get the laptop to connect and identify the iphone as a remote device. I copy and paste the link to devtools://devtools/bundled/inspector.html?ws=localhost:9222/devtools/page/1. I get the following messages. I have tried disablining the firewall but no change. It appears that devtools cannot setup the network logging because it cannot find the network domain.Any help would be appreciated.
iPhone
IOS V12.5.1
Turned Web Inspector On
Start Server with Python3 -m http.server
In Safari (V12.5.1) I navigate to http://localhost:8000/test.html
Laptop
OS is Win 7
I start Powershell 7.1.3 running as administrator (WMF 5.1)
I start "ios-webkit-debug-server -f chrome-devtools://devtools/bundled/inspector.html"
I get Listing devices on :9221
I get Connected :9222 to jim's iPhone (??????...)
On Chrome I navigate to localhost:9221
I get "iOS Devices: 1. localhost:9222 - jim’s iPhone"
I click localhost:9222
I get "Inspectable pages for jim’s iPhone: 1. http://localhost:8000/test.html
I copy and paste "devtools://devtools/bundled/inspector.html?ws=localhost:9222/devtools/page/1"
I get following messages (Truncated error messages different commands network domain not found)
-07:27:59:432 Main._createAppUI: 39.85693359375 ms
-07:27:59.472 main.js:1 Main._showAppUI: 44.3681640625 ms
-07:27:59.616 main.js:1 Main._initializeTarget: 34.602783203125 ms
-07:27:59.718 main.js:1 Main._lateInitialization: 0.56689453125 ms
-07:28:00.424 protocol_client.js:1 Request Network.enable failed. {"code":-32601, "message":"
'Network' domain was not found","data":[{"code":-32601,"message":"'Network'domain was not found"}]}

Could not connect to development server. Error while running

I have tried to restart the server with npm start, npx react-native run-ios, npx react-native start. Those commands don't work for me. Help me out to run this project its a project created with npx react native init projectName.
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
The error shown on the emulator
Run adb reverse tcp:8081 tcp:8081 in your terminal then reload in the terminal after running yarn start or npm start, then reload. I hope this is helpful.
I had the same problem and spent hours working on it. I figured out that METRO which is run using this command: npm start or this one npx react-native start couldn't find its way to my mobile app.
one of the solutions that I wasn't totally pleased of was this: a solution that works but has flows
but that workaround wasn't perfect because I had to re-run the command every single time I make a change. So after further researches I found out that the port 8081 is used by an another application that METRO is sending information to ( this is only my guess ). so:
I run the following:
netstat -aon | findstr 8081 // to get the PID of the application that is running on 8081 port
I opened task manager ( CRTL + ALT + del ) under the service section I looked up any
application which uses the PID that matches the one given by the command I ran and I have
forced stopping it.
retried npx react-native start and npx react-native run-android on my project
and the magic happened. It auto refreshes with every change, I wish it helps you.
This is from the docs:
Method 2: Connect via Wi-Fi
You can also connect to the development server over Wi-Fi. You'll
first need to install the app on your device using a USB cable, but
once that has been done you can debug wirelessly by following these
instructions. You'll need your development machine's current IP
address before proceeding.
Open a terminal and type /sbin/ifconfig to find your machine's IP address.
Make sure your laptop and your phone are on the same Wi-Fi network.
Open your React Native app on your device.
You'll see a red screen with an error. This is OK. The following
steps will fix that.
Open the in-app Developer menu.
Go to Dev Settings → Debug server host for device.
Type in your machine's IP address and the port of the local dev
server (e.g. 10.0.1.1:8081).
Go back to the Developer menu and select Reload JS

Running Bot emulator through docker containers

I have a working bot that interacts normally with the bot emulator.When I added docker support the emulator stopped interacting with the bot.
I read that I should un check the "bypass ngrok for local addresses" in the emulator settings and configure ngrok.
I have trouble understanding what I should do, I downloaded ngrok.exe and it opened a command line under the name "ngrok.exe".
The path for the running project is :"http://localhost:32768/api/messages".
How should I configure ngrok so the emulator will start interacting with the bot ?
Any other approaches would be good to..
I was able to get my docker container to work with my emulator finally, so I'll show you what I had to change to get it to work!
Using: Emulator 4.2.1, ngrok, and a sample echo bot:
Place the ngrok.exe file where you can find it. Mine's in a folder on my desktop. Then open the emulator. In the bottom left, there is a cog wheel for the emulator settings:
That page will open ... emulator settings. In this page, use the browse button to navigate to and select your ngrok.exe file:
I found that it did not matter for me whether or not I checked the 'Bypass' box.
Note (here's what saved me): localhost is mapped to my ipv4
I ran ipconfig /all in my command prompt to get my IPv4, and then went back to the emulator. In the configuration for my bot, where I was supposed to put in my end point (typically https://localhost:3978/api/messages), I replaced the word 'localhost' with my IPv4:
After I did that, I was able to talk to my bot:

GWT dev mode ipad

Hi, I'd like to run my gwt project in dev mode and open it on my i pad. How can I do this? I tried to replace the local-host part with my pcs ip address and open the website, but it doesn't work.
If you are using eclipse, the Jetty server binds on the localhost interface only, meaning that it will not serve request when the address is not localhost even if the specified IP is on the same machine. To allow connection from other computers (or iPads) you need to modify this addres in the launch configuration.
Open your launch configuration:
Run --> Run Configurations... --> Web Application --> [YourApplication]
Open the Arguments tab and in the first text box (Program arguments) add the following argument:
-bindAddress [your ip address]
ex: -bindAddress 192.168.1.200
see this post
There is NO WAY to use the dev mode for iOs, because there is no dev-mode plugin for iOS.
You can enable the Super Dev Mode. This will enable a really fast compiler.
update
As mentioned: -bindAddress 0.0.0.0 may be helpful to bind the jetty to any IP.
Your ipad and the system must be connected via Network (LAN).

Could not open port for debugger. Another process may be using the port

When I debug my app i get this error from MonoDevelop
Could not open port for debugger. Another process may be using the port.
Any idea what is causing it and how to fix it? Thanks.
I've reinstalled everything and its still not working.
Doesn't look like anything is running on that port. I'm using monoDevleop 2.8.5 and iOS simulator 5.0
The exact answer can vary depending on which version of MonoDevelop you're using and if you're trying to debug with the simulator or with a real iOS device.
First make sure nothing else is using the port 10000 on your Mac computer. Try the following command:
lsof -i | grep LISTEN
That will tell you if anything else is using the port. If this is the case then exit the application using the port.
You can also use the USB port to debug (devices only). Go to the MonoDevelop preferences to enable this.
If this does not help then please edit your question and add the details (MonoDevelop version, device/simulator) and we'll try to guide you thru this.
I was having the same problem earlier today, and a simple OSX reboot made everything work again.
I tried what #poupou mentioned, but lsof didn't show any applications listening on port 10000.
I just tried using MonoDevelop 2.8.5 with the MonoTouch 5.0.4 trial, and it works as expected on my machine.
You can try changing the port, by editing the file ~/Library/Preferences/MonoDevelop-2.8/MonoDevelopProperties.xml and changing the number in this line:
<Property key="MonoTouch.Debugger.Port" value="10000" />
to something else (like 12345 for instance). The log file (~/Library/Logs/MonoDevelop-2.8/MonoDevelop.log might also provide some clues if changing the port doesn't work.
An update to Monotouch came out and fixed the problem.

Resources