Xcode 4.3 and debugging on iOS 3.x devices
Asked Answered
O

4

10

I just updated Xcode to version 4.3 via the Mac App Store last week, and discovered that I can no longer debug on iOS 3.x devices. I have the iPhone 3G running iOS 3.1.3 and a 1st Gen iPad running iOS 3.2.

On both devices it appears that Xcode 4.3 installs the app and attempts to launch the app. The app displays the splash screen but never completes booting. There are no error messages or messages of any kind in the debugger output window. My only clue is when I press the pause button I can see that the device/Xcode is stuck in the following function: addimagesToAllImages which appears to be related to Apple's DYLD.

Debugging works fine on iOS 5 devices and worked on the previous Xcode 4.2 installation. I've rebooted my Mac, iOS 3.x devices with no change in behavior including clearing out all cache(s).

Anyone have any ideas as to what's going on? Thanks for the help.

Originative answered 19/2, 2012 at 22:6 Comment(5)
it looks like XCode 4.3 force the Compiler to LLVM 3.1 and the debugger to lldb that is not supported on iOS 3. Have you checked that the project is still compiling with LLVM GCC?Quiberon
Thanks Junior B. I changed the Build Option "Compiler for C/C++/Objective-C" to "LLVM GCC 4.2" and still see the same problem. Is there another setting I need to change to get xcode using GCC and/or the GDB debugger?Originative
Ok, I figured it out with Junior B's hint about the debugger. I went to "Manage Schemes" and selected the Scheme I'm working on and clicked "Edit". Under the "Run" section I changed the Debugger from LLDB to GDB. Now debugging on iOS 3.x and 5.x devices work fine. Also, I left the compiler to xcode 4.3's preferred setting of LLVM 3.1.Originative
Usefull info about 3.x support can be found here: https://mcmap.net/q/898782/-ios-3-x-support-in-xcode-4/751932Dev
Usefull info about 3.x support can be found here: https://mcmap.net/q/898782/-ios-3-x-support-in-xcode-4/751932Dev
O
13

Ok, I figured it out with Junior B's hint about the debugger. I went to "Manage Schemes" and selected the Scheme I'm working on and clicked "Edit". Under the "Run" section I changed the Debugger from LLVM to GDB. Now debugging on iOS 3.x and 5.x devices work fine. Also, I left the compiler to xcode's preferred setting of LLVM 3.1.

Hopefully this helps someone else that accepts xcode's upgrade adviser recommended settings and their iOS 3.x debugging breaks.

Originative answered 20/2, 2012 at 17:7 Comment(1)
Unbelievable - I wasted a day on this trawling through my code to find out where I'd done something wrong. I'm getting tired of having to keep track of all these little gotchas - computers are supposed to do this for you! Surely apple could have put in a check and popped up an alert if compiling to an ios3 device advising that gdb was necessary. Thanks Wesley for the solution.Transaction
L
1

Have you installed the “iOS 3.0 - 3.2.2 Device Debugging Support” component?

From the menu bar, choose Xcode > Preferences…, then in the Preferences window choose Downloads > Components. Find the line for iOS 3.0 support and click the Install button.

Loving answered 19/2, 2012 at 22:13 Comment(1)
Hi Rob, thanks for the response. Yes, iOS 3.0 - 3.2.2 Device Debugging Support is installed. Just for kicks I installed the 4.0 Device Debugging Support as well with no change in behavior.Originative
T
0

Only switching from LLDB to GDB wasn't enough for me when encountering the same problem. As I had an older working commit in git, I figured out which changes in the Xcode project setting let in my case to the error. Thus I could resolve the issue by removing all occurrences of the following line from my $PROJECT.xcodeproj/project.pbxproj

GCC_THUMB_SUPPORT = NO;

Also, I reverted the value from

LastUpgradeCheck = 0430;

back to

LastUpgradeCheck = 0420;

As I have my schemes configured to be 'Shared', these settings are also stored in the project directory (subdir. 'xcshareddata' in the project .xcodeproj directory), and thus changes also visible in git. Another change I reverted were removing these two lines in '$PROJECT.xcodeproj/xcshareddata/xcschemes/$PROJECT.xcscheme':

LastUpgradeVersion = "0430"
ignoresPersistentStateOnLaunch = "NO"

Another change in the .xcsheme file were that the values of 'selectedDebuggerIdentifier' and 'selectedLauncherIdentifier' ended with '.GDB' instead of '.LLDB', but this is actually the same as you will get by following the accepted answer from Wesley.

Those changes solved for me the problem, and I could debug again on my iPhone Classic running on iOS 3.1.3.

However, I strongly recommend the use of a versioning system like Git (or at least a local backup!) before applying these edits with your favorite text editor.

Tipcat answered 4/6, 2012 at 16:52 Comment(0)
L
-2

Hai MyDear Friends,

   I am having one simple solution as follows:

"Xcode --> Preferences --> Debugger --> check Auto clear Debug console" results clears the console every time You run the Application

Leffler answered 22/3, 2012 at 10:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.