Weinre server no target for debugging webview - webview

I'm trying to debug a webview on my phone using the weinre server. It shows up as a client but not as a target. I know that 4.4 and above have chrome debugging but I need to debug in 4.3
I've tried changing the localhost to the my ip address but it doesn't work. Any ideas as to why the target is not showing up?
I've attached a screenshot for reference.

Your server (running on your windows computer?) needs to be visible to your (android?) phone. Can you browse to the weinre server on your windows computer from your android phone - just to test that you have connectivity there?
You could also try using a public weinre server, such as: http://weinre.mybluemix.net/
Also possible there is an error in your HTML or other JS somewhere that is preventing the weinre script from running. You could try running on a 4.4 device and use a real debugger to see if you can figure out why it won't work on your 4.3 device.

Related

Getting IOS console from Capacitor

Does anyone know how to view console.log() from the Xcode simulator using capacitor? I am aware that you can view the system logs via iOS Simulator > Menu Bar > Debug > Open System Log (How can I get the console logs from the iOS Simulator?), but this does not show any of the console.logs when using capacitor to run an ios application.
I couldn't get the Ionic instructions to give any output via Safari's dev tools.
However, Capacitor's solution is its built-in Console API https://capacitorjs.com/docs/v2/apis/console
The Console API automatically sends console.debug, console.error,
console.info, console.log, console.trace and console.warn calls to the
native log system on each respective platform. This enables, for
example, console.log calls to be rendered in the Xcode and Android
Studio log windows.
I was able to see the logs in Xcode's logging as long as the build isnt broken in some way.

Ionic 2 app safari remote debugger disconnects immediately

