ios iPhone模拟器位置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1567798/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 16:32:50  来源:igfitidea点击:

iPhone Simulator location

iphoneobjective-ciosxcodeios-simulator

提问by teepusink

Where on my machine is the iPhone simulator installed?

iPhone模拟器安装在我机器上的什么地方?

I'm been trying to find where a test application I run in the simulator is stored.

我一直在寻找我在模拟器中运行的测试应用程序的存储位置。

回答by Pablo Santa Cruz

Simulator: ~/Library/Application Support/iPhone Simulator/

模拟器: ~/Library/Application Support/iPhone Simulator/

You can browse simulator files from that directory in Mac OS X.

您可以在 Mac OS X 中从该目录浏览模拟器文件。

回答by Besi

Update for Xcode 4.4: While the iPhone simulator is still in the same place, Apple has included a shortcut to the iPhone Simulator at:

Xcode 4.4 更新:虽然 iPhone 模拟器仍然在同一个地方,但 Apple 已经包含了一个 iPhone 模拟器的快捷方式:

/Applications/Xcode.app/Contents/Applications

Changes since Xcode 4.3.1

自 Xcode 4.3.1 以来的变化

Please note that the new version of Xcode is now available on the Mac App Store. Hence all the stuff that used to come with an installer is now packaged into Xcode.app.

请注意,新版本的 Xcode 现已在Mac App Store上架。因此,过去安装程序附带的所有内容现在都打包到Xcode.app.

Therefore the iOS Simulator binary is located here:

因此,iOS 模拟器二进制文件位于此处:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/

The Apps installed in the simulator along with other configuration files are still here:

模拟器中安装的应用程序以及其他配置文件仍然在这里:

~/Library/Application Support/iPhone Simulator/

Here is an extract from the current release notes of Xcode 4.3.1

这是Xcode 4.3.1当前发行说明的摘录

What's new in Xcode 4.3.1

Xcode is now distributed as an application, rather than as an installer. This change enables Xcode to be updated directly from the Mac App Store.

Xcode 4.3.1 的新变化

Xcode 现在作为应用程序分发,而不是作为安装程序分发。此更改使 Xcode 可以直接从 Mac App Store 更新。

回答by Hardik Darji

As of Xcode 6 and iOS 8 you'll find it here:

从 Xcode 6 和 iOS 8 开始,您可以在这里找到它:

~/Library/Developer/CoreSimulator/Devices/{cryptic number}/data/Containers/Data/Application/{cryptic number}/

or you can get it from below code execution:

或者你可以从下面的代码执行中得到它:

 NSLog(@"Documents Directory: %@", [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);

回答by mikemike396

Xcode 6-> /Users/{YOUR NAME}/Library/Developer/CoreSimulator/Devices/{DEVICE ID}/data/Containers/Data/Application/{APPLICATION ID}/

Xcode 6->/Users/{YOUR NAME}/Library/Developer/CoreSimulator/Devices/{DEVICE ID}/data/Containers/Data/Application/{APPLICATION ID}/

Or print it out in Xcode console

或者在 Xcode 控制台打印出来

#if TARGET_IPHONE_SIMULATOR
    NSLog(@"Documents Directory: %@", [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);
#endif

回答by Pete Hodgson

The actual Simulator application itselfis located at /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator

实际的模拟器应用程序本身位于 /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator

回答by johnboiles

To find the most recent install of your application in the simulator, you can use this command:

要在模拟器中查找应用程序的最新安装,您可以使用以下命令:

find "/Users/$USER/Library/Application Support/iPhone Simulator" -type d -name 'YourAppName.app' -print0 | xargs -0 ls -td | head -1

Don't forget to replace YourAppName with the name of your app!

不要忘记将 YourAppName 替换为您的应用程序名称!

回答by Balaji Sekar

In Xcode 6, iOS Simulator.app is located in this location:

在 Xcode 6 中,iOS Simulator.app 位于以下位置:

/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app

回答by Jeremy Huddleston Sequoia

With the introduction of CoreSimulator in Xcode 6, each simulated device now has its own data. Previous versions had all devices share the same data for each version of iOS.

随着 Xcode 6 中 CoreSimulator 的引入,每个模拟设备现在都有自己的数据。以前的版本让所有设备为每个版本的 iOS 共享相同的数据。

Devices are located in ~/Library/Developer/CoreSimulator/Devices. Logs are located in ~/Library/Logs/CoreSimulator

设备位于 ~/Library/Developer/CoreSimulator/Devices。日志位于 ~/Library/Logs/CoreSimulator

Note that ~/Library/Developer/CoreSimulator/Devices//data/Library/Logs is a symlink to ~/Library/Logs/CoreSimulator/.

请注意,~/Library/Developer/CoreSimulator/Devices//data/Library/Logs 是 ~/Library/Logs/CoreSimulator/ 的符号链接。

CoreSimualtor will create an initial set of devices on first use (and after installation of older simulator runtimes). You can add or delete new devices from within Xcode.app or from the command line using 'xcrun simctl create' or 'xcrun simctl delete'

CoreSimualtor 将在首次使用时(以及在安装较旧的模拟器运行时之后)创建一组初始设备。您可以从 Xcode.app 内或从命令行使用“xcrun simctl create”或“xcrun simctl delete”添加或删除新设备

回答by Richard Bakos

As of 4.3.2 of Xcode for Lion, the iOS simulator is located in the contents of the app package... If you right click on xcode.app and click "Show package contents" then navigate to Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications there you will find the iOS Simulator app... Just drag it to your dock and there you go... Or you can make an Alias and drag that to your desktop (or wherever you want) for easy access to the simulator... Why Apple decided to bury it in the package, I have no clue.

从 Xcode for Lion 4.3.2 开始,iOS 模拟器位于应用程序包的内容中...如果您右键单击 xcode.app 并单击“显示包内容”,然后导航到 Contents/Developer/Platforms/iPhoneSimulator .platform/Developer/Applications 在那里你会找到 iOS Simulator 应用程序......只需将它拖到你的 Dock 上就可以了......或者你可以制作一个别名并将其拖到你的桌面(或你想要的任何地方)以方便访问模拟器......为什么Apple决定将它埋在包中,我不知道。

回答by Aravindhan

In X-Code 4.2
The Photos of the iPhone simulator are stored in

在 X-Code 4.2
中,iPhone 模拟器的照片存储在

/Users/user_name/Library/Application Support/iPhone Simulator/5.0/Media/DCIM/100APPLE