Xamarin iPhone deploy with Xcode won't show it connected - xcode

My iPhone is connected to the mac (Can be seen under System Information>USB>iPhone) but Xcode does not let me use the iPhone and it says at the app scheme "No devices connected to My Mac."
I will be really happy if someone will be able to help me with it, it's my Matriculation Project🙏.

Close Xcode -> In a terminal window enter sudo pkill usbmuxd -> Restart Xcode.
If the first method cannot be solved, try to check the development target setting of Xcode.

I managed to fix this problem by reinstalling mac and Xcode.

Related

Message from debugger: unable to attach error for osx app

I have been building mac app on my mac mini and it always worked well but today i faced this error, searched a lot but no luck.
Message from debugger: unable to attach
What i tried:
Clear derived data
Quit Xcode
Restart machine
installation directory set to blank and also to /Applications
Tried Skip Install No / Yes
Using developer Signing certs
M using only Developer certificates and not provisioning profile to sign my cocoa app
Xcode 8.2
OSX 10.12.1
Please help :)
This is what fixed it for me, perhaps it will help others but I do realize the question was for 8.2. I had it set to Xcode 9 "New Build System" disabling this and switching to "Standard Build System" in the Project Settings under the File Menu. I had tried all the other things like killing DerivedData, clean build, restarting Xcode. I also verified that my dependent libraries were set correctly. The only thing that worked was disabling new "New Build System"
I just had this problem today. I have little demo code in a mac project(created with Xcode 9.4). This error just started to occur after I upgraded system to macOS Mojave 10.14. However, in Xcode 10 this project runs no problem(without changing anything). If you can use Xcode 10 it will probably be fixed.
Unfortunately, the above solutions didn't work for me (although I am sure they work for some people).
Here is what worked for me, in case this helps anyone else:
Close Xcode
Open Xcode and Create a new Xcode project
In the iOS template, select Single View App then click Next
yes, I know you are trying to get a macOS app attaching to the debugger :).
Give the iOS app any product name and organization identifier you would like and click Next
Create the new project anywhere you would like (I saved it to my desktop)
Build and run (cmd + r) the iOS app on a simulator like the iPhone 8 (starting a simulator and running the iOS app will take a little time, so have patients)
After the iOS app runs in the simulator, click to stop it from running (the stop button is next to the run button)
Open your macOS app that you are having trouble connecting a debugger to, and build and run it (cmd + r)
This, for some reason, allowed me to connect to the debugger with my macOS app...
Xcode version: 10.1, macOS Mojave version: 10.14.2

Xcode Project won't run on iOS Device

Xcode gives me this message every-time I try running my app on my iPhone. (Works fine on the simulator.) (And this occurs in every project I have.) (I also just downloaded Xcode again.)
This is the message I get.
App Installation Failed.
Unknown Error Occurred.
How do I fix this error?
Unplugging iOS Device and plugging it back it in fixed it for me.
Alright, it was a simple fix:
Go into Xcode Preferences -> Accounts -> More Info. Hit the refresh icon.
Clean your project. Project -> Clean.
Force quit Xcode.
Reboot Mac and Device.
If you have the same App but downloaded from AppStore, I suggest to remove the App manually from your device, then try to run the new version with XCode.
After following the suggestions in this thread (restarting iPhone, cleaning Xcode project, quitting and re-launching Xcode) and others (setting Team to None then back to my Team) and unplugging and replugging Lightning connector from my iPhone 6 I was still experiencing this problem. Xcode would even display an error that my iPhone 6 was locked, even though it was not.
I was able to fix it by unplugging the USB-A connector of the USB to Lightning cable from my MacBook Pro, then plugging it back in. I'm not sure why that made the difference, but glad that it did resolve this annoying problem.
I have this issue regularly. There are a number of techniques that help me overcome it, including the classic "turn it off and back on again."
One thing that isn't mentioned here is that the iPhone should be switched on, unlocked, connected to the mac and then the app should be run (with the iPhone unlocked). Don't lock it!
Make sure your device name doesn't have any emoji (Xcode 11.0)
if you using vpn services, then you need to turn off vpn. Works for me

Xcode 5 IOS simulator black screen and app install fails

I just updated my xcode to work with ios7. Now whenever I make a new app, even if its set to build for ios7, I get an error in the simulator when running. It says that the install failed, even if I just made the project and haven't coded anything into it yet. The simulator also shows a black screen. I have tried the reset content, and it didn't work. I saw something somewhere saying to delete the Iphone Simulator folder in application support, but no such folder seems to exist. What can I try to do?
Update--
With some additional research, I found that Iphone Simultor is in the Xcode.app now, but I don't know what to delete. There are many files under the iPhone Simulator Folder. If I delete the actual app, it just doesnt open. Any ideas?? I dont even get an iphone on the screen, just a black window...
Update 2:
Even when I just go to open developer tools -> iphone simulator
it still gives me just a black screen....
Update 3
I just re-installed X-code, and all works now! Strange....I have no idea what happened...But I thought I would let y'all know for others who have similar issues.
Deleting the iOS Simulator folder of the iOS version in question in
/Users/xxx/Library/Application Support/iPhone Simulator
helps, but then you always have to repeat all the settings you made in the simulator (language, for example). Try to press the home button and then delete your app like you do it on a real iOS device. You should then be able to install it again.
This seems to be a known issue.
When simulator open - Go to iOS simulator tab -> reset content and settings..
Work for me.
Perhaps this answer will help?
The simulator should be in this folder:
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app
Make sure any #try and #catch(NSException *exception) {} blocks are not commented or are working properly.
This is a version mismatch between your OS X version and your Xcode (iOS simulator)
and it seems that you have upgraded your OS X so Xcode needs to be upgraded as well, Check the versions that match with each other.
You need to upgrade your Xcode which will upgrade iOS simulator.
Good Luck,

