如何测试倾斜效果? - iPhone模拟器
我正在尝试写一个游戏。该游戏使用倾斜效果,但我不知道如何在Iphone Simulator 3.0上测试它。 我在网上搜索了它,但结果是零。我怎样才能...?
I am trying to write a game. That game uses tilt effect, but i don't know how to test it on Iphone Simulator 3.0.
I search it on internet, but the result is zero. How can i...?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
简短的回答:你不能,不能直接。您必须使用真实设备。
更长的答案:您可以子类
UIAccelerometer
并按照您的意愿进行操作。您可以模拟输入,或者编写一个客户端和服务器对,将加速度信息从真实设备发送到在模拟器中运行的应用程序,或者如果您喜欢挥舞笔记本电脑,则可以从 Macbook 的加速计发送加速度信息。Short answer: You can't, not directly. You have to use a real device.
Longer answer: You could subclass
UIAccelerometer
and do as you like. You could simulate input, or write a client and server pair that sends acceleration information from a real device to your app running in the simulator, or from your Macbook's accelerometer if you fancy waving your laptop around.尝试https://code.google.com/p/accelerometer-simulator/。它的功能与 iSimulate 相同——它将加速度计事件从手机发送到您的计算机——但它是免费且开源的。
Try https://code.google.com/p/accelerometer-simulator/. It does the same thing as iSimulate -- it sends accelerometer events from the phone to your computer -- but it's free and open source.
AppStore 中有一个名为 iSimulate 可让您将实际设备的加速计输入输入到 sim 中。您确实需要有一个用于测试的设备。
There's an application in the AppStore called iSimulate which lets you feed an actual device's accelerometer inputs into the sim. You do need to have a device for testing.
相关说明,您还可以从 iphone/ipad 上运行的 safari 捕获加速度计数据
请参阅此演示 http://www.webdigi.co.uk/blog/2012/using-an-ios-device-to-control-a-game-on-your-browser/
ON a related note, you can also capture accelerometer data from safari running on your iphone/ipad
See this demo http://www.webdigi.co.uk/blog/2012/using-an-ios-device-to-control-a-game-on-your-browser/
刚刚在问类似问题时看到了这一点 - 您现在实际上可以在新的 xcode 中设置界面方向,因此即使您不能直接“倾斜”它,您也可以将其设置为仅支持横向的位置 - 然后它将加载模拟器中的横向视图! :D
Just saw this when asking a similar question - you can actually set the interface orientation now in the new xcode, so even though you can't 'tilt' it directly, you can make it to where it only supports landscape - then it will load the landscape view in the emulator! :D
来自:http://developer.apple。 com/library/ios/#documentation/IDEs/Conceptual/iOS_Simulator_Guide/InteractingwiththeiOSSimulator/InteractingwiththeiOSSimulator.html
From: http://developer.apple.com/library/ios/#documentation/IDEs/Conceptual/iOS_Simulator_Guide/InteractingwiththeiOSSimulator/InteractingwiththeiOSSimulator.html