ios-simulator

Swift how to use NSTimer background?

狂风中的少年 提交于 2019-11-26 20:44:58
问题 class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() var timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("update"), userInfo: nil, repeats: true) } func update() { println("Something cool") } } It's ok for the Simulator ,I will get continuous "Something cool" through I tapped the home button. But it worked out when I debug the app with my iPhone. I did't get anything when I tapped the home button and make my app run

iOS permission Alerts - removing or suppressing

淺唱寂寞╮ 提交于 2019-11-26 20:27:49
问题 I have a simple app running on ios simulator which will (at some point in the app), prompt the user to authorize the following: Location setting Address contact book Pictures/Albums Because I am doing automation testing on the iOS simulator (several thousand on virtual machines), is there a way to force iOS simulator to have these permissions already set to yes when the app is installed? I vaguely remember there was a way to manipulate this using a plist file associated with iOS simulator,

xcode8 list of simulators not showing

淺唱寂寞╮ 提交于 2019-11-26 20:05:32
问题 I have been only recently working with Xcode 8 beta 4 but it has been working fine up until now. The list of simulators is not showing for any of my projects. I already tried Creating a new Scheme and it did not work. How do I fix this? 回答1: Deleting derived data and restarting Xcode worked in my case. rm -rf ~/Library/Developer/Xcode/DerivedData/* 回答2: Ensure your Deployment Target version in Build Settings is also set to the desired version (and that you have that version of the respective

Xcode compiles my App, but can't run it in the simulator

笑着哭i 提交于 2019-11-26 19:40:55
问题 when i compile my app, Xcode just says "Attaching to Projectname..." and gets stuck there. The debugger just prints this out: error: failed to attach to process ID 0 I tried to clean & build again and it still doesn't work out. I googled but couldn't find anything helpful. How can I fix this problem? Thank You! 回答1: The solution for me was to delete everything Xcode has generated earlier: the App on the Simulator...if this is not possible because you cant reach the Homescreen, you can delete

How can I get the console logs from the iOS Simulator?

瘦欲@ 提交于 2019-11-26 19:18:39
I want to see what happens in the iOS Simulator if I'm not testing the app in Xcode. For example, if I open a link in the Safari simulator, see what happens in the console, or if I install a web-app, see the links that I'm pressing in console. How can I do this? I want to see it in Xcode or Terminal, but it's not a problem if I need to use another bit of software. fbernardo iOS Simulator > Menu Bar > Debug > Open System Log Old ways: iOS Simulator prints its logs directly to stdout, so you can see the logs mixed up with system logs. Open the Terminal and type: tail -f /var/log/system.log Then

Xcode 6.4 showing duplicate 'Simulators' with Unique Id

会有一股神秘感。 提交于 2019-11-26 18:48:02
问题 Till yesterday, everything was normal with Xcode. It was showing simulators as : But today, when I opened it, simulator list changed to : Every simulator can be seen twice, name followed by a unique id. I have also observed that same named Simulator are also two different instances. Can anyone help me, how to get rid of this ? Or how to reset it. It gives a weird look. Any suggestion will be helpful. 回答1: I have an easier way to fix this. Run the following: xcrun simctl list devices | grep -v

ios simulator: how to close an app

可紊 提交于 2019-11-26 18:47:49
问题 When you "run" the simulator from xCode, the app automatically launches, and then you can click the home button to suspend the app. What I want to do is close the app from within the simulator. So, how can this be done? 回答1: You can also do it with the keyboard shortcut shown under the simulator menu bar (Hardware-> Home). The shortcut is ⌘ + ⇧ + H , but you need to hit H twice in a row for it to simulate the double press that shows the apps. 回答2: For iOS 7 & above: shift+command+H twice to

Does the iPhone simulator in Xcode support Bluetooth Low Energy?

丶灬走出姿态 提交于 2019-11-26 18:47:24
I'm trying some iOS test applications on the new Mac mini, that supports Bluetooth Low Energy. The CoreBluetooth framework is used in those. However, I'm not able to get Bluetooth working in the iPhone simulator, that is part of Xcode. When I allocate a new CBCentralManager , centralManagerDidUpdateState: receives CBCentralManagerStatePoweredOff which stands for Bluetooth is currently powered off. The first time I ran the text application, a box was then opened up that looked pretty bugged (only language variables were used, not the actual texts) and with two buttons. The first led me to the

How to programmatically display version/build number of target in iOS app?

£可爱£侵袭症+ 提交于 2019-11-26 18:44:32
问题 How can I programmatically get the value of the target version , like in the image below? As seen in the Properties window of the target of my Xcode project. I want to display this in the splash screen of my app so I know which version the people are currently using? 回答1: There are 2 Numbers! The marketing release number is for the customers, called version number . It starts with 1.0 and goes up for major updates to 2.0 , 3.0 , for minor updates to 1.1 , 1.2 and for bug fixes to 1.0.1 , 1.0

Sound not working in iPhone Simulator?

落爺英雄遲暮 提交于 2019-11-26 18:40:34
Somehow my iPhone Simulator is unable to play sounds. First an app I'm working on using AudioServicesPlaySystemSound() stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device. I get the same results with other iPhone apps such as the sample Crash Landing app. I can't find a sound setting anywhere in the simulator or Xcode preferences. I've tried resetting the simulator through "Reset Content and Settings" menu item to no avail. On your Mac, go to System Preferences > Sound > Sound Effects and then uncheck and recheck "Play user