Sigh. It started around 6 months ago and happened from time to time. For last 2-3 days I completely lost opportunity to debug on device. Whenever I'm trying it, I get infinite stuck on "Performing install actions" step. Sometimes, it ends with "unknown error occurred", sometimes with "Could not launch", sometimes it just stuck without any error.
I know the problem is in my specific iPhone, because it doesn't happen with another iPhones and it does happen with my iPhone on different machines.
What I've already tried and it sometimes helped me, but now it doesn't help at all:
restart XCode
restart Macbook
clean build folder/derived data (yeah, I'm an experienced iOS developer, so I've tried that)
unpair device and pair it once again (I should say, that previously I thought that was a silver bullet)
reinstall XCode
reinstall iOS Device Support
turn on/turn off Wi-Fi/Bluetooth
reboot iPhone
reset iPhone
reinstall provisioning profiles
pray
unpair Apple Watch
turn off Apple Watch
My setup: XCode 14.2 (tried different versions too, for example, XCode 13), iPhone 11 (iOS 16.2, started when I was on iOS 15)
Once again, I don't have any problems when I debug on Simulator on different device.
Any recommendations would be really appreciated, cause I'm already starting to lose my mind.
Related
I just got back into iOS / WatchKit development after a ~8 year break. I'm having a really hard time making an app for the watch, because
Simulator is not helping because random things seem unsupported (most recent example being WCSession.transferFile, which apparently is a bug)
On device is not helping because the loop to get it to run on device is completely out of hand, and I was not able to get either logging or debugging to work when running on device. (My main problem is that if I do CMD R in Xcode with my Watch selected as target, it builds, and says running, but never launches the app. If I launch the app manually I find it's not the most recent version. I have to go and remove it from the watch, and re-add it, which then causes Xcode to not be able to run it anymore, which means I have to restart Xcode. What.)
So my question to more experienced devs is: what's your debug cycle when writing Apple Watch apps?
I'm running Xcode 12, watchOS 7.1, on Mac OS 10.15.7 (not Big Sur which may be some cause of issues)
Some steps that help for on device debugging:
To re-install the watch app, select the iPhone app in Xcode and build and run that. This will also re-build and re-install the watch app as needed.
Open the app manually on the watch
I still haven't figured out how to get a debugger or console, but for now my hack is to have a label on the watch that I use as my on device console.
This is almost certainly an Xcode 12 issue. At least since Xcode 12.5 my app has not worked with watch simulator (it can't connect to the phone simulator) and I get no debugger with a real device.
Using Xcode 12.3 seems to work.
I have a strange behavior for a few days. Every debug start in any iOS project on a physical device (MacOS projects start up normally) that I'm working on (even in a blank new project) lasts between one minute (on a USB connection) and over two minutes (on) a Wi-Fi connection). That's so annoying! I use Xcode 11.2.1 and Xcode 11.3 Beta, the same result on both. The host system is macOS 10.15.1 on a Macbook Pro Retina 15 inch (late 2012). The app will always hang in the home screen until it finally launches. While booting over a WiFi connection, a process called "llbd-rpc-server" receives several megs from the iOS device over the WiFi network, even on a completely empty sample project! I have never had this problem before! I have a backup system that does not experience this issue (same Xcode and MacOS version). So, is this an Xcode setting in the context of LLDB? I have already disabled all breakpoints, no change! Please help!
I have been suffering with this for a couple of weeks. I finally found https://forums.developer.apple.com/thread/123068 which includes the helpful hint:
I deleted folders inside ~/Library/Developer/Xcode/iOS DeviceSupport/
(folder's name started with 12.4.6), then run Xcode and launch an app
again, problem solved.
Which did in fact finally solve my issue.
I upgraded to OS X 10.11.5 and Xcode 7.3.1 a few days ago and all seemed well. Then today after adding my new iPhone 6s Plus to the device IDs in my developer account and having Xcode do an automatic 'fix issue' to update the provisioning profile when trying to run my apps on my new device, I am now getting Invalid Device State errors on all my simulators in all my apps. Running the apps on my new device works fine, but all the simulators give me the error. I tried the solutions found here iOS Simulator: Invalid device state and here Invalid Device State - Xcode/iOS Simulator error but neither have resolved my issue. When I run xcrun simctl list all the devices show a status of Shutdown, which I assume is what the status should be. I then run xcrun simctl erase all and I get no errors. I then did a clean build and a clean build folder, and restarted my Mac, and still the error occurs after doing all these steps. This is really frustrating, and I hope someone can point me in the right direction. I always get nervous when it comes to upgrading OS X and/or Xcode because more often than not something breaks in my apps, or something like this occurs.
I tried everything possible to get this to work for two days. Finally I re-installed Xcode and that did it. In case someone runs into this issue and the regular solutions do not work, don't waste your time trying to figure it out, just re-install Xcode and save yourself some time.
just quit xcode and simulator. it will resolve the problem.
I have been trying unsuccessfully to profile my device (via Instruments) using the latest version of Xcode 7.0.1 (7A1001 released 9/28), as well as the previous version of Xcode 7 (7A218), as well as Xcode 7.1 Beta 2 (7B75).
My device is an iPhone 6+ with iOS 9.0.1 installed - the latest GM release of iOS9. I am able to run / debug applications on this device without issues.
In the screenshots below you can see that my device is disabled (greyed out) in all screenshots in all versions. I am able to profile other devices running iOS 8.4.1 without any issues.
Does the current version of Xcode not support profiling against iOS 9.0.1 or is there some kind of configuration setting or known work around for this?
Xcode 7.0.1:
Xcode 7.0:
Xcode 7.1 beta 2:
TL;DR - Perform a complete reboot of your device; restart Xcode & instruments; select "Open Xcode" if prompted to enable the device for development.
Update 3/31/2016: I haven't encountered any issues with the latest version(s) of Xcode (7.2.x, 7.3), so it seems that the stability here has been improved.
I believe I may have finally gotten this to work properly. Detailed steps:
Unplug the device from your Mac & power down the device completely (hold the power button for several seconds; slide to power off).
Close Xcode and Instruments.
Restart the device & once it has booted completely re-connect it to your Mac.
Re-launch Xcode. Here, my device showed as disabled and Xcode indicated that the device was not available for use.
Open your project; clean (Shift+Command+K), Build (Command+B), Profile (Command+I).
After Instruments launched I noticed that the device was enabled. Upon selecting it, a message was displayed with the title "Enable this device for development?" and message "This will open Xcode and enable this device for development." (Note that this only happened to me the first time I went through this process even though I had already been using the device for development - whereas some users have also reported that they are not presented with this dialogue.)
Click "Open Xcode". Here Xcode did not prompt me for anything nor was anything displayed - no additional messages indicating anything had been done or that the device was or was not available for development. Opening the Devices window, the device appeared to be available. (I have not been presented with this option for subsequent occurrences.)
Now I was able to select the device in Instruments and profile it.
As a side note, I was also again able to delete installed apps from the Devices window (I realized that this was not possible to do previously).
I'm unsure how my device ended up in this state however I will be on the lookout to see if this continues to occur.
Please note that this was done using Xcode 7.0.1.
Update: My device seems to lapse back into not being able to be used for profiling some time after performing these steps - I've had to reboot my device again in order for it to be available for profiling. Not sure what is triggering this behavior but I will file a Radar for this.
Close instruments -> reset your device by long pressing home and power button -> restart instruments. Works for Xcode 7.3.
According to Apple staff on the developer forums the behaviour of this issue is greatly improved in the Xcode 7.3 betas, so one easy solution is to try upgrading Xcode. I've upgraded and it seems to be behaving so far.
This issue still occurred with XCode 10.3 and iOS 12.4.2
I restarted the device only, and it worked.
I installed xcode 6 and was working on my app on simulator.
Now i have added push support it was time to start working on the device.
The problem is i cant get it to work. The device sits there and does nothing. Xcode says the app is running on the device but nothing happens.
When i click on "Running app on device" i can see its in the status of
"Validating Application "
The whole time...
I tried the solutions on SO but they are all for xcode 4 and some points about architechture and info.plist.
Checked both nothing wrong with it (testing on 5s, 7.1).
Tested other apps (got from github and so on), same problem cant run on device.
I think it has to do with xcode because all projects (big and small,old and new) don't work. I also tried on my ipad same problem.
So its not related to project or device.
Anyone has a solution ?
Removed xcode and installed it again. Works.
But to be honest since Xcode 4 this is the worst Xcode, allot of hangs and crashes. Need to force quit at least 6 times a day.