且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 iPhone 模拟器中安装 iPhone 应用程序

更新时间:2022-04-15 03:19:18

请注意:此答案已过时,该功能已从 iOS 模拟器中删除.

我刚刚发现您无需将移动应用程序包复制到 iPhone Simulator 的文件夹中即可在模拟器上启动它,如论坛中所述.这样你就需要点击应用程序来启动它,当你想要进行测试并多次启动应用程序时会很不舒服.

I have just found that you don't need to copy the mobile application bundle to the iPhone Simulator's folder to start it on the simulator, as described in the forum. That way you need to click on the app to get it started, not confortable when you want to do testing and start the app numerous times.

iOS 模拟器有未公开的命令行参数,可用于此类目的.您正在寻找的是:-SimulateApplication

There are undocumented command line parameters for the iOS Simulator, which can be used for such purposes. The one you are looking for is: -SimulateApplication

启动 YourFavouriteApp 的示例命令行:

An example command line starting up YourFavouriteApp:

/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator -SimulateApplication path_to_your_app/YourFavouriteApp.app/YourFavouriteApp

这将在没有任何安装的情况下启动您的应用程序,并且至少适用于 iOS Simulator 4.2.但是,您无法访问主菜单.

This will start up your application without any installation and works with iOS Simulator 4.2 at least. You cannot reach the home menu, though.

还有其他未公开的命令行参数,比如切换SDK.为那些快乐的狩猎...

There are other unpublished command line parameters, like switching the SDK. Happy hunting for those...