ios-simulator

iOS simulator - How can I make default simulator as iPhone

白昼怎懂夜的黑 提交于 2019-12-05 10:58:55
问题 I downloaded latest XCode with iOS 4.2 version. When I'm testing any app in simulator, its running in ipad simulator by default. How can I make my simulator default to iPhone. 回答1: Solution#1 You can remove the iPad from the organizer. I haven't tried it, since I use both iPhone and iPad. Solution#2 Create a keyboard shortcut to switch to to the iPhone simulator top menu > Project > Set Active Executable > Targetname - iPhone Simulator See these screenshots 回答2: I hope this is what you're

How to figure out “Color of a specific pixel” in an image?

烂漫一生 提交于 2019-12-05 10:54:38
问题 I have an image which is inside an Image View. I want to find the color of a specific pixel (say x=10, y=20) inside the image. Working code would really help me out. 回答1: That depends very much on the type of image :) If you have the byte data, and you know how it is arranged, for example PNG uses RGBA then you've got a leg up. Liberal use of all the CGImageFunctions like CGImageGetBitsPerComponent and CGImageGetColorSpace will be your guide. To get the actual byte data,

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

自作多情 提交于 2019-12-05 10:40:31
问题 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

Is there any way to use apple's Touch ID (fingerprint scanner) on iOS Simulator?

℡╲_俬逩灬. 提交于 2019-12-05 10:04:51
问题 I am working on an app which would require Touch ID Authentication, so is there any way i can use Touch ID (fingerprint scanner) in the simulator ? Also, please do share some kind of example code for using LocalAuthentication framework. 回答1: As of Xcode 7 the Simulator supports 'touchID'. Answer below contains further info. As of the latest beta (6) there is no way to simulate a fingerprint scan on the simulator. To be honest I doubt this will be included even in later betas. You will need to

Reading from Keychain Xcode 9 simulators returns nothing

試著忘記壹切 提交于 2019-12-05 09:18:15
Since I'm using Xcode 9, all unit tests communicating with keychain are broken. It also happens with Xcode GM. As I traced, there is no OSStatus errors while reading and writing but reading from keychain returns nothing and causes failure for all unit tests using keychain. I've already faced something like this when Apple released Xcode 8 with iOS 10 simulator which keychain was not working and Apple fixed that in Xcode 8.2. Is anybody else facing this issue with iOS 11 simulator too? Any idea on this? Elyas Naranjee Sani Finally we found the problem. As @Gix said the problem is with unit

What is “Terminating in response to backboardd's termination”?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 09:05:42
i use a piece of code for drop shadow on a view with help of slider. Slider is set -15 to 15. This code works awesome when slider.value is positive but app stop working if its negative. the crash log is weird Terminating in response to backboardd's termination . i got this log first time. What is that? here is my code. childViews.layer.shadowColor = [[UIColor blackColor] CGColor]; childViews.layer.shadowOffset = CGSizeMake(slide,slide); childViews.layer.shadowOpacity = 1.0; childViews.layer.shadowRadius=10; childViews.layer.masksToBounds = NO; childViews.layer.shouldRasterize = YES; backboardd

Xcode 9 iOS 10 / 11 Simulators - All Apps Crashing [duplicate]

别来无恙 提交于 2019-12-05 08:01:53
问题 This question already has an answer here : Xcode 9 iOS Simulator - Unable To Obtain Valid Process Handle (1 answer) Closed 2 years ago . I just installed Xcode 9 and tried running the iOS 11 and 10.3.1 simulators. Weirdly, ALL the stock apps in the simulator are crashing / force closing the moment I click on any of them, i.e. Safari, Photos, etc. I've tried it on iPhone X, iPhone 8/8+ and iPhone 6+ simulators with iOS 11 / 10.3.1, all with the same crashing result. If I try it on older iOS

Xcode UI testing - login/logout with stored credentials

為{幸葍}努か 提交于 2019-12-05 07:59:40
I want to run functional (UI) tests for the login procedure in my iOS app (Xcode 7.2.1). The app's behaviour is that upon successful login, user credentials are stored in order to automatically login (without showing the login screen) in the next launches. So I set up a sequence of UI events in the login screen to make the login test pass on the first time the app launches in the iOS Simulator. However, next times I run my tests will fail, since the login screen doesn't even show up as expected. I see two options here, none of them seem to fit well: Reset iOS Simulator's content and settings

How to set the location in the iOS simulator without writing code?

和自甴很熟 提交于 2019-12-05 07:05:33
My problem was how to set the gps location of my app when running in the iOS simulator The home screen in my app displays sunrise and sunset times based on gps location and I wanted a screen shot with sensible values - I'm in the UK and the sunrise times were showing UK times for American sunrise and sunset. As it is on the launch screen one solution, going to Debug -> Simulate Location, is too late for me. Took me a while to work out and I wasn't finding the answer when I searched here (maybe not asking the question the right way . So I'm going to answer my own question below in the hope it

Selecting the iOS Simulator device type with RubyMotion

半城伤御伤魂 提交于 2019-12-05 05:36:12
Since iOS 8 was released the default device type for simulator became iPhone 6. And even if I manually change the device type using Hardware > Device menu, on the next launch (using rake simulator ) the simulator will revert to iPhone 6. I wonder if there is any rake options, or some other settings to force the device type. PS. I know that there are ways to force a non-retina iPhone and a way to launch the iPad simulator instead of the iPhone one, but I'm interested in selecting between 5/6/6+. Thanks zhulinpinyu Run /Applications/Xcode.app/Contents/Developer/usr/bin/simctl list (or