How to fix expo start throwing "Simulator is installed but is identified as 'com.apple.CoreSimulator.SimulatorTrampoline'; dont know what that is" - ios

I am trying to set up a react-native development environment. I would like to set up an iOS emulator (preferably an iPhone 10) to run my app on. I am using a Macbook Pro 2016 running on MacOS 10.14.3. I have installed my react-native app through the command create-react-native-app (running version 2.0.2). I also have installed XCode running version 10.2(10E125). When I scan the QR code that Expo generates and run it on my iPad or my Android device it works just fine, but when I try to load the iOS emulator by pressing i after expo start it returns the error
Trying to open the project in iOS simulator...
Simulator is installed but is identified as 'com.apple.CoreSimulator.SimulatorTrampoline'; don't know what that is.
Simulator not installed. Please visit https://developer.apple.com/xcode/download/ to download Xcode and the iOS simulator. If you already have the latest version of Xcode installed, you may have to run the command `sudo xcode-select -s /Applications/Xcode.app`
I have already tried running the command sudo xcode-select -s /Applications/Xcode.app
I have also tried running the command xcode-select -r
I have also confirmed that in my XCode->Preferences->Locations Command Line Tools is selected as "Xcode 10.2(10E125)"
None of these have worked.
I am expecting that after pressing i after expo start an iOS emulator loads up. Thank you.
-----EDIT-------
After some more research, I found out that running open -a Simulator and then running expo start loads the app on an emulator and works for my purposes. But still if I just run expo start without running open -a Simulator it still gives the same error. I want to ask if this is the best I am going to get?

You might be running an outdated version of Expo. I had this problem when I was download someone's old repo using Expo 27 when Expo 36 came out. After updating to the latest version, it works.
To update packages in your project, npm-check-updates comes in handy.
npm i -g npm-check-updates # installs ncu globally
ncu -u # updates all dependency versions in your local package.json
npm install # updates the packages in node_modules to match
Note: This will update all your dependencies to the latest version. If you don't want to do this, you can find the latest version of expo and change the version in package.json manually.

I ran into the exact same problem all of a sudden. Clicking "Run on iOS Simulator" within the Expo Developer Browser worked 2 days ago but did not work today. Your clue of using open -a Simulator helped me though. I went into Xcode and clicked the Xcode menu > Open Developer Tool > Simulator. This started the Simulator and then I was able to click "Run on iOS Simulator" within the Expo Developer Browser and it worked as expected. If you haven't had the fortune of "Run on iOS Simulator" working, I'm guessing you could just start a simulator, download Expo from the App Store and just use it from there. None of this answers the question as to why the error happens but at least gives a few workarounds for anyone else that might need. All that matters is you get the app running on the Simulator in the end!

Related

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

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...

Running react-native run-ios is success. but not launch simulator

I've been using ReactNative in Windows. Android is perfect and now it has to build on the iPhone and give ipa to clients.
However, even if you run counter-native run-ios after updating the code yesterday, the app will not be launched on the simulator.
I started a new project because I thought there might be a problem with my project, and then I ran a counter-native run-ios, but I failed.
The terminal is output as a successful build, but there is no response to the simulator.
App is not installed.
Somebody please help me.
react-native version is 0.59.9
Images are run on terminals and simulators.
As in latest react-native version 0.60.0 + they have fixed too many problems which are with integration of latest xCode version.
Please do the following to achieve
Upgrade react-native version to 0.60.0 or +
rm -rf node_modules/&& yarn install && react-native link
cd ios and then pod install
Close the bundle and run(Cmd+ r) from xCode
Well, in my case I was in sudo mode. When I turned it back to normal mode, it showed up on the IOS simulator as an app.

React Native app not running in XCode iOS simulator

I try to make my first steps using React Native. Development for Android (on Windows host) works. Now I wanted to test iOS, and tried to set up a development environment on a MacBook Pro.
Problem: React Native starts the iOS simulator, and then nothing happens any more. The simulator runs OK, but my React native app won't start.
What do I need to do to get my React Native installation going?
More Info:
I set up XCode and React Native according to the docs on the MacBook Pro running OSx 10.13.2 (High Sierra). XCode was installed and tested successfully, including the simulator.
When I installed Node.js I deliberately picked an older version (containing npm 4.2.0), since forums say that React Native does still have problems with npm 5. I also installed Homebrew and Watchman, like stated in the docs.
To initialize an empty project, I used
create-react-native-app HelloWorldProject
and a projet structure got created in my Documents folder.
If I finally fire up my "Hello World" test app using
cd HelloWorldProject
sudo react-native run-ios
the system responds:
Starting packager ...
Starting simulator ...
and then nothing happens. The simulator does indeed start (boot --> apple logo --> progress bar --> IOs start screen), but nothing happens afterwards.
Edit
I have given up on React Native for several reasons, I leave this question here for documentary purposes, but I cannot verify or accept any answer, I don't have a React Native development environment any more.
It's probably because you used sudo. /.expo/ is owned by root. Try to change the ownership with
sudo chown -R `whoami` ~/.expo
Refer https://github.com/react-community/create-react-native-app/issues/422
Even everything in your app seems fine, sometime you face the issue that the app is taking too much time to load either through terminal or Xcode. If there is no any other specific issue with your project, the following solution works most of the time:
Go to your app folder and then go to 'iOS' folder.
Delete 'Podfile.lock' and 'Pods' folder.
Execute the following command in Terminal from your 'ios' folder, that will bring back the 'Podfile.lock' and required Pods will be installed to 'Pods' folder:
pod install
Delete the 'build' folder in your 'iOS' folder.
Run the following command in terminal:
react-native run-ios
While the terminal is running, open '.xcworkspace' in your 'ios' folder in Xcode.
The above steps will make sure it will be build your react native project newly and will run on the simulator.
Thanks
Wasantha Wijayaratna

