I've written a Bash script to open React Native Debugger (desktop app) before running my iOS emulator itself. By default my iOS emulator has "Remote JS Debugging" on, and when the emulator starts up, it opens the remote JS debugger in Chrome. So I end up with React Native Debugger and the Chrome remote JS debugger both open, and these conflict with each other and sometimes cause the app to crash.
My question is: is there a way to prevent the iOS emulator from automatically opening the remote JS debugger in Chrome?
Thanks!
You could try setting the REACT_DEBUGGER env variable to some failing path, so it will fail behind the scenes when trying to open it.
Related
I was developing in react native for windows. To debug my code I used to open http://localhost:8081/debugger-ui/ in my Chrome and press SHIFT+F10 in the app to open the Developer Tools and than Start Debugging.
However, SHIFT+F10 is not opening the dev tools anymore.
I'm running in Debug mode.
Does anyone knows how to re enable the keyboard shortcut or fire remote debug in another way?
I have tried to simulate the command using on screen keyboard, it does not work, although, ctrl+r works. So it is not a problem with keyboard.
-> It is a React Native app for WINDOWS
I run app using VISUAL STUDIO 2017 ENTERPRISE
Do you use Emulator (IOS/Android) or Hardware-Device to Debug?
If you mean the Context-Menu in Emulator, here are the Shortcuts:
Android: CTRL+m
IOS: Windows-Key + D
If you have Hardware-Device you only need to shake the device.
You appear to have got an answer back from Microsoft already, so just sharing it for anyone here:
https://github.com/Microsoft/react-native-windows/issues/2052
Essentially, there appears to have been a regression, and there is a patch to a React source file that fixes it.
So my react web application loads perfectly fine on Android Chrome Browser, and other browsers such as UC Browser, Safari on iOS.
However, recently we found that the web application loads blank page when opened using Android Native/Stock/Default Browser ( The blue globe icon ) found on any Samsung / Lenovo devices.
I was able to use weinre / ngrok to attach web debugger, but I was not able to find any errors. The browser would just stop requesting for more static assets and stop doing anything.
I ran another test for my internal web application which is also a react web app (same config), and it loads fine on Android Native/Stock/Default Browser. I'm looking for clue as to what may cause this browser to stop requesting from the webserver...
Thx
With iOS, Action App Extension, one could run a JavaScript code against HTML. However, after quite some search on Google, I have not found any document explaining how to debug in this situation (insert a break point or simply add/view console out statement).
It's not too hard, although recently I've had an issue with the page showing up when connected to the simulator. In that case I just ended up using my phone directly. (Apparently you need to start desktop Safari after the iOS Simulator has started to inspect "remote" Simulator sessions)
Ensure that on the device Settings->Safari->Advanced->Web Inspector is on
(Make sure you've Trusted the computer from the device)
Start MobileSafari on your device by running from Xcode and choosing Safari
-- this isn't necessary but you can decode the iOS Objective-C/Swift code as well. You can just start MobileSafari manually and it will be visible in desktop Safari.
Start Safari on your desktop, make sure Show Develop menu in menu bar is on in Preferences.
In the Develop menu you will see your device name, say 'BSharer's iPhone'
select the page name underneath your device name, say 'en.m.wikipedia.org - Wikipedia'.
You are now debugging that device page on your desktop.
There are options to 'Automatically start debugger etc...', but I've found that when I tried these my code would not execute.
You can't place debugger statements in the app extension JavaScript as it isn't injected until your App Extension starts. Instead I would add a debugger; statement to my app extension JavaScript code which will pause the debugger in the app extension JavaScript code at the debugger; statement.
Start your app extension by selecting it in the Share menu, set any other breakpoints you are interested in, then hit the continue button on the debugger.
You will also catch uncaught exceptions of course.
The official documentation for this is here.
Make sure you remove the debugger; line from production code.
I am building an iOS app in which I have a webView i.e. UIWebView not WkWebView and I have some JavaScript code that uses AngularJS for UI manipulation.
I run my app in the iOS simulator from Xcode and then open Safari and go to Develop -> iOS Simulator -> AppName -> index.html, which attaches the safari web inspector to the web view. In the inspector under the resources tab I select the relevant JavaScript file and put a breakpoint for the JavaScript code that I want to start from.
What happens now is when I navigate to the part of my app when the JavaScript code is executed, it pauses in the web inspector just fine. The problem is, I cannot navigate through the code: it just freezes. I cannot unpause it.
What I do notice in my Xcode console is this error
Multiple locks on web thread not allowed! Please file a bug. Crashing now...
This doesn't happen all the time, just 60-70% of the time when I am working on my app. So this is my first iOS app and I am building it using Swift.
This seems like I have a missing link somewhere. But any tips or anything would be great.
I want to invoke a ios application from browser. If the app is installed, it should redirect to the app. Otherwise, it should continue in the browser it self, with out showing an error pop up message.
I tried setTimeOut() in javascript, it not working.
Help me please...
check here How to register a custom app opening URL scheme with Xcode 4?
register a URI to your app, then you can open it via javascript in mobile safari