Could not run build/ios/iphoneos/Runner.app on Try launching Xcode and selecting "Product > Run" to fix the problem - ios

When running an iOS App on a real iPhone (not Simulator) you may run into this problem.
The reason is because the app isn't signed by a trusted source.

To fix this you have to Open Settings on your iPhone and navigate to: General -> Device Management, then select your Developer App certificate and "trust" it.
Update: it may now be called General -> VPN & Device Management

Same issue happened with me.
Device : iPhone XR and iOS version: 15.4
Open Settings > Developer
Click on Clear trusted computer
Then click on trust this computer

Same issue here, I only solved it after uninstalling the app and run it again.

Go to your device Settings
Go to General
At the bottom you may find Transfer or Reset iPhone option,
select that. (Be careful selecting anything here)
Now choose Reset option and select Reset Location & Privacy.
(Enter your pin to confirm. After few second it will prompt the trust
this computer option.)
In Shortcut you can go Settings>General>Transfer or Reset iPhone>Reset>Reset Location & Privacy or directly search for Reset then choose Reset Location & Privacy
Now you will find the previous trusted app in Device Management. Please remove if you have same. Now re-run

The following steps worked for me:
open the xcode
select your device
run build (sure you have signed your team first)
trust for this developer

Xcode was configured with an ad hoc profile instead of a dev profile, changing that fixed it.

On iPhone 7 going to Settings and clearing trusted computers with further build clean did the trick for me

I ran into this issue when I had a very low wifi connection. The low connection would cause this issue intermittently. Fixing the wifi connection fixed this issue for me.
(In my case, I needed to reset my wifi settings on my iPhone).

I had this issue when I tried to install a different version of the same app (store and dev). All I needed to do was to fully uninstall all versions of the app from the target iPhone. Might not work in every case, but easy to try.

Related

Trust device not possible because "General -> Device Manager" is missing

I wanted to reset some variables that were being saved on my game, and after deleting my game and re-installing it, asked me for the "this device isn't trusted. Go to General -> Device Manager" to solve it" again. But for some reason, it isn't available anymore. I tried rebooting my iPhone, restarting XCode, and nothing works. Every time I go to Settings -> General I have the same settings over and over again.
Can anyone help me? How come was this working before, the option was being shown in Settings, and now it doesn't?
Extra Info: I'm using iOS 9.3.3 Model: MKRJ2LL/A iPhone 6S
Thanks in advance, this is so frustrating!
Check your Internet (your iphone)
Hope it help
I managed to make it work. After a few more hours, ended up being the provision profiles under XCode being in conflict for my device, I even had duplicated ones. And I also downloaded the iOS Developer and iOS Distributor certificates from iTunes Connect and added them.

Increase timeout when launching iOS app on device from Xcode [duplicate]