Apache Cordova, Visual Studio 2015, Xcode 8.3 cannot remotebuild

It has been a year since I first build the app, and of course my iPhone software has updated since then. With that I was informed that I needed to update Xcode in order to get the right platform to get a release version for my cordova app updates. Updating xcode required me to update the OS to Sierra on the mac. After that, I have been unable to remotebuild even my debug version, which I had been able to do before.
My constant issue right now is that when I build the app in remote build it keeps adding "ios": "4.0.1" to the platforms.json file, but the error I receive is that with xcode 8.3 I need 4.3.0 or greater.
I cannot figure out how to update this value. I have upgraded npm, node, everything that I can think of. Nothing changes the value, and I can't seem to find anyone else with my problem.
Any help or suggestions would be welcome.
First, open up project platforms folder and delete ios folder. Then update cordova on your development machine and Mac.
For Mac : $ sudo npm install -g cordova
For Windows: npm install -g cordova
Just check whether your files getting deployed to the Mac build folder path. If so, open up the project using XCode.
Then build your project using XCODE. Most probably there will be an error to choose the development team. Once you select the account or the team fom dropdown list you can deploy the app without any issues.
That worked for me. Hope this will help you too.
Another way: Navigate to platforms folder -> platforms.json. Check the IOS version. Change it to 4.3.0 and delete the ios folder and add IOS 4.3.0 via command prompt.
packages.json
{
"android": "5.1.1",
"ios": "4.3.0"
}
in cmd Run
cordova platform add ios#4.3.0
Well, be ready for many actions to be done but in the end it works. )
Update your XCode to 8.3.3 without worry.
Then be sure to update your remotebuild to the latest version that is currently 2.1.3 by running sudo npm i remotebuild -g on your Mac.
Get back to your development machine with Visual Studio and run some command line utility in administrator mode. Open you cordova folder from there.
Execute cordova platform rm ios to remove the current ios version under cordova. It's also advised to remove the android one by cordova platform rm android.
Update the version of CLI you use for builidng on Visual Studio. Currently it's 7.0.1. There were people that claimed that 6.5.0 also works but in my setup 7.0.1 works as well.
Get back to your command line and run cordova platform add ios#4.4.0, This is the minimal cordova ios that supports the cordova 7.0.1.
In case you removed android as well then run cordova platform add android#6.0.0. There are more progressive versions of cordova android but I found them not working.
Now get back to your Mac and remove the following folder ~/.taco-remote/node_modules.
In case you don't see this .taco-remote folder it's the hidden one so run in command line of your Mac com.apple.Finder AppleShowAllFiles true and then killall Finder to close all instances of Finder. Afterwards .taco-remote folder should be visible under your user folder ~/.
Now go back to Visual Studio and open Tools > Options > Tools for Apache Cordova and run Clear Cordova cache.
Now run your ios and it should succeed.
In case you run afterwards your android build and it fails on something like Android platform already added run the Clear cordova cache again and then your android build also should succeed.
From this point both ios and android builds should work.
Whooof. )
Good luck!
BTW, most of this solution came from this thread.

iOS emulator no longer running from command line using phonegap

My iOS emulator is no longer opening when I run "phonegap run ios" in the terminal on Mac OS X. I receive no error messages and:
[phonegap] Platform "ios" deployed to emulator.
[phonegap] successfully installed onto emulator
While this is currently a known bug, you can run the emulate command more directly (note you need to build separately):
phonegap local build ios
/platforms/ios/cordova/emulate
You can also run the application using the same technique:
phonegap local build ios
/platforms/ios/cordova/run
NOTE: When using this method to run the app on your phone, the task might get stuck on the splash screen. To fix this, launch the Activity Monitor on your Mac and quit any processes with the name "ios-deploy". From there you can launch the application on your phone by clicking the application icon.
Or, you can even look inside the generated /platforms/ios folder and launch XCode project directly to test in an emulator or on your device. Open project and click the RUN button.
IMPORTANT: with all of the above methods, you MUST run the build command before running:
phonegap local build ios
Not really an answer, but I can say this is a known bug. Here is the bug so you can track it:
https://issues.apache.org/jira/browse/CB-5103
I only had this problem after upgrading to 3.1. I downgraded to 3.0 and it works more reliably:
npm uninstall -g phonegap
npm install -g phonegap#3.0
Also had to delete the platform/ios dir and plugins/ios.json and then run 'phonegap build ios' and 'phonegap run ios'

Resources