Simulator shows Black screen using ionic

流过昼夜 提交于 2019-12-02 19:12:50

I finally found a solution to fix this problem First setup your application:

1- ionic start myAppname tabs

2- cd myAppname

3- ionic platform add iOS

4- ionic build ios

Then create a file in your projects directory called emulator.sh or whatever name and copy the content of the code below:

echo "Emulating..."
cd ./platforms/ios/build/emulator
var=$(pwd)

ios-sim launch "$var"/*.app

Set permission for the script: $sudo chmod 777 emulator.sh

whenever you want to emulate your application run the script: ./emulator.sh

so by using this script you don't need to manually open the project in Xcode and run the project

special thanks to Miroslav Masa

Are you running the ionic command from inside a tmux session? tmux seems to be preventing the communication between cordova and the iOS simulator. As soon as I tried running the ionic/cordova emulate ios commands directly from the terminal, it worked just fine!

I was having the same issue and was able to resolve it by:

  • Open Xcode
  • In the Xcode > Open Developer Tool > iOS Simulator
  • iOS Simulator > Reset Content and Settings
  • Restart Mac (uncheck open all windows)

Godspeed.

You have to manually copy over the latest ionic files into your project after unzipping them as noted here: http://forum.ionicframework.com/t/on-upgrading-to-ionic-beta-13-getting-error-uncaught-referenceerror-interpolate-is-not-defined/10232

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!