Jailbroken iPhone 3G with iOS 4.2.1 can't be debugged with XCode - iphone

I'm trying to debug my applications with XCode 3.2.5 and jailbroken iPhone 3G with iOS 4.2.1.
When I start debug with enabled breakpoints, application can't start (it stucks on 'Default.png' screen) and I get Data Formatters temporarily unavailable, will re-try after a 'continue'. (Can't find dlopen function, so it is not possible to load shared libraries.) message in GDB.
When I start debug without enabled breakpoints, application starts without problems.
I tried to do steps decribed there, but without any results.
When I used iOS 4.1 there was a problem with reboots.
On every connect of the iPhone Organiser displays this message:
**Unknown iOS detected** Xcode does not have debugging information for the version of iOS on the device named “iPhone”. Xcode can collect debugging data from the device to enable development with this version of iOS. This process only needs to be done once per iOS version, and will take several minutes.
Thanks for any help!

It's likely that your problem can be solved by reauthorizing your device:
If your iPhone is plugged into the computer, unplug it
In Xcode, display the Organizer (Window->Organizer)
In the Devices area click on your device and delete it.
Just in case, Quit Xcode and then re-launch it.
Open the Organizer again, then plug your iPhone into your computer.
Tell Xcode that yes, you'd like to authorize the device.
If everything works correctly, Xcode will now download device information for 4.2.1.
If this doesn't work then I suggest performing the steps again, but replace step 4 with removing all traces of Xcode from your computer and then reinstalling it. This includes the entire Developer folder.

The latest Xcode+SDK drop doesn't know about iOS 4.2.1, because it was published before the latest patch came out. Xcode's Organizer has a new feature that tries to download debug support files directly from the device, but apparently it has some (possibly jailbreak-related) issues for some people.
iOS 4.2.1 is similar enough to 4.2 that Xcode can be coerced to use 4.2 support files to debug on 4.2.1 devices. To do this, simply go to the /Developer/Platforms/iPhoneOS.platform/DeviceSupport folder and manually copy the Symbols subfolder and/or the DeveloperDiskImage.* files from 4.2 (8C134) to 4.2.1 (8C148) (or whatever release folder Organizer creates for your device).

Jailbroken 3GS / 4.2.1
I tried Matthew Frederick's recommendation without success. Anyone happened to find a solution to this problem?
EDIT
Please note that I used a jailbroken 3GS and a non-jailbroken 3GS.
Workaround, requires a non-jailbroken iPhone 3GS with 4.2.1 (8C148a):
Delete /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148a)
Connect the non-jailbroken iPhone 3GS with 4.2.1 (8C148a)
Open Xcode and Organizer
Configure the new iPhone for development by clicking the "Use for development" button in the Organizer.
Let it extract the debugging symbols from it recreating /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148a)
Unplug it, remove from Organizer
At this point you can debug your jailbroken iPhone again.
Cheers!

In order to get rid of (Re)Collecting Debug Symbols in Organizer (which in fact does nothing) each time the iPhone is presented to the XCode, a simple workaround is to copy:
DeveloperDiskImage.dmg and DeveloperDiskImage.dmg.signature
from the 4.2 (8C134) to the empty 4.2.1 (8C148) folder.
The XCode will recognize device and you'll be able to debug your code, but without debug symbols for the IOS framework.
But, the gdb console will be alive and you can use it do debug your code (with debug symbols).
Btw. you can always use Simulator for the full IOS support :-)

My completely non-Jailbroken iPhone does this with 4.2.1, and gets exactly the same messages and problems. It's new functionality in the latest version of XCode, so it may well be buggy.

Additional suggestion besides Fnord's suggestion is to make sure that multitasking, or the "Reenable Functionality" in PwnageTool is not enabled for iPhone 3G jailbroken device.
I'm not sure if this has an effect though. But, it's reasonable to do this if we really want to test it on a real world condition of iPhone 3G.

Related

Xcode doesn't see my iOS device but iTunes does

