Unable to launch iOS 14 app on device while connected to Xcode 12 - device

Having an issue running any app with Xcode 12 on a physical device (device running 14.0.1)
Starting with a new project, the simple Hello World app will not launch on my device while connected to Xcode.
The screen remains black with the white bottom home bar showing. Xcode shows app is running, no warnings, no errors.
struct ContentView: View {
var body: some View {
Text("Hello, world!").foregroundColor(.red)
.padding()
.onAppear {
print("Working....")
}
}
}
It works fine on the simulator, and thus prints out the debug text.
But, on my device, I do not get the debug text - so the launch process has failed.
However, if I stop the project on Xcode and then run the installed app on my device the app runs as expected!!
I changed the font color a couple of times, and it correctly installs the app to the device but fails to run when connected to Xcode, but works when running the app on the phone
I unpaired my device that didn't help.
No sure what to try next...
Thanks for any suggestions

I pass on this solution, which fixed this issue for me:
Go to Xcode -> Preferences -> Locations.
Tap the little arrow under the Derived Data section to open the Xcode directory in the Finder:
Quit Xcode.
In that folder, go to the folder "iOS DeviceSupport":
Delete all the folders within the "iOS DeviceSupport" folder.
Restart Xcode.
If you use wireless debugging you'll probably have to reconnect your device to your computer to re-establish the connection.
Build your project.
Of course, it probably helps to be on the latest Xcode (12.0.1 as of writing) for this.

Related

"No active iOS device found" when trying to access simulator logs

Somehow when I run npm run log:ios (react-native log-ios), I get the following error:
No active iOS device found
I have the simulator up and running with the app open.
Any idea why, or how can I start to investigate this issue?
PS: I recently installed Xcode 9.1-beta2 as I wanted to check something inherited from this upgrade. Not sure what role it would/could have played in this case.
The issue with react-native log-ios has not been resolved yet due to some other priorities. There is a simple workaround using Console.app. To open Console.app: ⌘ + space > type console, press enter.
Simulator log can also be seen under Debug > Open System Log
Edit: If you want to see console.log for debugging in iOS Simulator
Open Safari, Go preferences -> advanced -> Show Develop menu in the menu bar. Once done, build and run in Xcode and then in safari go Develop -> iPhone Simulator -> Your App Name.

Error running playground. Unable to find suitable target device

I downloaded the Swift languages's GuidedTour.playground.zip file from
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html
Unzip it as GuidedTour.playground,
open it in Xcode 6.1.1, then the error message:
Error running playground.
Unable to find suitable target device.
I click OK button to close the error message window,
get back to the playground with the title "A Swift Tour". There is no output for any of the embedded code there. And every time I try to edit any of the code, the error message will pop up again and again.
Some people on the web had the same problem and solved it by adding some devices under the menu Window -> Devices -> SIMULATORS. I did it, but the error keeps showing.
If I click File -> New -> Playground to create a testing playground, this error message will not appear, and the testing code will run.
A week ago, I had replaced the HDD in my Early 2008 iMac with a SSD (solid state disk), recovered the whole system to the SSD from my Time Machine backup. Everything looks good until I found out that Xcode begins to refuse to run the tutorial "A Swift Tour". Before the SSD replacement, Xcode would run it. This might be related?
Thanks a lot for Raptor's kind response. I have solved this problem. I found out that I just added not enough simulators so that Xcode was unable to find suitable target device. After I added all the 10 simulators for iOS 8.1, the error is gone and the output appears.
At first, it seems that I will have to add all of them to make it work. Then after quite a few experiments by removing and adding some back and forth and restarting xcode, I cannot make sure exactly how many simulators are needed. Maybe 3 or 4.
playgrounds will run fine, assuming at least one of the following simulators are configured: iPhone 6, iPhone 6+, iPad Air, resizable iPhone, or resizable iPad.
Delete the contents of ~/Library/Developer/XCPGDevices (typically it contains a directory with a name which is the UDID of the simulated device)
At Xcode 7:
Step 1: Window > Devices > bottom left corner plus icon > add iPad Air or iPad Air 2.
Step 2: Quit and restart Xcode.
I am using Xcode Version 6.0.1. I reboot Mac (only restart Xcode didn't help) and this issue is resolved.
Hope this helps.

iOS Simulator freezes, but only on one profile

I ran into this when I tried to deploy my app to the iOS simulator earlier today - the debugger never connected, and the iOS simulator crashed. Now I can't get the simulator to do anything.
When I first launch the simulator I get a black screen (no tiles from the dashboard), and pressing the home button makes it freeze. If I access the menus at the top of the screen in OSX, that works until I press the home button, then it freezes.
Things I've tried:
Creating a new project in Xamarin Studio and running that
Creating a new project in Xcode and running that
Opening up the Xcode package contents and running the simulator .app from there
Clearing the simulator's Content and Settings.
Reinstalling Xcode fresh (5.0.2)
Pressing the home button (or whatever it's called) on the simulator
I created a new profile on OSX and running the simulator from there, and it froze for a good 20 seconds, then all of a sudden I saw the tiles appear for the home page. I then switched back to my original OSX profile, still didn't work.
The problem seems to be something with my profile, but I have no idea what to look at next. Any thoughts?
GOT IT! The problem was a file located in /Library/Application Support/iPhone Simulator/
the iPhoneSimulator folder was missing - or it looked like it was a link to a missing folder. I deleted it, ran the simulator, and it was fixed.

When Running App in Simulator Xcode Gets Pushed to a Background Window

Whenever I build and run just this one particular app in XCode, the UI window of XCode gets pushed back underneath all existing running windows on OSX ( behind the browser and textedit etc...). This means I can't see the Xcode console debug outputs while playing with the app in the simulator. I feel like this could just be a quick setting in xcode or osx but I'm not sure why and how to fix this.
Use Spaces and develop with Xcode in its own virtual window. You will have just Xcode and Simulator wrestling for screen space then.
I normally have at least 5 windows open in Spaces:
Mail and Skype.
Web Browser
Xcode
Terminal/Finder/Odds and sods
Spare
Use Ctrl+Left and Ctrl+Right to switch windows.

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