xcode 8.3 Could not launch application process launch failed: unspecified - xcode8

I have new installed Xcode 8.3 with iOS 10.3.
My application ran on iOS as expected and suddenly Xcode fails to run application on device with error:
Could not launch "My app" process launch failed: unspecified
It runs on Simulators and on other device mini-pad (10.2)

I also have this problem when run in iOS 10.3.1 with xcode 8.3.2
Restart device, It will work well

I tried plugging out-in the cable of iOS - doesn't help
I restarted iOS device and Xcode - everything works as expected
(hope it will help to someone)

Plugged out the device cable.
delete App.
restart device.
Delete Xcode Derive Data
Quit and launch Xcode again.
Build and run successfully.

I had similar issue. Tried below steps :
Quit Xcode (cmd + Q)
Clean project (cmd + shift +k)
Delete Derived data (cmd + comma)
But these didn’t worked. Instead restarting device worked!

Related

“launchPackager.command” can’t be opened

Just updated my Mac to the official release of Ventura, and I cannot launch my application via react-native run-ios.
Expected behavior:
running react-native run-ios will launch an Xcode simulator and a terminal window with Metro running.
Current behavior:
Xcode simulator opens, main terminal says app was built successfully, but an error is thrown instead of the metro terminal opening:
“launchPackager.command” can’t be opened because (null) is not allowed to open documents in Terminal.
The simulator just shows a white screen and can't be interacted with.
What I've tried:
manually opening node_modules/react-native/scripts/launchPackager.command
opens Metro terminal but is not connected to the app
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading app...
giving Terminal full disk access (no change)
This happened to me after upgrading to macOS Ventura. I happen to use iTerm as my main terminal, not the built-in Terminal.app so the following fix only applies to that scenario:
Set iTerm as the Default Handler for *.command Files
Open node_modules/react-native/scripts/ in Finder (open node_modules/react-native/scripts/)
Right-Click on launchPackager.command and click Open With then choose Other...
In your Applications directory, select iTerm and click Always Open With
After this, you might need to run npm run ios again from this terminal window. However, from now on, Metro will open in a new iTerm tab instead of trying to open the command in a new Terminal window.
For me, this was the desired behaviour and it removed this warning.
Note In future, any *.command files will now open with iTerm instead of Terminal.
I encountered the same problem as you, I installed another terminal (iTerm2), then randomly found a .command file, and in the display introduction, changed the default opening method to iTerm2enter image description here
I'm having this issue after upgrading my MacOS to Ventura 13.1.
If you don't want to use iTerm as the accepted answer suggest, the workaround I found was to look for the launchPackager.command file inside node-modules/react-native/scripts/ and open this file manually every time you run your app for the first time (specifically when the error pop-up appears). This will open the terminal with metro running already.
I know that manually processes are not the best, but I don't want to use iTerm :)
Using Intel version of apps (Webstorm, Android Studio, other IDE etc...) fixed my problems. I encountered the same issue and thanks to Intel version of Webstorm and Xcode on Rosetta I can able to pod install and other operations.
Note: I'm using Intel version of Android Studio, WebStorm. Also Xcode uses Rosetta 2. No problem detected and everything works perfect. I can able to develop React-Native & Native Android & iOS and Flutter apps without problem. Before that I was using Silicon version of WebStorm and almost no function worked.
Config: MacBook Air, macOS Ventura 13.2 on Apple M1 processor.
For Most of the case you just have to delete node_modules and install modules again (npm i). This happens when project was copied from old mac which had node_modules folder created by the old user, or if the system thinks so
This happened to me after i configured my terminal for the look and feel - but with iterm2, oh my zsh, and powerlevel10k

Expo: Change default IOS simulator

