I'm new with iOS development. What I'm working out is how to get information about my app when I run it in iPhone.
For example: When I develop in Android, I connect my phone (with depuration mode) and open Android Monitor. So I can see if something went wrong an the monitor show me:
lines 425 nullPointerException ....
What's the problem? I built my hybrid app with HTML and Ionic in a Windows PC so I'm using Ionic View to show my app in my friend's iPhone.
Then I downloaded xCode in my friend's Mac and I'm trying to know whats wrong with my app because it show me a white screen.
So... May be, I can reach my app error if I could do something like a I described with my Android Monitor and find the error.
Thanks for helping!
There are several places to see errors and log output depending on what you are doing. If you are running your app via Xcode, then you can see the console output in the debug view - use the following button on the toolbar to open the debug view:
The debug view will appear at the bottom of the Xcode window and it can have two panes - a variable view, and the console output. The console output area will show ouptut from your app as it runs in Xcode. You can open/close the two panes by using the two buttons you will see the bottom right when the debug view is showing.
If you are not running your app via Xcode, then you can connect your device to your Mac via USB cable, and then in Xcode select Window - Devices from the Xcode menu. The new window you get will allow you to connect to your device and see the crash logs on the device. If your app is crashing, this should allow you to see the crash logs from your app.
Alternatively, you can see the console output (similar to Monitor on iOS) by running the Console app on your Mac while your iOS device is connected to the Mac. On the Console app sidebar, you should see your iOS device. If you select the device, you can see the console on the device, like this:
The above might show you what is happening in your app as it runs.
Hopefully, this helps :)
Related
I am writing an app that I need to see the xcode console output i.e. the following
2019-12-27 13:14:37.188270-1000 HelloDroneIOS13[2076:1783918] [arsdkengine] Create ArsdkEngine
2019-12-27 13:14:37.189316-1000 HelloDroneIOS13[2076:1783918] [gsdk.core] Loading engine ArsdkEngine
2019-12-27 13:14:37.189450-1000 HelloDroneIOS13[2076:1783918] [gsdk.core] Starting engines
2019-12-27 13:14:37.206437-1000 HelloDroneIOS13[2076:1783918] [gsdk.core.utility.internet] Started listening for Internet connectivity changes.
I have an accessory I need to attach so I can't have it connected to my laptop when running and it is crashing so I need to figure out the reason. I tried connecting it to my laptop after it crashed then from xcode Window->Devices and Simulators -> Open Console. See image:
This seems to only show the latest console outputs. Where can I access the saved outputs when it crashed? instead of the latest.
I have an accessory I need to attach so I can't have it connected to my laptop when running
Yes you can. Configure your device for wireless connection to Xcode. Now you can attach the accessory device and receive Console output at the same time. That is exactly why wireless Xcode debugging was invented.
(Check "Connect via network", visible in your screen shot.)
I just encountered a very weird behaviour with Firebase dynamic links.
It works perfectly on all of our test devices except for one.
This specific device is an iPhone-x, and the account was restored via iTunes (Not sure if this info is relevant, but i'm trying to give a full picture).
Our app is installed on this device from the app store (also tried deleting and reinstalling), but when trying to open a dynamic link it opens Safari instead, there we have the "open" button that opens the app store page of this app.
When trying to long tap on the link as suggested by developers that experienced the same issue, we have only one button that says "Open" which opens Safari again. I would expect that when the app is installed we would have two options:
1. "Open in Safari"
2. "Open in [App]"
Has anyone experienced this issue before? Anyone has any idea how to solve this?
The overall diagnoses here is that Universal Linking is not configured properly on the device. If Universal Links works on all other devices, then it is probably the case that the AASA file is not being downloaded properly. iOS 11.2 has had issues with this recently.
Check device logs
I suggest that you check the device logs when installing the application to see if the AASA file is being downloaded properly.
1) Delete your app and plug in the device to your computer
2) Open up Xcode and navigate to Window > Devices & Simulators
3) Select the device in the left-hand menu
4) In the bottom of the window you should see a triangle in a box. Clicking this will bring up the device logs.
5) Use a cmd-f to search for applinks and if your app downloaded the AASA correctly. You should see something like
Added service 'applinks', appID 'RXXXXXXXP.io.branch.Branchsters', domain 'branchster.app.link'
If this is not the case, then it looks like you AASA file is not being downloaded and you may need to delete the app, restart your phone, and try again.
I've been struggling to debug my standalone webapp with safari's web inspector. The web inspector works fine when I go to the url on the iphone's safari like a normal web page. The problem appears when I add the webapp to the homescreen. I'm having a strange bug that causes my app to crash when I start it from the homescreen and I want to see what's happening, but when I try to open the web inspector on the mac it opens for a second and then it closes unexpectedly with no message at all (also the webapp on the iphone closes). Thanks in advance. More info about the devices and versions:
- iPhone 5SE with ios 10.3.2 (14F89)
- Macbook Air with MacOS Sierra 10.12.5
Well it seems that Safari is having a bug regarding the cache when I add the webapp to the homescreen using the same app name I was previously using. I tried deleting the old one on the homescreen and add it again but with a different app name (short name) and it worked (it loaded the latest version of the webapp) and the bug I was trying to get rid of in the first place was finally gone. I'm concerned however about asking the user to add the app again to the homescreen with a different app name to get the latest version. Maybe that's a sign that I should move on to service workers :)
I just finished developing a Cordova / Phonegapp app. When I test it on iOS simulator it all works fine and quick, but, when testing on device it works only part of it.
My app is a game with the kingdom background and has 8 buttons (8 buildings).
When I click on each building it leads me to a screen representing what it's inside the building, but one of them doesn't work and gets my app frozen.
How can I see fail or crash reports that helps me debug my app on device?
If you provide full path to your file i.e. "file:///Users/.../someDir/some.html" it will work only on simulator running on the same machine where your project is.
I suggest just adding the additional path to the file you want to access i.e. if you are in "/someDir" you will need to provide only "some.html" or if you want to access parent directory just use "../".
As far as debugging Cordova app, I suggest downloading this plugin and using console.log instead of alert.
Hope this helped.
Ok, I found a "spartan" way to debug my app via alert and found that an url wasn't set properly (still don't know why it worked on simulator)
Please excuse my silliness. I feel as this should be a simple problem. I am using phonegap to develop in IOS. I am wondering how come console.debug does not show up in the xcode console. How can I view any javascript error or exception in xcode console or anywhere? I am running on 4.3 IOS IPAD simulator. Thanks.
You can watch the console.log with a safari-browser. Open the ios-simulator or connect the ipad by usb. Open safari and take a look in the menu "developer". Choose your web-site and the web-inspector will open.
more info here:
https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/DebuggingSafarioniPhoneContent/DebuggingSafarioniPhoneContent.html
As far as I know, you cannot. I have solved this problem by using jsconsole.com. It allows you to output console message (and much more) by simply adding a script tag to your app.
NOTE: for debug use only.
Just to clarify the old answer from Fischel, here is the menu on a desktop Safari that allows you to connect development tools to simulators or devices.