I am trying to debug an application written in Ionic 2 (Angular 2) on device via Safari remote dev tools. When the app is open and I connect the iphone to the Mac it shows up under Safari > Develop menu, but as soon as I connect to it (and the dev tools do show up) it disappears from the Safari > Develop menu and in the just opened dev tools I am unable to execute anything in the console nor expand any node in the Elements panel.
When I unplug and replug the device it shows up in Safari > Develop again but the devtools window is gone, and as soon as I open it up again... Same thing.
Any help?
You wouldn't believe what solved the issue....
Running Safari.app through terminal by executing /Applications/Safari.app/Contents/MacOS/Safari it opened up Safari as usual, but for some strange reason it didn't disconnect my device when connecting to it via remote dev tools.
I finally managed to get it working in two steps :
First I used to get some debugging console working using ios-webkit-debug-proxy on a linux machine (https://github.com/google/ios-webkit-debug-proxy) (You need to compile from sources including tools from libimobiledevice to get it working with iOS >= 10)
Then it helped me to notice I had many errors like Refused to load the script 'http://xxxxx' because it violates the following Content Security Policy directive: "connect-src ... that where not occurring while remote debugging with android and chrome. Fixed them by adding the appropriates rules in the <meta http-equiv="Content-Security-Policy" content="..." line in index.html . Don't know exactly which one fixed it but is suspect connect-src wss://s-usc1c-nss-128.firebaseio.com http://my_local_ip:4200 https://maps.googleapis.com ws://*; did the trick

rabbitmq-c on iOS devices doesn't work

I'm currently trying to use the rabbitmq-c library https://github.com/alanxz/rabbitmq-c on iOS. When I run my sample app on the iOS simulator, I'm able to open a socket using the amqp_socket_open . I basically get a AMQP_STATUS_OK return status from the call. However, when I run the same call on an iOS device, I get the AMQP_STATUS_SOCKET_ERROR error. I was wondering if anybody managed to open a socket through the rabbitmq-c library when run on an iOS device.
Thanks
JB
Alright. So I figured out what was wrong. The issue was that I was using "localhost" as the URI. Hence it was working on the simulator and not on device since the simulator was run on the same machine as the broker. Used a public URI instead and everything works. So rabbbitmq-c is supported on both OSX and iOS platform

Direct Update with custom URL not working on iOS 7.1.2

Since my upgrade to WL 6.2 direct update isn't working anymore on iOS.
What I'm trying to achieve is to get direct update working with the iPad and my windows machine. This way I can develop on my windows machine and use direct update to push my changes to the iPad (iOS 7.1.2). Following scenario describes my problem.
Create a new WL project in worklight studio on Mac (just installed the latest WL plugin today (platformVersion=6.2.0.00.20140724-2139). Add iOS as environment and replace the main.js with the following code:
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
}
function onConnectSuccess() {
WL.Logger.debug("Connect success.");
}
function onConnectFailure() {
WL.Logger.debug("Connect failed.");
}
Run the project as an Xcode project and use Xcode to deploy the application to an iPad. Now follow the following steps to reproduce the issue:
Make a modification in the index.html
Redeploy the app on your local worklight server in eclipse
Kill your app and restart it again
The direct update is working and your changes are reflected in your app. Yeah!
Now as a very basic next step, try to use the direct update with a Custom Server URL. Thick the Use custom URL checkbox in your iPad settings and change the Custom server URL to the URL of your local server.
When I now retry step 1 to 3, the direct update fails. On startup the app informs me an update is available, and when I click update the downloading progress bar appears but stays at 0% forever. In the custom server URL I only changed the IP to the IP of my macbook and removed the dash after the project name. I also tried changing the URL to the URL of my windows development machine (also with the latest WL eclipse plugin), but this results in the same behaviour.
One last remark; I would expect that when I disable the Use custom URL checkbox; direct update would work again. But this is not the case.
I've tried this and I cannot confirm it not working.
Added your code snippet to main.js
Enabled worklightSettings in application-descriptor.xml
Run on Worklight Development Server
Open project in Xcode
Run
Make a change and re-deploy
Verify Direct Update is received
Quit app
Make a change and re-deploy
Open myapp settings via Settings.app and enable Custom Server URL. The URL is already pointing to my (same) server
Open app
Verify Direct Update is received
You mentioned in the comments that once enabling the Custom Server URL option you also need to change the server address to another - I suggest to double-check you are indeed inputting the correct address. Maybe you have several network cards or alike.
Reinstalling eclipse resolved the problem. After reinstalling eclipse I also get the correct IP for the custom server URL in the server connectivity settings.

Why does XCode (4.5.1, Lion) require an internet connection to connect to iOS simulator?

I am developing an ios app that doesn't need an internet connection. I'm using phonegap and jquery-mobile. I'd like to develop offline, but XCode gets stuck with a status saying 'Attaching to iosproj' (iosproj is my project name). After that I cannot stop the stuck task, and have to force-quit XCode. With an internet connection however, everything works just fine. Grateful for any clues.
Edit: XCode seems to install the app fine without a network, but it gets stuck before/durimg receiving the deviceready event.
Update 1: The app runs fine on the simulator with or without the n/w. It is purely the XCode-iOS simulator interaction.
Update 2: When using phonegap (Apache cordova), there's an easy work-around to work offline. Once the project has been built and installed (with a n/w), all subsequent updates to html/js/css/img can be made directly to the www directory in the simulator's Library (under your app folder, in ~/Library/Application Support/iPhone Simulator/6.0/Applications).
The Simulator itself attempts to make an Internet connection to Apple as it launches. In particular, the itunesstored process attempts to connect to ax.init.itunes.apple.com and phobos.apple.com.
[That information comes from LittleSnitch. You would be well advised to install LittleSnitch so that you can be sure of exactly what connection is being attempted here. No one - certainly no developer - should be without it.]
If you find this troublesome (that is, if the connection failure is causing you to be unable to run your app in the Simulator at all) you should file a bug report with Apple. However, I've had no difficulty with this, so perhaps this an Xcode bug. I'd suggest first updating to Xcode 4.5.2 in case it is fixed there.

Resources