Cannot debug - variables values not displayed - ios

So, I'm currently working on pretty large project, which also consists of iOS application. Problem is, that few days ago, Xcode debugger stopped displaying variable values. I've tried to reset build settings, checked code optimization, enabled/disabled bitcode, tried older git commits, sadly with no luck. Also I've reinstalled Xcode, tried it on different systems, also installed El Capitan, to make sure, it's not some compatibility issue regarding Xcode 7 and Yosemite.
As you can see on the screen, when i try to print variable description, it displays error "Unable to determine byte size."
Could this be a bug? Application so far targets only iOS 9, so I wasn't able to test it on any non beta software.

Well, I've came up with at least semi functional solution, it is now working only on physical device, on simulator I'm still not able to debug.
What I did is, that I've set optimization level both on release and debug to "Fastest/smallest [-Os]" which doesn't make any sense, but it is working, so it's fine with me.

Related

Xcode 11.1 Running and Testing On a Device iOS 13.1.2, Setting Breakpoints

I have a 7+ year old project file that started with Xcode 4, which has been
ported to Xcode 5, 7, 8, and 9.2. For all those versions of Xcode there was
a consistent method and behavior of the Run (Play) button and setting and
stopping at breakpoints.
This is an Enterprise app and I've always had the luxury of actual iPhones
and iPads to do testing (never needed to use the simulator). We recently had
to jump from Xcode 9.2 to Xcode 11.1 to support newly bought devices running
iOS 13. I've always used objective-c.
My problem is with Xcode 11.1. The Run button behaves differently, and
breakpoints are not causing the program to halt. As far as breakpoints
halting, nothing was changed in project settings relating to the
numerous accounts I've researched in Stackoverflow for breakpoints to
be ignored. And it's always worked for me before. As far as the Run button,
I'm seeing unreasonable behavior. Maybe the two issues are related which
is why I'm pairing them together.
In previous versions of Xcode, one pressed the Run button which
resulted in the following:
1. The code was compiled and built when an editing change
had been made.
2. The newly built app was installed on the device whether
or not there was a previous version of the app already
residing there.
3. The app was then executed and breakpoints were halted
upon.
In Xcode 11.1, the Run button shows a list of apps is provided to
execute. If my app does not already exist on the device, it does
not show up on the list. And none of the steps outlined above are
performed.
This is how I have to now build and run the app on a device using
Xcode 11.1 and iOS 13.1.2
To build the app I go into Product->Build For->Running. That
builds the app which is now just sitting there. To actually get
it installed on the device I have to go back to the Run button
and choose one of the available apps which in my case I choose
"Books". Before Books is started, I can see text in the status
window indicating my app is being installed on the device. Books
is then started and I press the Stop button to kill it. Then I
press the Run button again and see my app on the list. I can
then choose to run it and I see output to the debug window.
However, after my app starts running none of the breakpoints
I've set are halted upon.
Would appreciate any help you can muster. Is there a method to
compile and build and run an app similar to the old method? And
is there a reason you can think why breakpoints are not being
serviced?
Thank you.
Mike
Over the many years I've used Xcode, I never had to change the Scheme of execution. So I never even understood it's purpose. For some reason, when I downloaded the newest version of Xcode (11.1), it changed the default values for Scheme causing the Run button to launch in a different manner which I described in the post. Perhaps it's due to an extension I'm not aware of in my code dependancies as Paulw11 mentioned. But anyway, here is the way to insure your app will be launched directly and in the debugger:
Product->Scheme->Edit Scheme-> Build Configuration = Debug, Executable is set to "Your App", Debug Execution is set to checked, Launch Automatically is set to checked.
Beware Xcode may change these values when you download a new version.

No developer settings in iOS 9?

Yesterday I was studying iOS development. I had just updated my Xcode and was finally able to deploy my apps to my iPhone. However, all of a sudden, my iPhone got a weird bug where it wasn't working at all. I restarted it, only to find that the developer section in settings was gone. I thought it might be some bugs from the beta version I was using, and decided to finally do the update (I had my memory all used up, so I didn't do it sooner in order to not delete anything). I thought that would fix my issue, and at least give my iPhone developer rights again. But it didn't. I've been searching for ways to do it since last night and I am unable to find anything recent, as they are all for older versions of iOS or Xcode. I tried them, but either they just don't work, or the path they use is now not existent.
Any ideas what that could be and how I could fix it?

