React Native Expo Managed App doesn't launch/start on iOS simulator - ios

I've been having hard times with my old Windows laptop while developing React Native apps so I moved to MacOS laptop. I installed Android Studio and Xcode (including Xcode command line tools). Then I initialized a blank expo managed project. I started both on Android Emulator and iOS simulator. Android one worked out with an ádb´ error (or maybe warning). But on the other hand, iOS simulator did nothing. There's no Expo Go app installed on iOS device, so it can not launch my app using it. I don't get any error or warning related to this problem, so I can't trace the problem.
I have tried deleting global expo folder located at ´~/.expo/´, I also tried to give 777 (all permissions) on that folder to my current user.
I tried uninstalling and reinstalling expo package globally.
I made sure I have selected Xcode command line tools on ´Xcode -> Preferences -> Locations -> Xcode 13.2.1 (13C100)´
I tried to launch different iOS devices like (iPhone 6, 8, 13, iPod etc.)
I tried clearing cache and starting expo with ´sudo npm start --clear-cache´
I have been trying to solve this for at least 2 hours tried everything possibly related to my problem but none of them did work. There's one thing I don't understand though. Even though I used different iOS device simulators the Expo Metro Bundler showed this ´› Opening exp://10.42.33.15:19000 on iPhone 8´ output. I have tried iPhone 13, iPhone 6, iPod etc. but this was the same output for different devices. Here's some screenshot related to probem:

https://www.youtube.com/watch?v=dvuZn6gX_Q4
This tutorial video on YouTube helped me solve my problems. I think I was missing a few things:
I haven't granted required privacy permissions on my Mac for Xcode, Android Studio and VS Code. Open System Preferences > Security & Privacy > Go Privacy Tab > Give Full Disk Access to Xcode, VS Code, Android Studio, Terminal and Watchman (Watchman is not required, but I have also installed it for solving a problem before)
You should to launch both your Android and iOS simulators before starting your expo application. Simply go to Android Studio and launch your device. To launch iOS device use bash and type open -a simulator.
If you don't have Expo Go app installed on your iOS simulator then you should first install it before starting your expo app. To install it use expo client:install:ios command.
Start your app by using expo start command. Type i and a or click on Run on iOS simulator and Run on Android device/emulator buttons to launch your app on devices.
NOTE: If you app gets stuck at New update available, downloading... stage then you can start your expo app with cleaned cache using expo start -c command. It was helpful for me.
NOTE 2: You may need to use sudo command on some of the commands I've mentioned, I'm not sure which ones are required or not.

I run into the same issue every time when I tried to set it up on a new laptop.
Its fixed after the installation of xCode cli.
Take a look at this - https://docs.expo.dev/workflow/ios-simulator/

I fixed similar issue by hard restarting simulator
Top menu -> Device -> Erase All Content And Settings...

Related

Flutter app stuck on Installing and Launching step for physical iPhone

Annoying problem here for my Flutter app: iOS13.3, Xcode11.3 on a physical iPhoneX. The iOS-Simulators all work. The problem is only happening on a physical device. The Flutter App freezes at startup (i.e. at Installing and Launching... step) ! Any ideas ??
My flutter doctor -v does not bring any problems. Also tried flutter clean and flutter upgrade. But nothing seems to fix the problem...
If I run the App from Xcode (Runner.xcworkspace) then everything works as well. Only from VSCode and Flutter, I can no longer launch my physical iPhoneX.
Also, when uploaded to TestFlight, the App freezes at App Start ! (grey screen freeze). Therefore Apple App Store rejects all Flutter Apps for now ! Very annoying.
I am not sure if the Installing and Launching... freeze is related to the TestFlight and App Store Problem !! Might as well be...
This fixed the issue for me:
Run the app from Xcode.
Disable WiFi on iPhone.
Run from Android Studio.
Turn on WiFi on iPhone once the launch process has completed.
This is a workaround solution
I was having this issue. I uninstalled the app from my device, opened the project in xcode, ran some build cleaning thing that appeared in the yellow triangle warning area, then built the app via xcode. Then uninstalled the app from device again. Then ran via android studio and it worked.
Basically, it is because of might some files
For me, this worked
Follows these steps: Go to Flutter > bin > cache
and delete the Artifact folder
Try executing the command: killall -9 dart and retry.
As in my case, I use one of following solutions to fix the issue:
#1. close WiFi on mac, then run from Android Studio; OR
#2. close WiFi on both mac and iphone, then run from Android Studio; OR
#3. enable hotspot on iphone and connect it from mac, then run from Android Studio;

Physical device (iPad) not detected in vs code for flutter but detected and working proper for debugging in Xcode