I am new in expo and react-native
Whenever i run the app from IOS simulator (inside expo) it always boots up the IphoneX. If i need to change the simulator,I have to open it through Xcode, is there any way we can change the default simulator ?
expo included an option in recent commits regarding this issue.
now you can tap shift+i on terminal which expo server is running.It will list all simulators and you need to select your choice.
https://github.com/expo/expo-cli/pull/2541
Currently there is no way of changing the simulator from Expo. Expo just uses the last opened simulator in Xcode.
If that doesn't work, try this (updated here from my comment) :
When the simulator is open click on Hardware>Device> Select the other iphone.
Now both will be open. Next exit the simulator from the dock.
Now try and open your project in the ios simulator from expo. It should open in the Simulator you selected from the hardware menu.
This worked for me on Feb 2021
on Mac OS with Big sur, expo v4.1.6
Clean your EXPO cache with expo start -c (on your project location)
In the expo terminal press shift + i (see screenshot below)
Then press shift + i and you should be able to select the Simulator by pressing enter on the one you need (see screnshot)
lastly Just wanted to share all the available options if you just press i in the metro terminal window.
It is possible, but you can't target it from the command line.
Expo will just target the last opened simulator.
Click on Hardware > Device and choose the device you desire
You now have two simulators open, make sure the one you want is active.
Now quit the simulator app with Command + Q
Now in your command line, when running the expo server, just click i
The simulator will open with your targeted device.
(As of December 3, 2020)
Open Simulator
Click on File ... (in the top-left menu bar)
Click on Open Device ... (in the drop down list)
Select your desired device and let it launch completely
Quit Simulator ... (command + Q)
Done
Running your app on iOS Simulator will automatically launch to this desired device now =)
Change the open iOS simulator device(s), and Expo will use it.
Expo directs its output to the open iOS simulator, so this must be done in the simulator itself rather than in Expo. It is simple to do.
You can direct expo output to different devices. Here's how. BTW, other approaches described here didn't work when I tried them.
Open a second simulator in iOS Simulator by:
1) select eg Simulator->Hardware->Device->iOS12.1->iPhone 8
2) Select the simulator that you don't want to use (eg the current default as of writing, iPhone XR). Press Command-W to close the simulator window, leaving the iPhone 8 simulator still running.
3) In Expo, deploy the code to simulator as usual, either using the i at the command line, or selecting 'run on iOS Simulator' from the browser version of Expo.
4) It is possible to get expo to display to more than one simulator that is running at once (eg to test rendering on multiple screen sizes). Once you get expo running on one device (steps 1-3), you can repeat on an additional device (or presumably more). Expo will then be running on multiple simulators. They will simultaneously display the output. When I change my code, it immediately updates to multiple simulators/screen sizes without requiring any additional steps. Haven't re-tested exactly the order of steps to do this most easily, but it's working.
Hope this works for you!
You just need to open the desirable simulator through Xcode, and then just run:
npm run ios
from your project directory or a similar command to start your app
I believe that yarn passes unrecognized arguments through to react-native run-ios, so you should be able to pass --simulator="foo" as described here: https://facebook.github.io/react-native/docs/running-on-simulator-ios.
I know the exact answer
Once you open the Simulator from the Expo, go to Help menu and Search for "iphone11", "iphoneX" ....
Then you should be fine
Go to /Users/username/.expo/ios-simulator-app-cache/ and remove all files in there.
Run the ios simulator you want and run your expo project.
Restarting the computer was the only thing that worked for me. Without it pressing "Shift+i" had no effect. Neither Expo client would be installed on new simulator instance.
This was on macOS and M1 MacBook Pro for me.
Just launch simulator on which you want to run app and then run command i.e. "yarn run ios" or "npm run ios" to run on simulator. App will run on both simulator.
If it doesn't work then quit all simulator and then run the command i.e. "yarn run ios" or "npm run ios", then app automatically run on simulator which was latter launched.
Hope this may help you!

unable to connect ios 9.1 device to xcode 7.1

I am trying to run application in a device with iOS 9.1 from xcode 7.1. xcode is keep crashing. I am unable to install the application in any ios 9.1 devices. I have tried 3 different devices and getting the same problem. My code is in objective-c.
I have uninstalled the xcode and then installed xcode 7.2 again. It solved my issue.
I think you should do something for fix it, maybe it's just some stupid errors from xcode.
Try to clean then build again.
Add a devices for development then test again.
Report to Apple.
Check your iOS Target Deployment first.
Also try following steps
Also try reinstalling Xcode 7 and while installing close Xcode.
Check in Xcode Preferences whether Simulator for iOS9 is installed or not.
also check whether your itunes open when plugin device.

Running the app on the simulator shows: "Unable to boot the iOS simulator"

Running the app on the simulator shows: "Unable to boot the iOS simulator". I'm on Xcode 6.0.1.
I tried everything: resetting the simulator; selecting the Xcode 6.0.1 command line tools; restarting the Mac. The problem is still present.
Try this. In Xcode menu: Open Developer Tool > iOS Simulator. When it opens, use the menu to go to Hardware > Device > Manage Devices.... In that list, delete the non-working simulators and re-add them.
Also make sure that the Downloads section of Xcode preferences is up to date.
Do you have DYLD_INSERT_LIBRARIES set? If so, this is a dupe of:
Unable to boot iOS 8 Simulator
Check /etc/launchd.conf

iOS Simulator Doesn't Install Application

Using Xcode 5.1 to debug an iOS 7.1 iPad application.
When I build and run my project in the iOS Simulator, the simulator opens and my app icon pops up for a second. Then it looks like the app stops installing and the simulator goes to the home screen. Xcode still thinks it's debugging and it doesn't show any errors in Xcode or the simulator. I can go to my app in the simulator and click it again, but it just crashes. I get the same behavior in iPad, iPad Retina, and iPad Retina (64 bit). Any subsequent tries to run the app in the simulator doesn't even attempt to pop the app icon up until I quit the iOS Simulator and try again. All the usual fixes haven't worked for me yet.
Fixes I've Tried:
1. iOS Simulator > Reset Content and Settings...
2. Window(in Xcode) > Organizer > Delete Derived Data & Delete Snapshots
3. Delete Contents in ~/Library/Application Support/iPhone Simulator
4. Uninstall Xcode and reinstall
5. Clean project and rebuild
6. Restart machine
I'm out of ideas. Is there something I've missed?
Thanks all!
Create another app with the exact same template and look at the app delegates and make sure they are the same.
Example: AppDelegate.h and AppDelegate.m
You might've accidentally deleted an area that helps load the App.
Alright I found the problem. I was playing with how we load our frameworks because we were having other issues before and I left a bad value in our Linking settings.
Here's how I fixed it:
Project > Build Settings > Linking > Mach-O Type set to "Executable"
It was set to "Bundles" before which causes Xcode to package the app in a way that caused ours to break.
Helpful Post: In Xcode project target build settings, What is Mach-O Type?