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
Related
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.
I am trying to run a Xamarin.Forms app on my iPad and getting the following error:
Launch failed. The app 'AppIOS' could not be launched on 'My iPad'. Error: error MT1006: Could not install the application '/Users/mycompany/Library/Caches/Xamarin/mtbs/builds/AppIOS/someguid/bin/iPhone/Debug/my.app' on the device 'My iPad': EOF Error (error: 0xe800000e).. Please check the logs for more details.
This app has previously ran fine on the same device. The iOS build and deployment process seems very unstable so it often takes multiple attempts so I'm used to having to restart Visual Studio, the Mac it builds on and the iPad and generally wasting a whole lot of time. I have restarted everything involved here multiple times but this error persists. I have checked the device logs and there are no related messages or even any messages at the appropriate times.
I'm using Visual Studio 2017 (15.9.4), Xamarin.iOS and Xamarin.Mac SDK (12.2.1.12), building on a Mac Mini running macOS Mojave and XCode 10.1, deploying to an iPad Air (A1474) running iOS 12.1.1. As far as I'm aware there have been no updates to any of these since I last had it working. The UWP version of the app runs fine.
I can find a lot of MT1006 issues but none with EOF Error (error: 0xe800000e) and I can find no information about this specific error at all. Can anyone enlighten me on what this means?
Sounds overly simple, but I just had this issue and I solved it by restarting the iOS device and redeploying it. Specifically, I was deploying to an iPod 6th Gen and I held the power and home buttons until the screen turned black, this is more of a hard restart. Then let the device reboot and try deploying again.
NOTE: Don't hold the power and home buttons too long, because if you do, the iPod will go into a factory reset restart.
Try pulling up the device in Xcodes' devices tab. I did and realized the device had an error within the tab. I then disabled the "Connect via network" button, then things started to work properly.
I am agree, Xamarin build environment on iOS part is very buggy.
In any case of unknown error in such config: VS<->MAC<->iOS Device try these steps:
Try to switch Off and On Mac wifi.
Reconnect VS to Macbook and Macbook to IPhone.
Delete bin and obj folders on Macbook
Check your PList and Entitlements file(as example wrong aps-environment setting can cause installing errors)
Check your sign project settings
5a. Check your provisoning profile term
unistall application from ios
rebuild and run project again
I'll appent new lines in case i'll remember something else.
What you described happened to me and solved by 1,2,7
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.
I've never used, let alone debugged, an iPhone until today - please be gentle.
I'm trying to install onto an iOS 8 iPhone a VPN configuration .mobileconfig file of my own creation, and it is failing. I was fully expecting not to get it right first time - now I need to debug it.
How can I get logs of the failure please?
I have not been able to find a working app in the App Store. "LogPolice", for example, just shows an empty log.
XCode on a Mac refuses to connect to the process. I select Debug -> Attach to Process -> Settings (xx) and it tells me
Lost connection to "iPhone".
Restore the connection to "iPhone" and run
"Settings" again, of if "Settings" is still running, you
can attach to it by selecting Debug > Attach to
Process > Settings
Retrying, restarting XCode, restarting the mac, restarting the phone have no effect.
I have at my disposal a Mac, a Windows PC (for which I do not have admin rights) and a Ubuntu VM (for which I have admin rights). Happy to use any of them.
You can't debug the settings app as it's not an app you'll have the debug symbols for.
You can view the devices console which should shed some more light on the issue. See this reddit comment to locate it in Xcode: https://www.reddit.com/r/iOSProgramming/comments/294kj4/where_did_the_console_from_devices_go_in_xcode_6/cihel8l
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.