Xcode error: This device is no longer connected - iphone

While executing the project on an iPhone, I am getting an error while installing the project through Xcode:
This device is no longer connected.
Whereas I can see the device summary and a green dot if I open the Xcode organiser. What is the problem?

Try quitting Xcode totally and reopening it.

I faced the same situation. I tried
Clean and build
Restarted Xcode
Deleted derived data
Rebooted system
nothing worked for me
I switched the usb port(from left to right port), It just worked.
I know it sounds weird, but it worked for me

The answer is to restart your iPhone and Mac. By doing this your issue will be resolved. This you can try on any version of Xcode
The error comes only after trying to run the project many items, instead of solving the Provisioning Profile issues.
So, it's better to solve the basic error first, or else it will create another hectic problem.

Try to disconnect the device and reconnect it. Sometimes this fixes such kind of problems.
If that does not work, closing and reopening Xcode may help.
Although, since you are mentioning a virtual machine, you might check and see whether there are any conflicts in the attribution of the USB port to one system or another (Windows vs. MacOS).

iPhone/iPad USB connectivity is finicky as it is, and you're running OS X in an unsupported way. I'd suspect that this is the problem.
If you're running VMware, this may help: DEBUGGING ON THE IPHONE & IPAD WITH VMWARE
Basically it's this: Install iTunes on both your host and client OS, as the Apple Mobile Device USB driver for Windows may help your cause.
However, if you're serious about developing for iOS, using a "real" Mac is definitely the easier way.
UPDATE: From your comments, I gather that you need to be able to use Accelerometer input in your app. You could use iSimulate (in the App Store) to send this data from your device to the iOS Simulator.

I got this issue after installing Xcode 5. The solution I found is to restart your system and it works fine.

I had the same problem. It was a broken cable.

Related

Xcode Device Issue - Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode

Error and warnigs in devices and simulators
Issue :
Details
Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fecb76471f0:'com.apple.platform.iphoneos':<DVTFilePath:0x7fecb7647170:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "\Ud83d\Udcf1<DVTiOSDevice (0x7fecb9844570), TakHyun\Uc758 iPhone, iPhone, 13.4.1 (17E262), 8d695f88c5c910974df39462a1815a52376a0fa9>";
}
TRY:
Restart macbook and iphone
Trust in Trust This Computer notification
Xcode Version 11.4.1 (11E503a)
IPhone X ios 13.4.1
I finally figure it out
Connect the iphone(cable not wifi)
Unpair device and quit the xcode
Reconnect the iphone and Trust this computer accept
Done.
If you cant fix it, go to apple dev site
reedit the device and do it again 1~3
check this photos
I started getting the OP's error after updating my iPhone to iOS 13.5.1. Here is what worked for me to resolve the issue:
Unpair the iPhone (as per answer from #Jeff above).
Upgrade Xcode to latest, in my case 11.5 (which I believe is the first version of Xcode to support building to iOS 13.5.
NEW: I launched Xcode after updating to 13.5 which prompted me to "Install additional required components" which I did.
Xcode extra step after updating
Reconnect/pair iPhone in Xcode's Devices window and Trust the computer.
NEW: After pairing the iPhone make sure you check the "Connect via Network" checkbox for the newly paired iPhone. By default Connect via Network is unchecked.
Important step after re-pairing device
The "NEW" steps are not steps I've seen in previous answers, so I posted this answer.
Or Xcode is just not smart enough to know that your iPhone iOS version is newer than the one supported by Xcode! I had this issue, been trying all solutions until I updated my Xcode from 11.4 to 11.5
So this started for me after I updated Xcode to version 12, and my iPhone to iOS 14. The fix was as listed above (multiple times) to unpair, reconnect, and trust the computer, BUT only after changing the target to iOS 13 in Xcode did those steps actually work. Once it was reconnected I was able to switch the target back to iOS 14 inside Xcode. This one was frustrating.
In my case, I was using an USB to USB-C adapter which apparently my laptop did not appreciate. Switched to a usb-c lightning cable and poof - everything just works. Now I'm mad that I already reset my network settings!
I had issues with Xcode 11.5 and iOS 13.5.1
Sucessful:
Remove the Logitech Wireless Mouse USB Receiver that was plugged into
the USB-C to USB converter (I use this converter to connect both the
Wireless mouse AND my iPhone via USB to Lightning cable). This
REPRODUCABLY caused the described error "Failed
_shouldMakeReadyForDevelopment check even though device is not locked" to reappear when I repeated the re-pairing procedure with the
Logitech adaptor plugged in
Not successful:
Unpairing (from both Macbook or iOS - Settings - Developers - Unpair)
unplug, Repkug the USB Connector
Connect via Network setting
Restart iPhone, MacBook, ...
I had some success turning Bluetooth off and on again on the phone. Still, the watch often disappears.
None of the above worked for me. With iOS 14.0.1 and XCode 12.0.1.
I suspected it is an Apple bug with wireless communication to-from the device.
Since my iPhone can be used as a hot spot for my Mac, I found that once I used my iPhone as a hotspot from my Mac, XCode was able to upload the App binary to my iPhone and debug.
So I'd say if nothing else works then try to use your iPhone as a hotspot for your Mac, and then you should be able to wirelessly debug.
For me it was the exaxt opposite of the message. Xcode was up to date, but the iphone I was trying to run on was not updated to the latest version of iOS. 13.7 was the version at this time.
After updating to 13.7 the iPhone, everything went back to normal.
I rebooted my iPad, and it eventually worked...
My problem was building the application with a production provisioning profile.
in my case, the solution was to switch to the development provisioning profile.
Then it worked :)
Mine got resolved when I updated the Xcode from 12.2 to 12.3 Beta.
My iPadOS version is 14.2.
Even though XCode 12.2 supports OS 14.2, I faced the same issue. It is the XCode bug.

Xcode shows popup but there is no errors

Working with my application It goes well but has met into a problem with Xcode. When I try to run the application on the iPhone simulator this message always pops up:
"A coordinated app install already exists for com.apk.ios with intent IXCoordinatorIntentUpdating (creator InstallCoordination Simple SPI) but request by CoreSimulatorBridge (pid 677) was for intent IXCoordinatorIntentInitiating"
What is wrong? There are no errors when trying to build the app. Has tried to clean the build.
Erasing all content and settings is not always necessary as #user3344236 stated.
Please make sure to delete the app that you are trying to install from the iOS Simulator. That'll probably solve your problem.
Why this occurs?
In my case something went wrong while Xcode is trying to install the app on the simulator. Everything is frozen and I had to restart the Mac manually.
Found a solution that works for me:
Reason:
Either the App store or something else tool is downloading the same app with the same identifier at the time Xcode is trying to launch the same app on the Simulator or on MAC.
Solution:
Need to stop/delete all the running installs of the app with the same identifier. (How to stop -> that can be figured out to see either App Store or any other tool ) Then try again to launch the app with Xcode, this time it succeeds.
No need to Reboot the simulator/ Mac or reinstall Xcode.
Thanks, Hope this will help someone.

xcode continues project loading forever

I have a source code of a swift application which developed for iOS using swift 3.
I want to run it inside Xcode however it remains in loading state forever.
I have tried solutions provided in question Xcode freezes on startup while loading project however the situation did not change.
The developer of this source code told me that he used Xcode 9.x to develop application so he suggested me to try a 9.x version of Xcode. I guess Xcode should be backward compatible however I want to know does using Xcode 9.x changes the situation or I should look for reason somewhere else?
Using answer in apple.stackexchange.com did the trick:
Removing the ~/Library/Saved Application
State/com.apple.dt.Xcode.savedState/directory might help.
I tried all the solutions outlined here and none of them worked. However, I managed to fix this issue and here is what worked for me: If you're on an Apple OS and have iCloud sync enabled on your desktop/documents/any folder where you're loading Xcode from, the iCloud sync could be causing this issue.
I installed a fresh copy of my RN project in a directory not synced by iCloud and subsequently the issue was resolved; my build-time was down to a couple of seconds!
rm -rf ~/Library/Developer/xcode
in terminal worked for me, based on this answer
As of July, 2022, nothing else worked for me but, taking my project outside of the iCloud Drive and putting it into a directory without it. As it is mentioned above, iCloud sync interferes with the XCode running and stalls it.
I wasted almost 2 hrs and tried everything on stack over flow
SIMPLE SOLUTION
Just turn OFF icloud from your mac os so that it it will not sync the project.
To turn off icloud
Go to setting
Icloud
turn off sync
Thats all enjoy
I tried to delete:
~/Library/Developer/Caches/com.apple.dt.Xcode
~/Library/Developer/Xcode/DerivedData
~/Library/Developer/Saved Application State/com.apple.dt.Xcode.savedState
~/workspace/MyProject.xcodeproj/project.xcworkspace/xcuserdata
and once it helped. But another time it didn't help, so I also tried to reinstall Xcode, which also didn't help.
It turned out that the problem was that I was installing the app via WiFi or Bluetooth. When I connected my device via cable, the Xcode popped up to life and the "loading forever" stopped.
My xcode got hang when I force quit it. After that it was showing only "loading".
Here is fix to start xcode from beginning.
cd /
cd Applications
cd Xcode.app
cd Contents/MacOS
sudo ./Xcode
it will open xcode default window to open a new project.

Error : The service is invalid

I am having some problem in installing my app on the iphone as I am constantly getting the following error message
The service is invalid
Please check your setup and try again
(0XE8000022)
It was running perfectly well till yesterday but since yesterday I am having this problem.
Xcode and the GDB connection is quite temperamental. The device and your Mac can become unsynchronised with each other. My checklist for this sort of thing:
Restart Xcode.
Delete the .app from your iOS device, do a Clean then Rebuild.
Disconnect, reconnect device.
Restart iOS device (90% of the time it fixes things)
If all else fails, restart your Mac (unlikely but it did fix an issue once for me).
I have solved the problem... Only needed to restart the iphone...
Restarting the Xcode wont work in this case. So just restart your iPhone and everything will be fine.
EDIT:
If you have an iPhone 5 running iOS 6.0 and have installed the "iOS Updater" app, you will also have this message.
Finishing the update process to iOS 6.0.1 will resolve the problem.
If you have an iPhone 5 running iOS 6.0 and have installed the "iOS Updater" app, you will also have this message.
Finishing the update process to iOS 6.0.1 will resolve the problem.
This error also happens if the iPhone provisioning profile has expired.
It can be a couple of things, the first and inmediate thing I'd check is to see if your IPhone is currently Downloading or "Preparing Update..." whilst this is running you generally get the "Device is invalid (0xe8000084)" / Error MT1006.
This i found to be the most common thing. so try this first.
And if that fails: Restart your IPhone, and then if that fails restart your Mac/Xcode
and do a clean then Rebuild and deploy..
Hope this helps
This error happens when you try to debug an application in your IPod/IPhone and the device is code-locked or executing another application.
Make sure you can see the menu with all the app icons on the device and try to run again.
Regards
If nothing works then check if your device os is compatible with your Xcode version.
I confirm that restarting your device solves the issue.
But if your device is jailbroken with a Semi-tethered jailbreak you will loose it after a reboot.
To prevent this, do a ldrestart(soft reboot).
In order to perform it, download a terminal application from Cydia, then type:
su
Input your password when asked, the default password is "alpine".
Then type
ldrestart
Unplugged the device and connected again with Mac solved my issue. Did not need to clean, build or restart XCode. XCode 10.2.1, iOS 12.3.1 version.
First remove the app from iPhone before building the app from xcode.
Then Clean All Targets from xcode and then try to build your app again.
SnowLeopard w/ XCode 4.2's Instruments will give this message on newer iOSes.
I had luck by disconnecting my iPhone from my mac, and then Analyzing (Shift + Command + B or Product -> Analyze).
After that I plugged my iPhone back in and did a clean (Command + k) and then run. Worked!
Simply restarting the device (as the alert suggests) fixed the problem, at least on iOS 12.

Xcode error: Failed to launch simulated application

Problem
Unlike people have asked at here and
here, I got this error after a brand new installation of Leopard (hackintosh), this problem really driving me crazy and nowhere else to find an clue, I googled and visited every article related with this, still can't get it solved.
After the first time install iPhone SDK 2.2.1, start a new project(any type, Navigate based, OpenGL ES application), then build and go, I got the following problem:
sometime it's:
Failed to launch simulated application: Unknown error.
and sometimes it's:
Failed to launch simulated application: iPhone Simulator failed to find the process ID of com.yourcompany.[application name]
It seems that apps in the simulator crashed immediately, so Xcode can find the process ID.
Solution
This link says that this even can't be solved. Some others make a detailed step by step:
Uncheck Info.plist
Quit XCode
Delete directory /Lib/Caches/com.apple.DeveloperTools.###
Open Xcode project
Clean All Targets
Rebuild
and I reset the iPhone Simulator. This also didn't solve the problem…
I've even tried uninstall the SDK and reinstall it, still got the same error…
Is this a problem related with hardwares? or the operating system version? I'm using a hackintosh (iDenebv1.4 10.5.6), all other software works good including iTunes && vmware fusion.
Great thanks for any further tips or clues!
FIXED For the issue:
iPhone Simulator failed to find the process ID of com.yourcompany.[your application name]
I was having an issue building and simulating a project I built under OS Version 2.2.1, which I could no longer get to build and run in the simulator for XCode 3.1.4, even though I forced XCode to build for "Simulator - 2.2.1 Debug"
I was able to get past this problem by:
- Close the iPhone Simulator
- Putting XCode into View->Detail
- Opening the "Info.plist" file in the "Resources" folder
- Near the top of the file you should see "Info.plist" with and up/down arrow selector
- Click on the up/down arrow selector
- Select "Clear File History"
Built For:
Simulator - 2.2.1
XCode Version:
3.1.4 (Which includes OS3.1 Beta 3)
I had the same issue last night, and suddenly my system got reboot. At that moment, i was trying to install an application into simulator. When system returned, and i tried again to install the app, it said, "Failed to launch simulated application"
Than i did googled it, and tried many solutions, like cleaining all targets and try building again, but didn't worked out.
So i have found the following link, where it is described, how to reset the iPhone Simulator contents:
http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/125-Using_iPhone_Simulator/iphone_simulator_application.html
I tired doing it, and you guys would'nt believe me, it worked :) ,
Solution was : "To set the user content and settings of the simulator to their factory state and remove the applications you have installed, choose iPhone Simulator > Reset Content and Settings"
Best of Luck to all.............. :)
This ends up being a product name issue:
The fix is to revert back to
${EXECUTABLE_NAME}
${PRODUCT_NAME}
for the executable file and com..${PRODUCT_NAME} in the info.plist.
Clean XCode, Quit, rese and quit simulator and you're good to go.
found some wierd log in /var/log/system.log.
May 8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: MobileInstallationLookup: Generating the install map
May 8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: load_application_info: Could not load signer identity from /Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29/new1.app/new1
May 8 16:17:50 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: error compiling query "SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;": no such table: _SqliteDatabaseProperties
May 8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May 8 16:17:51 th084134 SpringBoard[1170]: Couldn't activate <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated deactivate:
May 8 16:17:51 th084134 SpringBoard[1170]: Application <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated deactivate: exited abnormally with signal 256: Unknown signal: 256
May 8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Bug: launchd_core_logic.c:2812 (23714):103: sandbox_init(j->seatbelt_profile, j->seatbelt_flags, &seatbelt_err_buf) != -1
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Sandbox failed to init: Cannot apply builtin profile `/Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29.sb': Policy not found
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Exited with exit code: 1
May 8 16:17:51 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: 2009-05-08 16:17:51.026 SpringBoard[1170:10b] Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
Here is a discussion about how to run app in simulator via command line, hope it helps to understand how does xcode and simulator works.
But I didn't work it out.
Well, I "solved" it by install another distribution of hackintosh(IPC 10.5.6), works perfect!
In my case, I was adding a target to an existing app that had always worked. In my case, I had forgotten to select all the source code, xibs, frameworks, etc. and click their target checkbox. My clue was that the build happened instantaneously, which didn't make any sense. It never built anything. It just failed to install in the simulator. Once I included all the source files, etc., for the new target, then it built and installed fine.
I had the same problem, I fixed it by launching the simulator through another app and deleting the app I was trying to run on it. Then try to build and run and worked perfect.
Cheers
Matt
I had the same problem. I had accidentally added my info.plist file to my target and it was getting copied to the app bundle every time I built the application. So there were 2 .plist files in the bundle - mine and the Info.plist, created by XCode - which confused the simulator.
Simply delete the app from the simulator (and/or device if you're attempting to run on your device) via the UI of the simulator, then shut the simulator down and attempt to re-run the app. Doing the deletion of the actual files backing the simulator will also remove the app and do the same thing (but the deletion via the simulator's UI, if it works for you, is a little bit faster and easier).
Is your CPU Intel, and, of a model distributed in Apple hardware?
I doubt the Simulator will work reliably (if at all) on non-Intel CPUs and/or in VMWare. The simulator is very CPU specific in order to reflect the arm hardware of the iPhone.
The SDK ONLY supports Intel hardware from Apple.
There is a significant effort involved in creating the simulator and it's not easy or cheap (read, thousands of man hours) to support every CPU.
I fixed this problem by removing the "Icon already includes gloss and bevel effect" property from the Info.plist file in my project.
My problem centered around a Product Name the simulator simply wouldn't accept. Picking alternative names got me past the problem. Changing the name back to the original suspect choked the simulator every time.
Try moving the project to your local hard driver and opening it from there! That solved the issue for me (the project used to be stored on a samba share).
My fix:
restarted the Mac and it was fixed. (before that tried clearing caches, deleting caches from iPhone Simulator, cleaning, rebuilding, quitting OS, quitting Simulator, nothing worked.) Restarting the OS worked.
This was bugging me too but finally got it working.
Unfortunately, I can't reproduce what I did it but here's my list of actions for your information.
The project causing the problem was one I'd downloaded from Apple and tweaked.
Interestingly, I could still launch my own projects fine.
So, here's a list of actions that I did (note that none of the actions below worked just by itself):
- closing the simulator and doing "clear file history"
- restarting simulator
- rebooting
- restarting xcode
- resetting the iPhone with Reset Content and Settings
However, by the time I'd tried all of the above with a fresh version of the code I'd downloaded - it was working again. Just out of interest, I dragged the project that was causing this problem back to the desktop and it was OK now.
Wow, what a pain. I had to uninstall XCode 4 via the command line and then install XCode 3 again. Make sure that you restart after you reinstall. Working...
why anybody didn't tell about restarting simulator.
In my case,
Resetting the iPhone with Reset Content and Settings
and
**ReStart Simulator**
works well~
I had the exact same problem - I reset the iphone simulator and then quit the simulator then started it again.