Here's my Environment
Xcode Version: 11.1 (11A1027)
Physical device: - iPad mini 2 (IOS 12.4.2)
VSCode Version: 1.39.2
Flutter version: 1.9.1+hotfix.6
When I use the iOS part of the Flutter project and run it physical device using XCode, it detects the device and works fine but I am somehow not able to see the device on the available devices section on VSCode.
However VSCode detects and works fine with the simulator.
I also ran flutter doctor to see connected devices, but again it does not show the connected physical devices but shows the simulator created device.
Use rm -rf <flutter_repo_directory>/bin/cache to force delete the files in cache and then flutter doctor -v to reinstall the missing sdk directories.
Deleting the cache in flutter/bin/cache directory and then reinstalling the dart sdk solved this issue.
Referred to this issue in Flutter repository(Issue No:41006).
I had the same issue. In my case, a recent iOS update had turned off Developer mode, for some reason... So I needed to enable it again (Settings - Privacy & Security - Developer Mode).
iPadOS / iOS Devices Setup for Hot Reload
Before trying to flutter Debug on physical device from Vscode it is Required to first :
Run a successful Xcode build on that iOS or iPadOS device
Follow this steps if you don't know how to Run Xcode Build -> your device should then be detected by flutter :
Open Xcode & do all the classic Set Up (Signing in with a Team & choosing a UNIQUE bundle Identifier)
Set Your iPhone Auto-Lock to Never (& Unlock it !) - Connect your iPhone or iPad to Mac with USB cable & Accept Prompt on the iPhone
Run Xcode Build on your iPhone this alert prompt will select Ok
On your iPhone a new menu will have appeared - Navigate to it & Click « Verify App » or « Accept »
Now Run Xcode Build Again - if does not run try running flutter clean & flutter build ios & try running again
—
After Successful Xcode Build - Stop Running the App
Keep Xcode Open
— iOS Setup is done
Close all Simulators or Emulators - Close VsCode
run flutter devices to make sure your Device is now detected
if it’s not try Turning it off & plugging it back again - remember to accept Trust Computer Prompt - keep it device unlocked too !
Open back your project in VsCode or Android Studio
Hot Reload⚡️Using VsCode :
Press F8 or Select ▷ « Start Debugging » in main.dart
That’s it ! You now have the power of Hot Reload⚡️ with VsCode on a physical device !
Hot Reload using Terminal Commands :
run flutter run -d yourDeviceID
Have fun ! Press r in Terminal for HotReload⚡️
If you need to find your iOS device ID :
Select Add Additional Simulators
Hot Reload⚡️on Android Studio :
Select your device & run
All I had to do was to disconnect the device from the laptop, make sure VS Code is open, then connect the device again while no VS Code, then it detected right away and chose the device automatically.
Sometimes it doesn't detect the device if it is not directly connected to the computer. I had a docking station in between and it didn't recognized the device. Especially after you have updated you macOS just before.
With "focus mode" activated on the device (like "do not disturb" 🌙) it won't show up.
Check whether you have fully installed xcode by running flutter doctor -v
Incase you find that some thing like
[!] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
just run install Xcode and run
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
Incase you installed xcode already, just run the above commands, they will do the magic.

Find iOS simulator where specific app is installed?