WatchKit Simulator periodically gets stuck on load Spinner

I'm experiencing a similar issue as was posted previously in:
WatchKit Simulator Won't Load App
My WatchApp seems to be loading okay (I'm watching step by step w/ NSLog), but the spinner (sometimes) never stops and the Watch interface (sometimes) never appears in the Simulator, i.e.:
I've tried some of the workarounds posted at the above URL (and I apologize for not being able to directly add my comments there) and they seem to work some of the time.
But I'm looking for confirmation that this is a bug in the XCode 6.4 Simulator code or perhaps an incompatibility with my older hardware? (I'm running latest version Yosemite & XCode but on an older mid 2009 Macbook Pro).
It just seems un-Apple like for a development environment to be this buggy. I keep thinking it's gotta be my code and not Apple's XCode Simulator?
Anyone else still encountering these kind of "spinner and not displaying Watch screen" in the Simulator?
Thank you for any input, the previously suggested workarounds seem to help some of the time but having to go thru that many steps with each compile & run cycle is making rapid iterative Watch development in the Simulator extremely frustrating.

XCode 6.0.1 Behavior: Huge Delays?

I've been using XCode 6.0.1 for a while now on a large-ish Swift project for iOS, and was wondering whether anyone else is experiencing these symptoms:
Sometimes it gets to the point that the spinner comes up on EVERY keystroke, and I have to wait 10 second before the next character appears in the editor.
Auto-complete takes up to a minute to auto-complete.
"Jump to Definition" takes up to 30 seconds to complete. Sometimes I've forgotten I asked for it, searched by text to find what I wanted, gone back to where I started from and then "Jump to Definition" kicks in.
I'm part of a development group of 3, and all three of us are experiencing the same behavior.
Yeah, I had this problem - this is a duplicate of this:
XCode 6 GM: Constantly freezing / locking while editing Swift code
I filed bug #18316444 and their response was:
Engineering has provided the following information:
We believe this issue has been addressed in the latest Xcode 6.1 beta.
This pre-release version of the Xcode 6.1 developer tools is required
when developing for OS X Yosemite, and includes the Swift programming
language. Xcode 6.1 beta runs on OS X Mavericks and OS X Yosemite
Developer Preview.
Please test with this release, and update your bug report with the
results.
Xcode 6.1 beta - Build 6A1042b
https://developer.apple.com/xcode/downloads/
Please let us know if that resolves the issue for you by updating your
bug report.
I don't know if this will help or frustrate you, but the problem eventually went away for me. What I did end up doing though was having an open terminal ready will killall primed for SourceKit. I wish I knew what changed, it just did. One thing to check though, on early versions of XCode 6, I kept running out of pty terminals - it would leak, run out, and then SourceKit would "jam up". I had to up it to 512, I think (whatever the default was, I ended up doubling twice). I can't remember if that also worked around this issue, or if it was unaffected.
If you remain afflicted, you might consider editing with 6.1 and doing final builds on 6.0.x.

Xcode 5 running with iOS7 look and feel with Base SDK 6.1

So, I've been updating this app that has a BaseSDK of 6.1.
So far it has been fine, until this afternoon. I ran it once on my iPhone 5 and it was fine (but crashed). It was running with the iOS6 look and feel like I wanted.
Fixed the bug (just a simple index out of bounds bug) and ran it again and now it runs with the iOS7 look and feel.
I've checked the deployment target and the Base SDK and I have no idea why it's doing this.
Can anyone point me in the right direction?
SOLVED
OK, so I managed to fix it.
I had to...
Quit Xcode.
Delete Derived Data.
Delete the app from my phone.
Restart my Mac and Xcode.
Rerun "pod update" for my cocoapods. (I tried this before with no luck).
Then start it all up again.
Now it's fine.
I haven't changed any code and all the Base SDKs and deployment targets are the same.
Oh well...???
Xcode 5 does not support SDK 6.1.
You can trick it to use it, but the behaviour is undefined.
If you have multiple SDKs installed, then Xcode 5 has a bug (or undefined behaviour, whatever) where it shows the connected devices twice (or N times for N SDKs installed) in the drop down where you select simulator/device.
Each of these icons will access the connected device using one of the SDKs you have installed, so even though they look the same, they'll have some odd side effects.
I always use the top one.. (better ideas welcome)

Resources