I have a strange problem.
I have an iPad with iOS 5.0.1 (9A405) and iOS SDK 5.0.1 with Xcode 4.2 (Build 4C199) installed on my Mac.
Xcode doesn't see my device. It says "iOS Device" not "Sauron's iPad" as usual.
(I am sure that device is connected because I see it in iTunes.)
Xcode denies to start my application on device.
It says:
"Xcode cannot run using selected device. No provisioned iOS devices
are available with a compatible iOS version. Connect an iOS device
with a recent enough version of iOS to run your application or choose
an iOS simulator as the destination."
Xcode sees my other iPad with iOS 4.3.3 and can run applications on this device.
I have tried to restart my Mac - without result.
I also checked provisioning profile, developer certificate, etc.
Does anybody have ideas?
Even though this one does not address the specific problem of the OP, it might be a solution for other people finding this question.
In some circumstances, Xcode will not recognise (won't even see) a connected device that was previously recognised, even though there were no changes in Mac OS/iOS/Xcode versions. This seems to happen if you connect the device while the Mac and/or the device are locked when you connect them. The device will ask if you want to trust the computer even though you already did so, but the device will still not be visible in Xcode.
Restarting Xcode or the device do not seem to have any effect. One solution is to reboot the Mac. Another much quicker solution is to restart usbmuxd:
Quit Xcode
Disconnect the device
In a terminal window, type: sudo pkill usbmuxd (it will be restarted again automatically)
Restart Xcode
Connect the device
Your device should now be visible again in Xcode!
Select Window ➜ Organizer in Xcode.
Now under Devices, select your device.
If it is not ready for development then click use for development.
If above doesn't solve your problem then from your project settings, set deployment target to one which your app is developed for or lesser.
Otherwise there is some issue with certificates and provisioning profiles. Make sure your device's UDID is added in the provisioning profile you are using.
Had the same problem , restarted xcode and it found my phone again.
I get this problem once, using a not official Apple cable.
Hope it helps.
I ran into this issue today where Xcode 8.2.1 suddenly decided the connected ipad (ios 10.2) was no longer connected. Unplugged, plugged back in, rebooted my macbook, and tried numerous recommendations above.
The thing that fixed the issue for me was shutting down and rebooting the ipad device itself.
To others who might have the same issue and the answers above don't work: Make sure that the iOS version installed on your device matches the iOS SDK version you have installed on your mac. If these don't match you are unable to build to the device.
In my case I did next steps
Quit XCode
Disconnect device
In your terminal sudo launchctl stop com.apple.usbmuxd
Relaunch Xcode
Connect device
May be my answer is helpful to new developer.
Just follow these step , You can connect your iPhone/iPad with X-code.
I just barely tried every solution suggested above. The only thing that worked and resolved my issue was to go into xcode's "Organizer", right click on my iPhone, click on "Remove from organizer" and then wait about 10 seconds while xcode automatically re-added the device.
I previously plugged in my phone and itunes recognized it fine and synced with it, etc, but all xcode said in the organizer was "Device is not currently connected", which it was most definitely connected if itunes was syncing with it and not syncing over wi-fi.
Why xcode needed me to delete and re-add the phone is beyond me, but it works great now that I did this.
I tried all of the above to no avail. I had been using the phone for ages and suddenly the Organizer thought "this device is currently not connected". A reset of the phone fixed it for me (hold Home & Power until the Apple logo). I did so with it still connected to the MacBook, but it shouldn't be necessary.
For Xcode 7 (and possibly above),
go to Window -> Devices,
hit the plus sign at the bottom and select the device connected and hit next, then Use for development.
This only works if Xcode is reading your device, but you aren't able to run your app on the device.
Also make sure the device's OS version is greater than or equal to your app's Deployment Target OS version.
If none of these work, try simpling restarting your iphone or device! Works every time for me (:
Here is how I figured out the problem. Go to Xcode -> Window -> Device and Simulators -> Devices. There you could see Errors and Warnings. I found that my Xcode has to be updated because IOS version of my device is higher.
Xcode did not see my iPad, iTunes also did not see my device.
Rebooting Mac corrected the situation.
Had same problem with some non-licensed cables. Works fine with Apple's & Belkin's USB cables.
My app worked on all simulators but not on my device. I tried just about all the steps from each comment and didn't have any luck. I went to my device settings and switched my "Personal Hotspot" from off to on. Then it was all good!
Have you tried to delete and re install the device in your Apple Developer portal? If yes, try to upgrade your xcode to 4.3.2, I remember that I needed to update to xCode 4.3.2 after updating my iPhone to iOS 5.1
After updating my iPhone to 10.3.3, Xcode 8.3.3 cannot find it in the Device window but iTunes can. Restarting Xcode fixed the problem.
After 20 minutes of debugging, I realized I had to hover over the up button (🔼) at the top of the Devices picker in the top left hand corner, to the right of the run app button 😂
The error I had in XCode was "iOS version lower than deployment target", which I didn't know how to fix. The error was displayed where the iPhone should have been indicated as a Device (upper left). I selected the project in Project Navigator and noticed that the iOS Deployment Target was set to 11.3 but when I checked my iPhone it was set to 11.2.1 (or something lower than 11.3). So I opened Settings on the phone, scrolled down to General and tapped Software Update. Since the update said it was scheduled but didn't start, I decided to take the SIM card out of my other phone and put it in the iPhone I was using for testing. Then the upgrade started quickly. After the Update finished on the phone, however, XCode still didn't recognize the phone. I unplugged the USB cable but didn't hear any sound, so I plugged it into another USB port on the computer and then heard a sound. Then XCode noticed the phone. So the problems were that the iPhone didn't inform me that I had an Update (or I ignored it and forgot about it) and it may have needed the SIM card, and I had a bad USB connection.
Had the same problem. In my case it was my usb cord.
I had this problem. I somehow registered the device for generic team on apple. I don't remember how I did it now. Then I was able to overcome this error.
Just unplug the cable of iPhone with your mac and then plug cable in mac work for me.I hope it's work for someone.
Xcode 6.3 didn't see my iPhone running iOS 8.3 even after a computer restart. I then restarted my iPhone and everything worked again. Love buggy software!
When you trying to build and run the current scheme but encounter this alert message:
"The run destination iPhone is not valid for Running the scheme."
Plus you already check your phone and it is connect to your Mac properly,
all you need to do is just simply restart your Xcode and build it again. That will do the job.
Ran into this issue having upgraded from XCode 9 to 10.1. No devices at all were appearing in XCode, despite performing all the steps listed in other answers.
For me the solution was to do a clean CMake build, deleting the old Xcode project files.
Xcode 10.2.1 was not recognizing my ipad mini. I unplugged and rebooted the mini and it became visible.
The problem was solved for me when I used an original cable. You also get an original cable.
I tried all the ways here but still didn't work. I plugged the cable that I connected the phone to the computer instead of another socket and it worked.
This is absolutely bizarre!
Xcode has been working fine with my iPhone for weeks, and today it stopped working. None of the tips above worked.
Finally I switched the cable from the left hand side port to the right hand side port, and now Xcode is recognizing my phone! PHEW!
But only on that specific port. Going back to the left hand side port still doesn't work!?!?!

No provisioned iOS devices are available with a compatible iOS version

I'm trying to test my app on an iPhone 3G, however I'm getting this error:
No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.
Note that:
The 3G has version 4.2.1 of iOS installed
The iOS deployment target is set to version 4.2
The device has valid development profiles installed
I'm using the latest Xcode 4
I'm at a loss. Can anyone help?
Tim
Solved this problem by closing and re-opening xcode.
Xcode... it's the new Windows.
Try clicking "Use for Development" on your device in the Xcode Organizer. I got this same error and that was the only way I fixed it.
I finally found a solution to this.
If anyone else has this problem then it might be useful to know that Xcode now creates applications for ARM7 by default.
To support the iPhone 3G and other arm6 devices, you need to specify arm6 and arm7 in in the Architectures list, and set the device requirements to only arm6 in the plist.
Another observation for anyone who still has the problem after adding armv6: I found that Xcode was still listing "iOS Device" in the Scheme dropdown rather than filling in the name of my 3G. When I clicked on the dropdown, I saw that there was another slot that listed my 3G. (Presumably the "iOS Device" slot only applies to my other development device, an iPhone 4). I'm curious whether this is intended functionality, so leave a comment if you develop with multiple phones and have seen this.
I have Xcode 5.0, and try to build for my iPad with iOS 5.1.1. And I get the message: No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.
The solution you can see in 4 step:
(1) Select project settings > project settings > Info. Choose deployment target instead of 7.0 i.e. 6.1.
(2) Select project settings > project settings > Build Settings. Change architecture . Don't compile for 64bit.
(3) Select project settings > target settings > General. Set Deployment Target according your device iOS version. Afterwards the device name IPad appear after IOS Device to run on.
(4) Finally I selected IPad.
Maybe you have set the minimum required iOS to a higher version than your 3G has. Could you try to change the iOS Deployment Target in the build settings to the version of your 3G?
I develop on multiple devices and multiple generations of each device. Look at the scheme. In the case of an iOS 5 device, at least, if it does not have the specific device name, but instead shows iOS Device, then eject the device in iTunes and unplug the device. Plug it back in and try to run/install. The device name should show up and the device should have a green dot in Organizer and everyone will be happy. I believe the 3G iPhone just shows up as iOS Device, and I'm not sure about the 3GS, but an iPhone 4 or 4S will show its device name. This is what I get for trying to continue supporting old iPod Touches and 3G phones with 4.2.1. At some time I'll just cut them off and move on.
Not sure, i understand your settings right. But, the rules are:
Base SDK Version >= Development device iOS version
Deployment Target version = Lowest iOS version to be supported.
Hence, i guess, setting base SDK version equal or above 4.2.1 might help.
i also get this case:
when i reset iphone, plugin to xcode again, xcode dont recognized iphone in schema, iphone still have full provision
I go to Organizer window, check device again and see that my iphone dont have green light and have button that ask to use this device for development. Click on button and all work well again
When I changed my app from iPhone to Universal, automatically xCode changed the Deployment Target from 4.3 to 6.1, my device had 6.0 so it wasn't recognized.
Changing the value back to 4.3 solved the problem.
When the first time , your new test iOS connected to you Mac, you can't see it in the pop-up menu. only "IOS Device"
You may try From menu: Window->Organizer->Devices ; then Choose you connected iPad and click “Use for development" ; So it appears .
In Organizer, I had to copy (drag and drop) the provisioning profile from the general 'Profiles' section to the device's 'Profile' section.
This can also happen because you've started to use your device on a computer that's never used it before. Once you've plugged in your device via USB, you'll need to choose to "trust" the device. You'll see a message like the following on the device itself:
Your settings and data will be accessible from this computer when
connected via USB or Wi-Fi
Choose "Trust" when prompted, and then XCode will be able to use the device.
More info here at Apple's site:
http://support.apple.com/kb/HT5868
"No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination."
I had this same problem when trying to build on my device.
Then I realised I was using an aftermarket lead.
Changed the lead to the original iPhone lead and... Hey Presto!
I solve this problem just change iOS Device of the following image to iPhone Retine ....,
I had a similar problem, with this error message: "No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination."
I solved it by simply going to the "jump bar" and changing it from "iOS device" to iPad 6.0 Simulator."

My app reboots iPhone on 4.1 iOS

I've upgraded my iOS on iPhone 3G to 4.1 and now I run my app on the device.
Firstly, I couldn't install it becouse Xcode was saying I don't have certification etc. (I have jailbroken iPhone). Finally, I succeeded and installed it.
But know something strange happens....
After I had installed my app on the device I run it.
Then, "cocos2d" image appears on the screen and just a second later device switch off! It simply reboots.
What's more - when the device launchs again and I run my app - it works!
I have no idea what's going on. This app works fine on 3.1.3 iOS (even with the same Xcode - 3.2.5)
What should I do?
Do you think the problem is caused by Xcode or iPhone itself?
Maybe reinstalling Xcode may help?
It could be one of two problems.
It could be a problem with your device. Maybe something got sort of wonky with your jailbreak.
Secondly, it could be a problem with your app. Maybe it's crashing. Have you checked your crash logs?

Testing in iOS 3.1.3 with the latest Xcode

How do you test an app in iOS 3.1.3 with the latest Xcode build?
Is it possible to do this in the Simulator? If not, is it possible to downgrade a device to iOS 3.1.3?
Yes, you can downgrade a device. It is not officially supported but I've done it on two 3Gs with success for testing on 3.1.3.
First find a tool called RecBoot by someone called the0rkus, runs on Intel macs only. This brings the phone out of recovery mode once you have loaded the 3.1.3 software.
Find the .ipsw file for your device, as you know it is a different file for iPhone 3/3GS or iPod Touch. Load this software to the phone via iTunes in the usual way, holding the option key while clicking "restore". Wait while it loads.
When it finishes and reboots you will find iTunes complains about this version being incorrect. Situation is the software is loaded, ready to go, but it lacks the final blessing from Apple. RecBoot brings it out of this mode, "waking" the phone into normal ready-to-activate state. Once you have gone through connection to iTunes with a SIM inserted you have a phone just as if you had never gone to 4.0.
Too bad we have to resort to a hack to test with older devices but I don't know any other way. It would be nice if the simulator could still run 3.1.3, nice if setting deployment target would flag pre-3.2 features.
You can also install the older Xcode 3.2.1 with iPhone SDK 3.1.3 but the hardware is the true test of whether your software really works. Given that, you could probably skip finding and using it - although there is no quicker way to find everything that you can't use in 3.1.3. There is no problem having multiple copies of Xcode of different versions installed but it is a good idea to uninstall them with the script provided in /Developer/Library/uninstall-devtools (read the readme included with each Xcode distribution)
You need to test the app on a device running 3.1.3.
The deployment target is one thing (that you set to 3.0 so that you can test on the device)
But if you are looking debugging with a specific version of the SDK, you should have the respective XCode installer.
Does your simulator have a menu marked "hardware" with a variety of older OS version choices?
(Mine does.)
Just use that.
It won't be 100% "actual device" test... but it's a WHOLE lot easier.
(None of the simulators are 100% tests anyway.)

How do I use the iPhone Simulator in 3.2 (not iPad Simulator)

I'm fixing my app to be a universal binary. Testing on the simulator seems to default to the iPad. For small corrections like checking orientations and small UI updates, the only way I can find to get the iPhone version is to plug in my iPhone and build and run on device.
Loading the debugger takes valuable time, when running on simulator is so much faster for this kind of work. Can I set the simulator to default to iPhone for this? Setting it to 3.1.3 doesn't work because of the 3.2 code I have in the binary for the iPad.
EDIT:
The Hardware -> Device, and ->Version menu choices in the simulator quits my app. When I relaunch, it goes back to the iPad. The app is not installed in the simulator
If you don't have the latest xcode, get it.
Set the project info to build for 3.2, but in the build drop down pick iPhone Simulator 4.0 and it will open in the iPhone simulator instead of the iPad simulator.
That is the dilemma: if you want to use OS 4 on the iPhone, you have to use iPhone SDK 4, which comes with XCode 3.2.3.
Previously I used iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a, where the simulator was fine, but now after I update the iPhone to OS 4 (which is by iTunes), I cannot use the SDK 3.1.3 any more, and the simulator 3.2 which comes with SDK 4 actually does not work for iPhone at all!
Even when you specify the "iPhone OS Deployment Target" to "OS 3.1.3", and an iPhone-frame shows up in the iPad simulator, many functions are not responding at all.
Does Apple have an official answer to this dilemma?
I finally solved this problem myself.
First, install new version of xCode, which is xCode 4.
Then set project scheme to iphone simulator and run app in xCode several times.
And re-install xCode 3 and the problem will be gone away!