I have a ton of iOS simulators on my machine and I know that one of them has a certain app installed on it that I want to run again (and I can't easily rebuild this app on a different simulator). How can I find which simulator has a certain app installed on it?
I was able to get what I wanted by running the following commands in Terminal:
cd ~/Library/Developer/CoreSimulator/Devices
find . -name MyAppName.app
Then I went into the folder for the device with the app and opened device.plist which has name and iOS version of that simulator, which I could then open from the Simulator app Hardware > Device menu.

React Native ios Simulator - Simulator is installed but is identified as '; don't know what that is

I'm trying to launch the ios simulator to try an React Native App. I did't hace XCode installed until now.
To install my simulator, I had installed XCode, and I started a project "Simulator", to push "next" I needed a company name, I put "simu", after that, I clicked on "Project > Run", and I could see my simulator run.
In my CLI, when I launch the command yarnpkg run ios, I get this error:
Simulator is installed but is identified as 'simu.Simulator'; don't know what that is.
23:55:17: Failed to start simulator:
Unable to verify Xcode and Simulator installation.
I removed all my simulators, but the name persists, I had search how to change the identificator, but I dont find results.
I would like to know if I can change the "simu.Simulator" to Simulator, someone can help me?
The issue you might be facing is there might not be command line tools selected in your xCode Preferences. In Preferences -> Location, Choose command line tool
By default, after installing Xcode command-line not selected, so open Xcode and go to Preferences >> Locations and set Command Line Tools...
This worked for me in MAC High Sierra, Xcode Version 9.3:
Press i to open iOS emulator...
And You can see a cool new iPhone simulator like below image:
For Expo 32, the other solutions didn't work for me.
This SO answer solved it for me: Just open the Simulator before invoking it from Expo.
This worked for me with IOS Ph 11 simulator and subsequently for all the other devices

Error opening iOS Simulator with iOS 8 beta version: "Unable to boot the iOS Simulator"

I recently installed the beta of Xcode Version 6 in OS X Mavericks, with which comes the iOS simulator for iOS 8. I've managed to successfully run from Xcode 6 beta on a device with iOS 8 Beta, but opening the simulator always get the same error I have tried to change the hardware version of iPhone 4s, iPhone 5, ... in the simulator and still gives the same error: "Unable to boot the iOS Simulator".
I'm working with Xcode 5.1 at the same time in Mavericks, any suggestion to solve this? Is a possible problem for run this simulator in Mavericks because is only for OS X 10.10? Thanks.
After I found some solutions on the web, a combination of procedures worked for me:
Close Xcode and iOS Simulator (and all related applications)
Install (or reinstall) Xcode6-Beta to Applications folder (direct from the .dmg file)
Open Xcode6-Beta and go to Xcode -> Preferences -> Locations -> Command Line Tools and select "Xcode 6.0" (be sure that you've selected the one in Applications folder)
Launch the iOS Simulator and go to iOS Simulator -> Reset Content and Settings...
Close all the applications and restart your mac (I unchecked "Reopen windows...")
Open Xcode6-beta and test the iOS Simulator
Good luck
I also had this problem and found the solution by doing following steps:
Initially i downloaded Xcode 6 library in Documentation section under the path Xcode --> Preferences --> Downloads and restart my xcode but didn't solve my problem.
Downloaded and installed the iOS 7.1 Simulator under the path Xcode --> Preferences --> Downloads.
Restart xcode again and the problem solved.
I am facing same issue again next morning.
Unsetting the DYLD_INSERT_LIBRARIES variable solves my problem:-
Open terminal and type "sudo vi /etc/launchd.conf" command and press Enter
Press I "Insert" mode and change this
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
to this
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
and press esc to exit from insert mode.
Save changes by typing ":wq" Press Enter
Reboot your system and problem soloved.
Prior to that I didn't find any iOS version in front of each listed devices
but after installation or by unsetting DYLD_INSERT_LIBRARIES variable I found the same in front of each device.
I solved by removing and re-adding the simulators see screenshots here.
https://stackoverflow.com/a/25387715/1565615
I don't believe your issue is related to running Xcode 6 in Mavericks, as I encountered the same error on OS X 10.10.
After a bit of toying around with XCode and the iOS Simulator, the only fix I found was simply restarting the computer, and the error hasn't appeared since.
Try a reboot and then see if you can get things up and running.
(On a side note, after restarting just XCode (not the OS), I lost the option to run on the simulator at all—the reboot also fixed this problem, if anyone here encounters anything similar).
In Xcode go to the Xcode menu->Open Developer Tool - IOS Simulators. Choose simulator and then go hardware->device->manage device.
If the troubled device shows in the left column, delete it. Then add the device back from the '+' button. If it wasn't there in the first place, simply add it using the '+' button.
I had previously deleted ~/Library/Developer/CoreSimulator/ directory and the only command that worked for me is xcrun simctl erase all. Perhaps you might want to give this a try.
No need to download a new ios version. All you need is to go to About this Mac > Storage > Manage > Delete XCode Cache. And, it works for me
In latest OS version
About this Mac > Storage > Manage > Developer > select Xcode cache > Click delete button
I've faced same issue and solved by below steps:
1) Move xcode6-beta into application folder
2) Restart mac and open xcode6-beta from application folder.
i too had the same issue, but solved by installing the required simulators (Xcode > Preferences> downloads > install simulators)
This happened to me running the simulator on both Xcode 7 and 8 on El Capitan. The only thing that worked was disabling System Integrity Protection (https://apple.stackexchange.com/a/208481/86757).
I tested an awful quantity of solutions and the only one which worked for me was disabling root protection through Recovery Mode. I tested it with XCode 7.3, it's possible that this approach may work for XCode 8.
Reboot and hold the keys cmd + R prior to show the loading view with Apple Logo
When you are on Recovery Mode, go to Menu and choose Terminal
Type csrutil disable
Reboot the machine and run the simulator again.
I am adding this answer as it seems to be slightly different from the others.
Due to working on an older project I needed to download and run Xcode 7.3 and load the project in simulator - this yielded the "Unable to boot the iOS Simulator" error.
I completed all the above suggestions and none of them worked (reset simulator setting, restarted, deleted and reinstalled Xcode, reset the simulator location, restarted again etc)
In the end the issue was that I was trying to load the iPhone 5 (10.0) simulator on Xcode 7.3.
You can see here the Apple release notes for Xcode 7.3
Xcode 7.3 requires a Mac running OS X 10.11 or later.
Xcode 7.3 includes SDKs for iOS 9.3, watchOS 2.2, OS X version 10.11.4, and tvOS
9.2.
As you can see Xcode 7.3 doesn't include an SDK for iOS 10.0
This meant as soon as I loaded the simulator with iPhone 5 (9.3) it worked immediately.
I would therefore recommend when approaching this issue not to get railroaded (as I did) in thinking that something is wrong with the system before checking the basic things.
Note: It is also worth noting that the simulator must be configured to the Xcode version being used. This can be set in
Xcode -> Preferences -> Locations -> Command Line Tools
and also using the command line:
sudo xcode-select --switch /Applications/Xcode_7.3.app/Contents/Developer
*change the Xcode version to the new one you want to use
one of the reasons could be you might deleted /private folder.
you can try with following commands
sudo mkdir /private/tmp
sudo chmod 1777 /private/tmp
Following are the steps for solved above issue:
Search launchd.conf file in your mac
If not found then create from Terminal with help of command
~ user$ sudo touch /etc/launchd.conf
Terminal will ask you machine password
Then Open created file with help of command for EDIT, if terminal give you error as permission failed
~ user$ sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/launchd.conf
Open file manually from /etc/launchd.conf (Shift+cmd+g) and enter /etc/ (TextEdit software)
In file "DYLD_INSERT_LIBRARIES" flag replace with "ZZ" and save it.
Restart your machine.
Xcode will defiantly works.
This error indicates an error starting up launchd_sim when booting the simulated device. In and of itself, it does not indicate the actual cause. You can look in ~/Library/Logs/CoreSimulator/CoreSimulator.log for more information about the error (including the error reason).
Possible causes:
On OSX 10.9 and earlier, DYLD_INSERT_LIBRARIES could be set by 3rd party applications. On later versions, invalid DYLD_INSERT_LIBRARIES are ignored instead of resulting in an error.
Usage of older simulator runtime DLC with Xcode 7 betas. Newer versions of Xcode ignore these older DLC.
If you need additional help, please provide that additional datum.
Just check your simulator's iOS version. I fought with this error for 2 days and tried everything. Once I run the project on the simulator with iOS version that my Xcode supports, it worked sadly... :/
I quit everything and restarted the Mac. That's all. Its worked like charm!!
I don't know why, but this happened to me when I had Charles Proxy's throttling turned on.
I didn't have to run Xcode again or clean anything. Just disabling the throttling allowed the simulator to work again.
I also clicked on details, but this was all that I got:
Details
Unable to boot the Simulator. Domain: NSPOSIXErrorDomain
Code 60
Failure Reason: launchd failed to respond.
This might be related a known Xcode 11.2 issue:
Third party “endpoint security” software may cause slow simulators, system freezes, or prevent debug processes from running in simulators reliably. This sometimes manifests as debugserver disconnections or simulator applications receiving a SIGKILL signal. (55853555)
Workaround: Uninstall the third party software.
Though I was seeing this error on 11.1. Yet Apple may have just not realized this was an issue on 11.1 as well ¯_(ツ)_/¯
I have solved this issue using following steps:
Xcode -> Preferences -> Location -> Derived Data -> Delete your project folder.
I got this error on OS Catalina, Xcode 11.
I solved this by simply quiting simulator and Xcode, and then start Xcode and run your application.
1. Quit Xcode and Simulator if running.
2. Remove customised settings setup
defaults delete com.apple.Xcode
3. remove configuration folders
rm -rf ~/Library/Application\ Support/Xcode
4. Quit the terminal and run Xcode again.
Resetting the simulators fixed the issue for me. Run the below
Fastlane command to reset all simulators,
fastlane snapshot reset_simulators
Please ensure you have closed Xcode & simulator before running the command.
Fastlane is an Android & iOS deployment automation tool.
I just simply follow the below steps and the issue is resolved...
Go to About This Mac > Storage > Manage > Developer >
Select Xcode cache > Delete the cache
Now try to open the simulator again and it will work... In case if above steps did not work just try to do the same with s
Late answer, but it maybe helpful to someone. I tried all the solutions provided in this and related posts and neither of them worked.
I am using OSX(version 10.10.3) and Xcode 6.2. To fix this issue I followed the following steps :
Delete all xcode and simulator related files using AppCleaner.
Restart Mac.
Open Disk Utility app from applications.
In Disk Utility app; click on button Verify Disk Permission for your Macintosh HD (there will be some warnings displayed; I think /private/tmp is cause of this issue).
In Disk Utility app; click on button Repair Disk Permission for your Macintosh HD.
Re-install Xcode; now it should work.
More info : How to fix Xcode error ‘Unable to boot iOS Simulator’.
This may helpful
Open simulator with 4s
Click on menu- iOS simulator
Click on Reset content and settings...
Force close the simulator and run app.

Resources