iOS XCode 获取 IDEPseudoTerminalDomain 错误 1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24946494/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS XCode getting IDEPseudoTerminalDomain error 1
提问by Vikas Khengare
I am trying build a app for iOS using XCode. The app works fine on iPhone simulator but before running it throws error "IDEPseudoTerminalDomain error 1". Don't know why it is causing this.
我正在尝试使用 XCode 为 iOS 构建一个应用程序。该应用程序在 iPhone 模拟器上运行良好,但在运行之前抛出错误“IDEPseudoTerminalDomain 错误 1”。不知道为什么会导致这种情况。
If I try to run all on iPad simulator then it doesn't open simulator at all.
如果我尝试在 iPad 模拟器上运行所有内容,那么它根本不会打开模拟器。
The operation couldn't be completed. (IDEPseudoTerminalDomain error 1.)
Please can you tell me why this error is coming and how to avoid it.
请你告诉我为什么会出现这个错误以及如何避免它。
Thanks in advance.
提前致谢。
回答by Victor Bogdan
Try increasing the max number of pseudo terminals
by doing this:
尝试pseudo terminals
通过这样做来增加最大数量:
sudo sysctl -w kern.tty.ptmx_max=999
To make the change permanent beyond the current terminal session, do this:
要使更改在当前终端会话之外永久生效,请执行以下操作:
sudo touch /etc/sysctl.conf
sudo chown root:wheel /etc/sysctl.conf
sudo chmod 644 /etc/sysctl.conf
echo "kern.tty.ptmx_max=999" | sudo tee -a /etc/sysctl.conf
Credits go to bartoszj at https://www.pgs-soft.com/ios-ui-testing-and-why-it-does-not-always-work-a-k-a-pushing-the-limits-of-the-xctest-framework/
积分转到 bartoszj,网址为https://www.pgs-soft.com/ios-ui-testing-and-why-it-does-not-always-work-aka-pushing-the-limits-of-the-xctest -框架/
回答by justinpawela
I reset the iOS Simulator ("iOS Simulator" menu > "Reset Content and Settings..."), then I restarted Xcode. These two combined resolved this issue for me.
我重置了 iOS 模拟器(“iOS 模拟器”菜单 >“重置内容和设置...”),然后我重新启动了 Xcode。这两个结合为我解决了这个问题。
I am using Xcode 6.0 beta 4.
我正在使用 Xcode 6.0 beta 4。
回答by nivritgupta
reset the iphone simulator and then quit the simulator then started it again or XCode menu->Clear cache solved your problem.
重置 iphone 模拟器,然后退出模拟器,然后再次启动它或 XCode 菜单->清除缓存解决了您的问题。
回答by Laser Hawk
There is one little thing I would like to add if you're follow the guidance of: https://www.pgs-soft.com/ios-ui-testing-and-why-it-does-not-always-work-a-k-a-pushing-the-limits-of-the-xctest-framework/Which BTW is brilliant that they figured that out (hint, hint Apple!) Its an exploit with a doubt, but a solution that works for now.
如果您遵循以下指导,我想补充一点:https: //www.pgs-soft.com/ios-ui-testing-and-why-it-does-not-always-work -aka-pushing-the-limits-of-the-xctest-framework/顺便说一句,他们发现了这一点(提示,提示 Apple!)这是一个有疑问的漏洞,但现在是一个有效的解决方案。
You do not have to create multiple test targets that run under a 160 tests each per target. My suggestion is to have the simulator run on a separate PID. Its as simple as
您不必创建多个测试目标,每个目标在 160 个测试下运行。我的建议是让模拟器在单独的 PID 上运行。就这么简单
`set +e
killall "Simulator"
set -e
xcodebuild test-without-building -workspace YourComapny.xcworkspace -scheme YourCompanyApp -destination 'platform=iOS Simulator,name=iPhone 7,OS=latest' -only-testing:Test/testApp0`
`set +e
killall "Simulator"
set -e
xcodebuild test-without-building -workspace YourComapny.xcworkspace -scheme YourCompanyApp -destination 'platform=iOS Simulator,name=iPhone 7,OS=latest' -only-testing:Test/testApp1`
and so on. Each new test-without-building
with the sim killed will force a new PID and you can avoid polluting your testing architechture with copied test targets.
等等。每个新test-without-building
的 sim 被杀死都会强制一个新的 PID,你可以避免复制的测试目标污染你的测试架构。
回答by Chris Lee
I also got this same problem. After quit Xcode and Simulator,restart them several times, it still could't work. Lastly, I solved this problem by doing this two steps:
我也遇到了同样的问题。退出Xcode和Simulator后,重启几次,还是不行。最后,我通过执行以下两个步骤解决了这个问题:
1.Power off(Turn up the Mac volume,Shut down or restart Mac before saving your working files); 2.Press “option + command + P + R”at the same time after pressing Mac power switch,then you will hear the system launching sound——That means system is clearing caches safely,you can open your fingers after hearing two or three sounds. The system will go on launch normally.
1.关闭电源(调高 Mac 音量,在保存工作文件之前关闭或重新启动 Mac);2.按下Mac电源开关后同时按下“option + command + P + R”,会听到系统启动声——表示系统正在安全清除缓存,听到两三声后可以松开手指声音。系统将继续正常启动。