I'm trying to run application on my iOS 9 iPad with Xcode 7 and it gets stuck on "Validating application".
Screenshot:
Reboot your mac and/or restart Xcode. Fixed it for me.
I had to restart my iphone also.
I restarted mac, ipad, xcode multiple times, deleted derrived data and after many unsuccessfull tries, I was able to run my app on iPad.
Disconnect and reconnect the data cable is worked for me. No need to reboot the iphone/ipad or Mac
If you are not planning to release on AppStore and only creating an ad hoc build for testing, then do the following:
In Xcode 7, Goto Product -> Scheme -> Edit Scheme
From the left menu select "Archive" and Select "Distribution" from the "Build Configuration" drop down.
I ran into the same issue with Xcode 8.3 and iOS 9 on the phone. Tried restarting Xcode, computer, the phone- none of them works.
Turns out, the phone was connected to a Wifi network without internet access. As soon as I connected the phone to another wifi with internet, the app installed fine.
The working theory is that the phone tries to do run validation against some remote Apple server, which fits the "Validating application" message. It's very unhelpful that it never times out or produce any meaningful error message, though.
XCode 8.3, iOS10 here. Tried most solutions without much luck
X-Restart phone
X-Restart mac
X-Check WiFi (was connected to internet)
X-Unplug cable (tried both ends)
O-Plug cable into a different USB port
Hope that's an option for you!
I didn't want to restart Xcode (as I wanted to maintain my undo buffer), but found the following worked:
Unplug the cable from iPhone
Uninstall the app from iPhone
Perform clean in Xcode
Plug phone back in
Set phone as the active target
Build
Run
Related
I updated my Xcode to Version 12.4 (12D4e) and after that I am unable to run my app on my device
iPhone X iOS 14.4.2.
Its alway show this Error
When I check my device connected status, Its show as connected
Action I applied
Clear DerivedData folder.
Unpair device and connected again.
Drank 20+ coffees.
I was able to fix the Xcode 12 app install/deployment issue described above:
Failed to start remote service "com.apple.debugserver" on device.
Domain: com.apple.dtdevicekit
Code: 811
Recovery Suggestion: Please check your connection to your device.
User Info: {
DVTRadarComponentKey = 261622;
}
...
by doing the following steps:
Quiting Xcode.
Deleting Xcode cache directory (ie, rm -rf ~/Library/Caches/com.apple.dt.Xcode).
Rebooting the offending iOS device.
Connecting the iOS device to Xcode by cable (instead of wireless network connection).
Starting Xcode again.
By the way, I've a setup very close to yours:
Xcode 12.5 (build 12E262) and
iOS 14.5.1 (on a iPhone Xʀ device)
1st solution
I fixed this by:
Closing Xcode
Deleting the current iOS version in my folder that's related to my device.
~/Library/Developer/Xcode/iOS DeviceSupport
Restarting Xcode. Wait a little bit for it to refresh and copy cache files in my case then Run.
Based on Can I delete data from the iOS DeviceSupport directory? it's ok to delete the iOS DeviceSupport folder.
I noticed when I did it and reconnected my device it re-downloaded the iOS device Support files.
If the support files don't download and the cache files are not copying, try restarting your computer as well.
I started also getting this error:
Errors were encountered while preparing your device for development.
Please check the Devices and Simulators Window.
Restart your phone and reconnect it to the compter if this happens. Then you should get a message in Xcode saying:
Preparing your phone for development.
2nd solution
Unpair the device in Xcode.
Clean the project.
Unplug and then restart iPhone.
Restart Xcode.
3rd solution
If none of the above worked, I was able to run the program by re-enabling Connect via Network.
After doing this now I can run project via USB.
4th solution
I submitted this bug to Apple. Apple also suggests this can be caused by faulty data cords. Maybe try another cord as well.
Unplug the iPhone, Turn it off and again turn it on and reconnect. It worked for me. Sometimes iPhone Debug connection network server clogs up. When you restart iPhone it reinitiate the connection.
This issue keeps happening and it seems like there's a myriad of reasons that may cause it, and so there are a lot of solutions that fixed it for people. Someone even suggested that none of the fixes actually work, and it's only the fact that time passes as we try different solutions that actually fixes it. Nevertheless, I will share what worked for me and what I found so far.
a. In the past, the issue was most often caused for me by using an older version of Xcode with a newer iOS. Apple doesn't always release the version of Xcode that supports the latest iOS at the same time, and this issue sometimes happens as a result of that. There are people who suggest right clicking the Xcode App > Show Package Contents > Developer > Platforms > iPhoneOS.platform > Device Support and renaming the folder for the latest supported version to the one running on the phone (for example renaming 16.0 to 16.1). I've had better luck with using the Beta of Xcode if it's not out yet (in this case using 14.1 RC2 instead of 14.0.1).
b. Incrementing the build number and setting a Display Name. This seems to have fixed the issue after nothing else worked. Again, this seems very random, so it could be unrelated, but it did fix it in my case after nothing else suggested on all the threads about this worked.
c. Deleting the profile in Settings > General > VPN & Device Management
Other suggestions I've seen across threads:
Restarting the device (seems to be the most popular solution)
Unpairing the device
Checking device status under Window > Devices and Simulators. There may sometimes be some further info about what is going on here, the device may still be preparing for development or downloading symbols or whatever
Using another cable. This never worked for me, after trying with 3 cables, 2 from Apple and one 3rd party, but others reported it worked
Deleting Derived Data (use Dev Cleaner or rm -rf ~/Library/Developer/Xcode/DerivedData
Uninstalling the app manually from the device
Resetting Network Settings
Force restarting the iPhone
Apple really needs better errors and less ridiculous bugs like this.
I had to update Xcode to fix this issue because my version of Xcode did not support my up-to-date iOS version.
I've had the same issue and also had the problem that I wasn't able to connect my device by cable (it popped on and of), so I had to use wifi connection on Xcode.
I was able to see the icon of the app created by Xcode on my iOS device, but whenever I tried to start it, it won't do so giving the "Untrusted Developer" error message.
I fixed this by going to:
Settings > General > VPN & Device Management > Developer App
Here you have to chose the App and consent to trusting it.
I reset the iPhone network settings and it works!
I have the same problem, my solution is update my ios version(15.1 to 15.2 beta)
I tried all the resolvent, nothing worked
restart iOS, Xcode, macOS
clear DeviceSupport, Caches
unpair iphone, change lighting cable
Then I find my ios version(15.1) does not exist in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport.
I try to fix it, but failed.
Finally, I can only update my iOS device to 15.2 beta version, It solved! Xcode is update to beta version too.
My devices original version:
iOS 15.1
Xcode 13.1 (13A1030d)
I'm on Xcode 13.3 and I fixed this by unplugging and plugging the cable between my MacBook Air and my mini iPad 3.
I fixed it by,
Following the steps : Window > Device and Simulator > Select your device and Right Click on it > Unpair after that re-connect your iOS Device then boom... Clean builds and run the app, it will work for you.
Upon solutions aren't working for me. Restart my iPhone then all well done.
I am making an app in Xcode 9.2 and trying to run it on my iPhone (5S running iOS 11.2.1), Xcode compiles the application fine (I can run it in the simulator) but it does not run on my iPhone.
When I try to run it on my iPhone it just says "iPhone has recently restarted" and "Xcode will continue when iPhone is unlocked." Now, my phone has not recently restarted and I tried unlocking the phone and restarting it but neither works. I also tried restarting Xcode.
Is anyone else getting this "recently restarted" error? Is there anything I can do about it?
Unpair the device and pair it again from xcode -> Window -> Devices will solve this issue.
Posted as answer after the confirmation from #brettf.
if you using vpn services, then you need to turn off vpn. It will help
If you're using a VPN on your iPhone that may be causing the problem - at least it was for me. Things went back to normal once I turned off my iPhone VPN.
I didn't have a problem while a VPN was enabled on my Mac, but it may be worth turning that off as well if you still have issues when the iOS device VPN is turned off and the device still won't connect correctly.
VPN calls this issue on my iPhone for Xcode 14.0.1
Just to clarify:
Unplug device
In Xcode, windows -> devices and simulators
Right-click the device shown in the left pane. Select 'Unpair device'
Plug in device
Follow the prompts on the iPhone and Mac
I just encountered this problem for Xcode 12(both release and beta version), the unpair and repair solution does not resolve, so I reset all settings(Settings -> General -> Reset -> Reset All Settings), and then the problem solved.
I'm running an app on my iOS device but, in Instruments, that device is greyed out.
This also means I can't attach the process (Cant launch iOS app with Instruments on device). Is it anything to do with my earlier question: Instruments > Profile - Revoke and request
Xcode: 6.1.1
iOS: 7.1.2
Any idea why?
I only had to reboot my phone (not my Mac), and then the error went away
(Xcode 9.2, iPhone X running 11.2.6).
i was having this issue and resolved it by
Unplugging my device
Turning my device off
Rebooted my mac
Turned device back on and plugged into computer after logging back in.
now it shows up in instruments. I tried unplugging device, restarting xcode, but that didn't work. rebooting everything is what did the trick for me.
I met the this problem. Xcode(Version 9.3.1 (9E501)), iphone 7, And I forcely quit the Instrument. It's work
I came across same problem today on xcode7.2.1, iOS 9.2.1, iPhone 6Sp. Resolved by rebooted my mac, my watch and the iPhone.
If your workspace contains several projects and/or several targets, it seems that XCode doesn't know which binary to profile.
Just Edit your scheme -> Profile -> Choose an Executable and it should enable the profiling option.
I had the same problem where Profile was greyed out. It turned out to be I had the device option at the top set to Generic iOS Device
// this will make Profile greyed out
Once I switched it to an actual simulator device or my actual device Profile was no longer greyed out
One other option can be to in Xcode at the top go to Help > search Edit Scheme and select it > on the left side of the screen select Profile > change Executable drop down to your_project's_name.app
I don't know which process helped but I force quit AppleMobileDeviceHelper and DTServiceHub in the Activity Monitor and then it started working again (I was able to select my phone without rebooting).
Recently, I confronted the question again on Xcode Version 10.1 (10B61), iphone 7 and Mac 10.14.1 (18B75). I resolved it by upgrading the deployment from 8.0 to 10.1. In fact, I have meet many strange Xcode bugs caused by the version, liking this one(xcode gpu shader profiler)
It turned out that my iPhone is not trusted my computer.
How to re-trust computers, see:
https://www.wikihow.com/Trust-a-Computer-on-an-iPhone
In short, you should reset Location and Privacy in settings, and then plug-in your iPhone again. And you will see 'Trust this computer' again.
My issue what that it was asking me to trust the computer every time I plugged it in.
To fix it, I had to turn on the Hotspot then turn it back off.
When I tried to build and run, Xcode said my device was locked. I looked at my iPhone, and it's not locked at all. How do I fix this?
My phone was set to "trust" the Mac, and I still ran into this error with Xcode 6.1.1.
This worked for me:
unplug device
quit xcode
open xcode
plug in device
build/run
Did you by chance not "trust" the device? This will prevent it from communicating with xcode even if the device is unlocked.
Update here's a support doc from Apple: http://support.apple.com/en-us/HT5868
I recently ran into this issue with XCode 8 just after updating my device from iOS 9 to 10. The exact error I received was:Development cannot be enabled while your device is locked. Please unlock your device and reattach. I received this error even when my phone was unlocked, and after unplugging and re-plugging in the device.
As is mentioned in several answers, the device is locked message is actually referring to the device not trusting the MacBook. In my case, I think my phone defaulted to not trusting my computer after updating to iOS 10. Here are the steps that worked for me to reset the settings (this is the same process that is mentioned in the Apple support page in tehprofessors' answer):
Disconnect your device from your MacBook and close Xcode.
On your device go to Settings > General > Reset, then tap Reset Location & Privacy
Plug your device back into your computer, and on the device you will be prompted to trust the computer. Tap trust.
Now reopen Xcode and rebuild the project.
The device locked error should disappear.
From the Window Menu in top bar of Xcode, select Devices and Simulators.
(or Press SHIFT + COMMAND + 2)
Then select your device, right click and select Unpair.
Once you do this Trust or Don't trust will appear on your device.
Trust the device again and it will begin preparing it for Development.
Wait for Xcode to pair device for development and then you are good to go!
I ran in to the same issue even though i selected "Trust this computer" option first time.
This worked for me
Lock the device
Remove cable from device.
Unlock the device
Connect again to Mac
2018
The fastest way for now i found is:
1) Go to Window -> devices (changed the hotkey in xcode to CMD+P for me)
2) Press unpair on the device.
3) Press trust in iPhone.
4) Build again or Run without building (Ctrl+CMD+R)
Rebooted my iPhone, and that fixed it for me.
I tried every answer on this page (7 at the time, though 2 are duplicates) and they were all unsuccessful for getting rid of this Xcode error for me.
I have a very simple solution which worked for me instantly. Takes some 10 sec to do:
1) Go to Window -> Devices & Simulators and untick Show as run destination
2) Unplug the cable and plug it back in.
3) Run the project.
This should be solving your problem!
For anyone who need a logical answer..
Go to Window -> Devices & Simulators. Right click on your device & unpair it.
Disconnect from cable & reconnect.
Wait for it & let Xcode detect you device.
Run the project.
Make sure you TRUST on your iOS device and enter any passcode.
For those who has this issue in Xcode 9:
Simply restarting Xcode should solve the problem.
This happens at times while using Xcode 9.
There are multiple solution to this as mentioned below :
Note : Make sure that your device is not locked when Xcode is trying to install app.
Solution 1 :
i. Disconnect device and connect again
Solution 2 :
i. Restart you device
Solution 3 :
i. Disconnect device
ii. Quit Xcode (Shortcut key : cmd + Q)
iii. Open your project
iv. Clean project (Shortcut key : cmd + shift + K)
v. Now connect device
vi. Run your project
For me Solution 3 worked perfectly
A simple solution:
First, unplug your device.
Now, unlock your device and plug it in again. Be sure that the device is unlocked.
Now run the Xcode project by selecting the device as target.
When you plug in your iPhone, it will ask you to trust the computer.
If you already trust and unlocked but still said your device was locked (bug). Just unplug and plug again then it will work
These steps worked for me in iOS 10.
Remove the cable from device.
Plug in the device.
Clean and build the Xcode project.
There is a simple way to resolve that. At least it works for me.
In your iPhone Device
Go to Setting > Developer > click in “Clear Trusted Computer”
Type the passcode required
And done!!!
The simplest way that I found.
I run into this problem quite often (at least like 5 times a week). Almost every time this happens, a Xcode restart fixes it. But this time nothing seemed to work including:
Restarting Xcode;
Unplugging and re-plugging the iPhone;
Cleaning the project (cmd+shift+k);
Cleaning derived data (cmd+option+shift+k)
Done dozens of times in all sorts of different orders.
What fixed the issue for me this time was simply:
✅ Rebooting the Mac.
Recently I have met the Xcode shows "development cannot be enabled while your device is locked, Please unlock your device and reattach. (0xE80000E2).
If your iOS device is already unlocked and connected to mac and still get the error from Xcode 8.1 after upgrading to iOS 10.1.1, then the mac is not trusted by the device.
To fix it, first disconnect device to mac and then go to iOS settings app, and open general->reset->Reset Location & Privacy.
Then connect device to mac and when prompted, set select trust the mac.
Then wait the processing symbol files within your device and mac. After it finished, you can run the project to your device. It will be working.
I spent hours trying to fix this issue with no luck.
BE SURE TO DISABLE ANY VPN SERVICES FROM YOUR IPHONE. Just like magic, it started working properly.
This issue is not about "Trust" or not. It's a bug in Xcode.
Just follow these steps.
When Xcode is running and your device is connected:
Lock your device.
Unplug your device from Mac.
Unlock your device.
Plug your device back to Mac.
Solution: Switch target device to some other (e.g. Generic iOS Device),
then unlock you physical device and switch back to it again.
Generally just unplugging/replugging seems to work for me. But today it didn't and something else seems to have worked: I have enabled network debugging on the device in question and it almost looked like it remembered an old network "lock" setting, while not seeing that the device was actually connected via USB. After (temporarily) de-selecting "Connect via Network" and replugging, it got things working again.
there are two solution worked for me.
1) disconnect your device from the mac and reattach it.
2) disconnect your device from the mac and restart it and then connect it with mac it'll work
sometimes your device stops trusting your PC for no reseaon. go to your settings then general > reset > reset location and privacy. and replug your device to your PC again and press "trust this device" prompt that shows up in your phone.
Lots of answers, but the one that worked for me (El Capitan, Xcode 8.2) was to close iTunes. If that has a connection to the IOS device then although Xcode can load the app components it will still fail to run it.
On your device (iPhone/iPad) goto: Settings -> Developer -> Clear Trusted Computers worked for me.
I found that by shutting down a Console and a running Simulator allowed XCode to see my iPhone again. I'd make sure other related programs aren't running if you don't need them.
This can also happen due to pending update on your device. This also means you need to update your phone, connect to the MacBook (trust it if needed). This how I found my problem and solution.
One possibility worth checking, if none of these other solutions work, is that there is no space left on the device. Xcode will not give you a helpful "device full" error to tell you that your device has no storage space left, but it will also not be able to deploy an app build to a device whose storage is full. The only solution in that situation is to delete media or other apps/data to free up enough space.
Bizare, but I hope it helps someone.
I was connected to a VPN (Pro XPN) and that was causing the issue! Disconnected and it worked.
Another fix to this problem is to connect your iPhone with your Xcode open while your iPhone is in the homescreen, not in lockscreen or with an app opened.
I just downloaded Xcode 6 & played with it a bit.
After switching back to previous version of Xcode and running in simulator, I keep getting this error.
Unable to determine simulator device to boot.
How do we resolve this?
Thanks in advance.
Make sure you have only one iOS Simulator instance running in the Dock.
There was a simple answer to this for me:
Open the simulator via Xcode -> Open Developer Tool -> iOS simulator (even if it can't launch, the app will be open).
With the simulator app open, go to Hardware -> Device -> Manage Devices.
Add any missing simulators with the plus button (all of mine were missing for some reason).
I've faced same issue and solved by below steps:
1) Move xcode6-beta into application folder
2) Restart mac and open xcode6-beta from application folder.
I had the same problem when running from Xcode 6 beta selecting iPhone 5s. If I choose iPhone 5 or "resizable iPhone" then my app launches fine.
You will not see the profiles of simulator without a rebooting of OS X.I added simulator for many times,when the rebooting finished, it shows on the device list under the simulator bar. I think this is a bug of Xcode 6 Beta
I think you have 2 simulator running in the dock. Please close another one simulator and run the project again. It might helpful for you.
In my case I had such a message just because the simulated device was still booting (longer than usually, I guess). Xcode 7.2.
(This is not actually an answer to this specific question, but I came here googling the message in the title, so I am writing my note here for if someone else gets the same case as I did)
My case wasn't about having two simulators open. It was just because having instruments open as well. Closing Instruments resolved the issue
I just fixed the exact same problem by removing the beta version and rebooting the computer.