ios-simulator

iPhone: Can access files in documents directory in Simulator, but not device

眉间皱痕 提交于 2019-12-03 21:59:03
I'm writing an app that copies some contents of the bundle into the applications Document's directory, mainly images and media. I then access this media throughout the app from the Document's directory. This works totally fine in the Simulator, but not on the device. The assets just come up as null. I've done NSLog's and the paths to the files look correct, and I've confirmed that the files exist in the directory by dumping a file listing in the console. Any ideas? Thank you! EDIT Here's the code that copies to the Document's directory NSString *pathToPublicationDirectory = [NSString

Color consistency between Photoshop, iPhone Simulator, and iPhone

陌路散爱 提交于 2019-12-03 21:38:52
I've been working a lot with Photoshop .psd files recently and have been bouncing back and forth a lot to ensure colors look just right on the iPhone. Can anyone offer some tips on calibrating macbook/apple cinema displays in regards to keeping color consistency between Photoshop, the iPhone simulator, and physical iPhones? Have a look on LiveView created by Nicholas Zambetti . You need to install it on your iPad/iPhone/iPod Touch and on your Mac. when synced (Mac and device) you can have a preview of the selected area of your screen (Mac), on your device. Hope this will help you out! Cheers,

iPhone simulator fails

扶醉桌前 提交于 2019-12-03 20:29:56
I have a fresh iPhone project. When I "Build and Go": Error from Debugger: Failed to launch simulated application: iPhone Simulator failed to install the application. Why is that?! You need to remove the folder as sudo ~/Library/Application Support/iPhone Simulator sudo rm -Rfv ~/Library/Application\ Support/iPhone\ Simulator It looks like previous versions of the SDK have some kind of permission trouble. You don't have to sign code to run in the simulator, only for running on real devices. Was the app running in the simulator successfully before? If so, did you make changes to the app since?

How to test Dynamic Type (larger font sizes) in iOS Simulator

会有一股神秘感。 提交于 2019-12-03 20:01:45
问题 Changing Dynamic Type settings in iOS can be done manually (Settings > General > Accessibility > Larger Text). But this does not appear to work in the current Simulator (v9.3 at the time of writing), and doing so manually is not a solution where automation is required. Question: Is there a way to launch an app with Dynamic Type settings to launch an app with larger font sizes? Note: This is not only useful for UI testing, but also for the purpose of creating screenshots using Fastlane

Reduce the Xcode Simulator (Retina 4 inch)

 ̄綄美尐妖づ 提交于 2019-12-03 18:49:14
问题 I'm using macbook Air and using the iphone Simulator. I changed it to Retina 4 inch, and the screen of the simulator become so big! is there a way to reduce the size? 回答1: You can scale it with the following shortcuts: ⌘ + 1 : 100% ⌘ + 2 : 75% ⌘ + 3 : 50% ⌘ + 4 : 33% ⌘ + 5 : 25% Or in iOS Simulator: Window > Scale > ... 回答2: The iOS Simulator's Window menu has an option to display the simulator at 50%, 75%, or 100%. Try one of the smaller values to make it fit. 回答3: Now It's more flexible

NSBundle pathForResource returns nil with subdirs

☆樱花仙子☆ 提交于 2019-12-03 17:41:45
问题 I have a bunch of directories and files in my app, for instance images/misc/mainmenu_background. . I'm running the following code in the "iPad Simulator 3.2": NSString *images = [[NSBundle mainBundle] pathForResource:@"images" ofType:nil]; NSString *images_misc = [[NSBundle mainBundle] pathForResource:@"images/misc" ofType:nil]; NSString *images_misc_file = [[NSBundle mainBundle] pathForResource:@"images/misc/mainmenu_background.png" ofType:nil]; After this call, images contains the path

IPhone 6 plus simulator scaling [duplicate]

房东的猫 提交于 2019-12-03 17:33:27
问题 This question already has answers here : How to resize the iPhone/iPad Simulator? (11 answers) Closed last year . Even after scaling the IPhone 6 plus simulator to 50% (No option to scale less than this), the size is still big to work with it. How can i scale down it to 25% or less ? 回答1: Run this in a terminal: defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.4" You may vary "0.4" to your liking. Then, in simulator, hardware-> devices-> iphone 6 plus

How to automatically reset iPhone simulator on build

南笙酒味 提交于 2019-12-03 17:16:32
After moving several JSON files from the app bundle root to within a directory structure (also in the app bundle) the app kept running as if the files remained in their prior location. After much head scratching and doing a clean build I remembered that the iPhone simulator had to be cleared out in order to get rid of these files in the old locations. It'd sure be nice to have the option to force a reset of the simulator on every build. Clean-slate mode, if you will. Can this be hacked in any way? Any ideas? Vic You can add a "New Run Script Action" to the "Pre-actions" for the "Run" step of

Ios 6 simulator stuck on splash screen

假装没事ソ 提交于 2019-12-03 17:04:56
问题 I am using Mac os 10.8.2, and Xcode 4.5.2, when i try to run my app in ios 5/5.1 simulator its working fine, but when i try to run the App in ios 6 simulator it get stuck with blank screen. can anybody let me know what the solution for my problem? 回答1: I had this issue a while ago. Here's what helped me: In your iOS simulator, reset content and settings quit your iOS simulator Quit and reopen your Xcode project in Xcode, click Product > Edit Scheme. Change debugger from LLDB to GDB (or none)

Uploading image issue (UIImageJPEGRepresentation vs UIImagePNGRepresentation)

半城伤御伤魂 提交于 2019-12-03 17:04:34
问题 I have stored a few pictures using Safari's "Hold + Save Image" option to my Photo Library in simulator. When I pick an image from the library, I have to convert it to JPEG or PNG so I can upload it to the server. Issue is that the size of original image is around 200 KB but the image after converting to PNG is around 2 MB. I'm using UIImagePNGRepresentation to convert UIImage object to NSData and then posting the image. What am I missing here? Why is the size of picture getting larger than