I am trying to launch my app on device. It is launching successfully on the simulator.
List item
I use 7.1 SDK
Xcode 5
And the device is a 7.1 iPhone 4S
I have tried:
Clean
Clean Build Folder
Deleting app
Disconnecting/Reconnecting device
Booting device
restarting Xcode
What can I do to make it work?
Could it be something with Code Signing?
Currently i have it set to 'Dont Code Sign'
I had this problem when I used a Distribution certificate instead of Developer one when running the app from Xcode. You may check it out your target --> Build Settings --> Code signing.
As #AndyDynn pointed out in his comment:
Make sure you do this on the "Target" build settings and not just the "Project" build settings.
I literally restarted my iPad, that was connected for testing the app, and that resolved the issue.
To run your app on a device, you will perform these tasks that follow:
Request a development certificate.
Add your device to the portal.
Code sign your app.
Launch your app on the device.
For more detail check this
If your provisioning profile and code sign everything is alright then try once Quit and Restart your XCode. It will work for me.
I just had this issue.
I had to open the app on device and tap Trust Computer.
No need for me to reboot everything 20 times, yay.
Below are 2 awesome hacks that have not been mentioned yet:
HACK #1:
Lock your phone, press XCode start, wait till XCode says "unlock your device to launch", then unlock your phone, it will be launched successfully, works every time.
HACK #2:
If your goal is just to debug the app, here is another simple and straight-forward approach:
After the app is deployed, launch it manually.
Goto XCode -> Debug -> Attach to Process ... to choose your app from the list, then debug properly.
This works well for me, and it saves lots of time.
I hope this helps, thanks!
I got the same problem and after looking at the answers here I found mine. The issue at hand was: my dev distribution certificate was gone from iOS Dev Center, so I just assume it had timed out. I didn't get a nice warning though, just the above error - installing worked but debugging didn't. So I had Xcode regenerate a new one for me.
One more thing to try if you've tried the above:
i found this link about quitting itunes to avoid the timeout. This works for me with xcode 5.1
In my case there was no value at Targets -> Build Settins ->Provisioning Profile. Though Code Signing looked ok)
I cleaned out my provisional profiles, rebooted the iPhone, rebooted the computer, and it worked for me.
Just to throw out an additional suggestion to anyone coming across this problem (it's been burning me frequently lately) -- try going to the Targets -> (Your Target) -> General -> Team and re-selecting the same Team, which forces Xcode to update profiles for you.
That has been the culprit for me a couple of times. Seems to happen specifically if you've recently re-downloaded a distribution certificate for new devices or w/e. Or if you've just dumped your Provisioning Profiles directory in general.
I had the same problem and I tried all the suggested steps but I managed to get it deployed and run only after I powered off my iphone.
Checked my Targets and code signing details, didn't help. I did three things:
Clean Build Folder
Close Xcode and delete everything in Derived Data
Rebooted my device
Everything worked fine after that. I had changed some App Transport Security setting in my info.plist right before this occurred. Not sure if it is related or if only one of my 3 steps were necessary, but it worked.
Make sure the Provisioning Profile setting in your environment is set to your development profile: Project > Build Settings > Code Signing
Consider setting it in your Target settings and the Pod project (in case using Cocoa Pods).
In case the development profile is not present create or download it:
Certificates, Identifiers & Profiles > Provisioning Profiles
After following the above, it still didn't work (from xCode 6). But after rebooting the phone and deleting the app, it worked.
Check Product Name for dots "."
"." are not allowed in Product name.
Selection in provisioning profiles may cause this problem. So while launching an app on to the device, make sure you are using the development profile & not the distribution profile. I have been facing the same issue. But got away with it using the same process.
Check for Project > Build Settings > Provisioning profile & select your development profile.
And also take care of Code Signing Identity in the same tab. Make sure you choose both the identities of Developer & NOT of Distribution.
Below two steps solved for me:
For xcode version: 7.2
1.Select any of your simulator to run ( just start your run, no need to load the app completely).
2.Stop it.
3.Then select your device and run.
This solved in my case.
option + command + shift + k and then run the project did the trick for me.
If your goal is to just launch the app and debug it, you can also edit the schema to "Wait for executable to be launched" and run the app manually.
The setting is under Edit schema > Run > Info > Launch. Choose "Wait for executable to be launched" instead of "Automatically". It will wait for you to run the app (by manually tapping it) instead of timing out.
As all of the above answers didn't helped for me I'll publish my solution:
Deleting all the occurrences of xcuserdata folders in .xcodeproj and .xcworkspace and restarting Xcode fixed the problem. To delete it right click your_app_name.xcodeproj and/or your_app_name.xcworkspace in your app folder and select "Show Package Contents". I hope that help someone to save some time.
Just restart my Device and works everything fine
I tried:
Restart the device (iPhone)
Clean build the XCode project
Then it works.
Check whether the device memory is full.

Xcode 6 process launch failed: timed out trying to launch app

I can't debug my app because when I run it, Xcode gives me the error:
Process launch failed: timed out trying to launch app
In the device I see a black screen and after the error message the app starts.
How can I fix this?
I tried to change the code signing identity and the provisioning profile, and to refresh the provisioning profiles in the Xcode > Preferences > Accounts > Details tab.
I'm using Xcode Version 6.0.1 (6A317) with an iPad mini, running iOS 8.0 and a MacBook with OSX 10.9.4.
After this, if the iPad goes into sleep mode (the screen turns off) I can't wake it anymore; I have to do a soft reset.
You are using distribution provisioning profile rather than development profile. check this link
How to Fix:
I fix it with:
clean project (Product > Clean)
hard reset device (power button + home button)
delete app from device
close xcode
CLOSE ITUNES (itunes must be closed)
re-open Xcode and run!
I think that iTunes was the problem.
EDIT: 2017/02: Solution still Woks (Thanks to #SalGad for information).
I am using Xcode 6.2, running on iPhone 4 with iOS 7.1.2, the problems happen to me as well.
It turned out that the Project and Targets' Code Signing settings are different from each other! And that's what is causing the issue.
To solve the issue, you must make sure that their Code Signing settings is the same.
One more thing that may be a reason to launch timeout arising is that you have a lot of Provision Profiles on your device. I have about 100 of them, downloaded automatically by XCode from our team dev portal. So if your team have tons of apps and Provision Profiles, you better unlink your XCode from your Apple ID, to prevent automatic downloading for unwanted PPs. It significantly decreases app launching time.
To delete unwanted PPs from your device you have to go XCode - Window - Devices, select your device and click "Show provision profiles..." on the bottom context menu. Then you have to manually remove the profiles. Tip: use key sequences "down arrow" - "backspace", to ease the hand routine.
I had this but nothing previously posted seemed to work. This is what I did to fix the issue in Xcode 6.3.2:
Go to Product->Scheme->Edit Scheme...
Select the Run Scheme
Select the Info tab
Make sure the settings are as follows:
Build Configuration is set to "Debug"
Debug Executable is checked
Launch Automatically is checked
In my case I was using the development profile, but somehow, in Build Settings > Code Signing, the Provisioning Profile for Debug was empty.
But before setting it to "iOS Team Provisioning Profile", I had to reset my account since it said " is Not on Any Development teams"
- Xcode > Preferences > Accounts
- Remove my account (click "-")
- Add the account again
That fixed the problem
Note that if the app still manages to start on the device after Xcode displays this error, you can attach to the running process with Debug->Attach to Process.
This warning is shown when you try to run and debug your code directly in device but you are using distribution profile in your Build Settings.
To directly run the code in device and debug, you need to use development profile in your Build Settings of Xcode.
After setting the development profile, just reboot your device clean your Xcode project and run again.
I hope this helps !!
An app should return from his initialisation procedure in less then 10 seconds, or it will be killed by the OS. This is probably because you are doing too many things in the startup phase.
Try to refactor your code to do it diffrently, by doing lazy initialisation, and only initialize what is really important before showing the first view.
It's hard to give better advice before knowing more about the app itself
I have faced this issue with Xcode 6.2 and Iphone 5s with iOS version 8.3.
I get this message when I deploy the application to the device for the first time.
The work around I found was that with out unintalling the application from the device,redeploy the application from Xcode.It should run perfectly this time.
I observed this only on Xcode 6.2 not on Xcode 6.3 so this might be an Xcode to iOS version compatibility issue.
Big and weird tip for this problem... this was happening to me and none of the advice helped anywhere on the web, but then i noticed if i deleted everything out of the main ViewDidLoad method it would work. I realized there was one line of code that was messing it up. It was a line that was referencing to an array of strings that was way to big. I had something like this NSString *mystring[100][1000][100]; i accidentally added some zeros and for whatever reason this problem produced the same error message that the incorrect signing gives you. So don't let your arrays or matrixes get too out of hand!
Method #1:
Lock your phone, press XCode start, wait till XCode says "unlock your device to launch", then unlock your phone, it will be launched successfully, works every time.
Method #2:
If your goal is just to debug the app, here is another simple and straight-forward approach:
After the app is deployed, launch it manually.
Goto XCode -> Debug -> Attach to Process ... to choose your app from the list, then debug properly.
This works well for me, and it saves lots of time.
I hope this helps, thanks!

Xcode process launch failed: Security

I have been developing an app for 1 or 2 weeks now and just yesterday I have updated my iPhone 5S to the iOS 8 GM. Everything worked fine and I could test on my device as well until I deleted the app from my phone and wanted to build again. The following error appeared:
Could not launch "My App"
process launch failed: Security
When I test with the simulator it works fine.
Is this because of the iOS 8 GM update and how can I fix this launch problem?
I want to be able to test on my iPhone and in the simulator.
If you get this, the app has installed on your device. You have to tap the icon. It will ask you if you really want to run it. Say “yes” and then Build & Run again.
As from iOS 9, it is required to go to Settings → General → Device Management → Developer App → Trust`.
On some versions of iOS, you will have to go to Settings → General → Profile instead.
Updated answer for Xcode 7: Tapping the app no longer works (as of beta 1 it just displays an "untrusted enterprise developer" message with only a Dismiss button).
To fix, open the Settings app, go to General / Profiles, and you'll see your profile. Mark it trusted and things should start working normally again.
Updated For iOS 9.2.1 and Xcode 7.2.1:
Goto: Settings > General > Device Management > Select App from Developer Apps > Trust App.
Hey so the accepted answer works, except if you need to debug the initial launch of the app. However I think that answer is more of a work around, and not an actual solution. From my understanding this message occurs when you have some weirdness in your provisioning profile / cert setup so make extra sure everything is in tip-top shape in that dept. before ramming your head against the wall repeatedly.
What worked for me was as follows from the apple docs:
Provisioning Profiles Known Issue If you have upgraded to the GM seed
from other betas you may see your apps crashing due to provisioning
profile issues.
Workaround:
Connect the device via USB to your Mac
Launch Xcode Choose Window ->Devices
Right click on the device in left column, choose "Show
Provisioning Profiles"
Click on the provisioning profile in question
Press the "-" button Continue to removing all affected profiles.
Re-install the app
Make sure you right click on the image of the device not the name of the device or you won't see the provisioning profiles option. I restored my new phone from an old backup and there was a lot of cruft hanging around, i also had 2 different dev. certs active (not sure why) but i deleted one, made a new profile got rid of all the profiles on device and it worked.
Update for iOS9.2.1 and Xcode 7.2.1
If you get this error when building to a device in Xcode:
On your device, tap the app icon that would have just been added from your attempt at building the app and you should see this:
Next, on your device, go to Settings --> General --> Device Management, and you will see this page:
Select the profile you are using with Xcode, and you should see this page:
Click Trust "username#email.com" then click Trust on the next popup.
Go back to Xcode and re-run your project and it should build the app to your device.
To get around the process launch failed: Security issue and immediately launch the app on your device, tap the app icon on your iOS device after running the app via Xcode.
This will allow you to immediately run the app. It may not actually "fix" the root issue that is causing these permission alerts.
Be sure to tap the app icon while the Xcode alert is still shown. Otherwise the app will not run. I continually forget this vital step and am unable to run the app on my device. Thus I am documenting it here for myself and everyone else :)
Run the app via Xcode. You will see the security alert below. Do not press OK.
On your iOS device, tap the newly installed app icon:
After tapping the icon, you should now see an alert asking you to "Trust" the Untrusted App Developer. After doing so the app will immediately run, unconnected to the Xcode debugger.
If you do not see this "Trust" alert, you likely pressed "OK" in Xcode too soon. Do not press "OK" on the Xcode alert until after trusting the developer.
Finally, go back and press "OK" on the Xcode alert. You will have to re-run the app to connect the running app on your iOS device to the Xcode debugger.
Go to SETTINGS -> GENERAL -> Profiles & Device Management
and choose the developer profile, then push Trust.
if you do not have Profiles & Device Management menu, you have to enroll your device on beta.apple.com and download the profile from Safari.
Install the profile
Restart your device
Tap on the developer profile and trust.
You are all set.
I have the same issue. I click ok in xcode and when launching the app on my iPhone I'm asked if I want to trust this application. Doing it, the app runs and further build-and-run from xcode went without any issue until deleting the app from the iPhone and reinstalling it. Then goto first line ;-)
Alternatively if one does not see "Untrust App Developer" dialog:
Go to your iPhone > Settings > General > Profile > "you#email.com" > Trust
In iOS 9.2 they renamed the 'Profiles' to 'Device Management'
This is how you should do it now:
Settings -> General -> Device Management
Verify the app
Ok, this seems late and I was testing the app with the Internet connection off to test my app for some functionality. As I turned off the Internet, it gave me such an error. After I turned on the Internet, I could install it again. I know this is silly but this might be helpful to someone.
I had this issue before on Xcode 7. Then I realized it's all about my Internet connection: it was down, and the security check was using the
Internet to make sure your developer account is correct. And when it saw no Internet it gave this error … after I have fixed my Internet, it works well.
Xcode is able to build and install the app, but isn't able to launch it the first time. You just need to tap on the app's icon on the phone, then you will be prompted to ask if you want to trust the developer. Allow it and the app will launch, then Xcode will be able to automatically install & launch this and your other apps.
"If you get this, the app has installed on your device. You have to tap the icon. It will ask you if you really want to run it. Say “yes” and then Build & Run again."
To add to that, this only holds true the moment you get the error, if you click OK, then tap on the app. It will do nothing. Scratched my head on that for 30 odd minutes, searching for alternative ways to address the problem.
BTW, this also happens if you change the team of your target in Xcode and rebuild. Was quite puzzled to see that problem with an app that I had run on the device before. Took me a while to figure out…
Might only happen the first time building to a device with a team, though.

Could not launch process launch failed: timed out waiting for app to launch

I am trying to launch my app on device. It is launching successfully on the simulator.
List item
I use 7.1 SDK
Xcode 5
And the device is a 7.1 iPhone 4S
I have tried:
Clean
Clean Build Folder
Deleting app
Disconnecting/Reconnecting device
Booting device
restarting Xcode
What can I do to make it work?
Could it be something with Code Signing?
Currently i have it set to 'Dont Code Sign'
I had this problem when I used a Distribution certificate instead of Developer one when running the app from Xcode. You may check it out your target --> Build Settings --> Code signing.
As #AndyDynn pointed out in his comment:
Make sure you do this on the "Target" build settings and not just the "Project" build settings.
I literally restarted my iPad, that was connected for testing the app, and that resolved the issue.
To run your app on a device, you will perform these tasks that follow:
Request a development certificate.
Add your device to the portal.
Code sign your app.
Launch your app on the device.
For more detail check this
If your provisioning profile and code sign everything is alright then try once Quit and Restart your XCode. It will work for me.
I just had this issue.
I had to open the app on device and tap Trust Computer.
No need for me to reboot everything 20 times, yay.
Below are 2 awesome hacks that have not been mentioned yet:
HACK #1:
Lock your phone, press XCode start, wait till XCode says "unlock your device to launch", then unlock your phone, it will be launched successfully, works every time.
HACK #2:
If your goal is just to debug the app, here is another simple and straight-forward approach:
After the app is deployed, launch it manually.
Goto XCode -> Debug -> Attach to Process ... to choose your app from the list, then debug properly.
This works well for me, and it saves lots of time.
I hope this helps, thanks!
I got the same problem and after looking at the answers here I found mine. The issue at hand was: my dev distribution certificate was gone from iOS Dev Center, so I just assume it had timed out. I didn't get a nice warning though, just the above error - installing worked but debugging didn't. So I had Xcode regenerate a new one for me.
One more thing to try if you've tried the above:
i found this link about quitting itunes to avoid the timeout. This works for me with xcode 5.1
In my case there was no value at Targets -> Build Settins ->Provisioning Profile. Though Code Signing looked ok)
I cleaned out my provisional profiles, rebooted the iPhone, rebooted the computer, and it worked for me.
Just to throw out an additional suggestion to anyone coming across this problem (it's been burning me frequently lately) -- try going to the Targets -> (Your Target) -> General -> Team and re-selecting the same Team, which forces Xcode to update profiles for you.
That has been the culprit for me a couple of times. Seems to happen specifically if you've recently re-downloaded a distribution certificate for new devices or w/e. Or if you've just dumped your Provisioning Profiles directory in general.
I had the same problem and I tried all the suggested steps but I managed to get it deployed and run only after I powered off my iphone.
Checked my Targets and code signing details, didn't help. I did three things:
Clean Build Folder
Close Xcode and delete everything in Derived Data
Rebooted my device
Everything worked fine after that. I had changed some App Transport Security setting in my info.plist right before this occurred. Not sure if it is related or if only one of my 3 steps were necessary, but it worked.
Make sure the Provisioning Profile setting in your environment is set to your development profile: Project > Build Settings > Code Signing
Consider setting it in your Target settings and the Pod project (in case using Cocoa Pods).
In case the development profile is not present create or download it:
Certificates, Identifiers & Profiles > Provisioning Profiles
After following the above, it still didn't work (from xCode 6). But after rebooting the phone and deleting the app, it worked.
Check Product Name for dots "."
"." are not allowed in Product name.
Selection in provisioning profiles may cause this problem. So while launching an app on to the device, make sure you are using the development profile & not the distribution profile. I have been facing the same issue. But got away with it using the same process.
Check for Project > Build Settings > Provisioning profile & select your development profile.
And also take care of Code Signing Identity in the same tab. Make sure you choose both the identities of Developer & NOT of Distribution.
Below two steps solved for me:
For xcode version: 7.2
1.Select any of your simulator to run ( just start your run, no need to load the app completely).
2.Stop it.
3.Then select your device and run.
This solved in my case.
option + command + shift + k and then run the project did the trick for me.
If your goal is to just launch the app and debug it, you can also edit the schema to "Wait for executable to be launched" and run the app manually.
The setting is under Edit schema > Run > Info > Launch. Choose "Wait for executable to be launched" instead of "Automatically". It will wait for you to run the app (by manually tapping it) instead of timing out.
As all of the above answers didn't helped for me I'll publish my solution:
Deleting all the occurrences of xcuserdata folders in .xcodeproj and .xcworkspace and restarting Xcode fixed the problem. To delete it right click your_app_name.xcodeproj and/or your_app_name.xcworkspace in your app folder and select "Show Package Contents". I hope that help someone to save some time.
Just restart my Device and works everything fine
I tried:
Restart the device (iPhone)
Clean build the XCode project
Then it works.
Check whether the device memory is full.

Resources