模拟器显示使用离子的黑屏 [英] Simulator shows Black screen using ionic
问题描述
我通过离子sidemenu应用程序,当我运行emulate ios我得到这些错误:
i went through ionic sidemenu app when i run emulate ios i get these errors:
Usage of '--family' is deprecated in 3.x. Use --devicetypeid instead.
Usage of '--retina' is deprecated in 3.x. Use --devicetypeid instead.
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7f91f97358b0 {NSLocalizedDescription=Simulator session timed
,模拟器的黑屏显示
这些是我的mac信息:
yosemite 10.10
ios-sim版本3.0.0
cordova版本3.6.3-0.2.13
ionic version 1.2.6-beta1
xcode 6.1
and these are my mac info: yosemite 10.10 ios-sim version 3.0.0 cordova version 3.6.3-0.2.13 ionic version 1.2.6-beta1 xcode 6.1
推荐答案
我终于找到了解决这个问题的解决方案设置您的应用:
I finally found a solution to fix this problem First setup your application:
1- ionic start myAppname tabs
1- ionic start myAppname tabs
2- cd myAppname
2- cd myAppname
3-离子平台添加iOS
3- ionic platform add iOS
4-离子生成ios
4- ionic build ios
然后在您的项目目录中创建一个名为emulator.sh或任何名称的文件,并复制以下代码的内容:
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
设置脚本的权限:$ sudo chmod 777 emulator.sh
Set permission for the script: $sudo chmod 777 emulator.sh
每当你想模拟你的应用程序运行脚本:./emulator.sh
whenever you want to emulate your application run the script: ./emulator.sh
所以通过使用这个脚本你不需要手动打开Xcode中的项目并运行项目
so by using this script you don't need to manually open the project in Xcode and run the project
特别感谢Miroslav Masa
special thanks to Miroslav Masa
这篇关于模拟器显示使用离子的黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!