Xcode not detecting my device

I upgraded my iPad device OS version recently to 5.1.1 (9B206). From that my Xcode is not detecting my device. Am just getting iOS Device and simulator options in my Xcode. But am getting my device in older version of Xcode and iTunes. For this i updated my MAC OS version to 10.7.4 and Xcode version to 4.3.3. But still am facing the same problem. Now how to make my Xcode to detect my device?
This Worked for me.
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!
Open the Organizer in Xcode, go to devices, find your device and click the option to use for development
I just plugged into another USB port and it detected by device.
In another case, check the "iOS Deployment Target" in "Build Settings",
if the target iOS version number is great than the version of device,
then the device will not show in the list.
Say that, the "iOS Deployment Target" == 7.0, and the version of device is 6.0,
to solve the problem by change the "iOS Deployment Target" to 6.0 or lower.
If the chosen answer still does not work for you try this:
Select the project in project explorer
Select the target on the main window
Select Build Settings
Select Deployment
Select iOS Deployment Target. Change it to the version of your device. (e.g. iOS 5.1)
I was also faced the same issue in Xcode, my device was not detected after update the Xcode latest version(7.3.1)
Done so many things what suggested in the web-search but still the device was not detected.
Finally, I just quit and open the Xcode my device was detected(oh my bad).
This SO answer solved it for me https://stackoverflow.com/a/56054170/5813473 .
sudo killall -STOP -c usbd
did the magic.
Well later I had to unplug/plug in again at occasions, but that 'killall' really solved the original issue.
Most recently, Xcode 8.3 and iOS 10.3 seems to have more security around Xcode accessing the iPad/iPhone. My sequence:
Rebooted the machine,
Attached the iPad,
Gone through a "trust this computer" security cycle on both iMac and iPad
Xcode can now see the device
Sometimes restarting Xcode helps. Give it a shot.
In my case, restarting Mac worked and no other solution.
I updated my iPad (it's in Settings -> General -> Software Update, near the top) and restarted my computer and Xcode sees it now.
FWIW I tried all the tips in this thread and nothing would work: from reboots, command line statements, unplugging, different USBC ports, etc. I also tried something not mentioned here (yet) by going to "Settings > General > Reset > Reset Location & Privacy" ... however even this didn't work.
Later on in the evening I was in a different room of the house and out of nowhere I got the "Trust This Computer" prompt on my iPad. I of course tapped "Trust" or whatever and then magically my Mac laptop finally sees my iPad.
I realize I'm not really giving a helpful tip/fix here - just sharing how things went for me in case anyone finds useful.
iPad: iOS 13.4.1 | Macbook laptop: OSX 12.3.1
Recently (2022) I've noticed that the iPad prompt to "Trust this Computer" won't appear unless using an Apple USB-C cable. Apple reps assure me they aren't doing any funny business here, but I have tried every cable I can find, including several thunderbolt 3 and 4 cables and Anker cables. Worth trying an Apple cable if still having problems.
Just simple, close the project on your XCode. Just right-click on the XCode in the taskbar and give a quit option. After open the XCode from the directory, it will detect your device. It also work on Xcode version 11.2.1
close your project or XCode.
Give Right click on the Xcode in MAC tabbar and give the Quit option.
Reopen the project from your finder(project place).
The device will be automatically detected.
Open the Windows in Xcode, go to devices. If Device is visible in Left side, Right click and select "Show in Destination Menu".
Enjoy..

Xcode Doesn't Recognize My Device After OS Upgrade

This has to be a simple configuration issue, but I don't know my way around the build settings very well.
I upgraded my iPad from 4.3 to 5.0. I am using Xcode 4.2. When I plug my device in, it is not showing up on run button, and I have a message that it can't run using the selected device.
What do I have to do?
Open Xcode, go to Window -> Organizer and find your device. Click the "Use for Development" button to get Xcode to recognise it again.
go to your iphone device, settings->Reset->Reset All Settings. Close Xcode, restart XCode, device should be in the list now.
Restarting USB process worked for me.
Run sudo pkill usbmuxd on terminal
or
Open Activity Monitor and select Disk by tapping from segment control and search usbmuxd, select the same and force quite/quite.
Note: before doing above stuff, remove device and quite Xcode.

Resources