ios-simulator

Programmatically setting iphone simulator location

北城余情 提交于 2019-11-30 03:13:46
问题 I've just updated to XCode 4.2 and I see a cool feature that allows me to manually set the device location. Does anyone know of a way to accomplish the same thing programmatically? I'd like to set the location in some unit tests. 回答1: The following AppleScript will let you set the location of the iOS Simulator. It should be possible to integrate this kind of script into a unit test script, or have your script generate the equivalent AppleEvents. tell application "iOS Simulator" activate end

Xcode cannot run using the selected device

泪湿孤枕 提交于 2019-11-30 02:55:48
问题 I am receiving the following error when I try to run my Xcode iOS project: Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device. I have had this error for a while now. I was able to get around it by using an actual device instead of a simulator, but now that doesn't work either. I haven't changed a single setting in the project since creating it, all that I have changed is the code itself. This has also happened before

Reset the contents and settings all iOS-simulators

本小妞迷上赌 提交于 2019-11-30 02:00:47
Is there any option to reset the contents and settings of all the simulators ?In a single event or a single command via command line? Stian Høiland I present, The Definitive iOS Simulator Reset Script (link) Based on Oded Regev's code from this SO question (which was based on Jacob Rus's fine "menu_click" code ) Based on the the answer from Jeremy Huddleston Sequoia I wrote a shell script that will reset all simulators. For Xcode 7 you can use: #!/bin/sh instruments -s devices \ | grep "(\d[.0-9]\+) \[[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}\]" \ | grep -o "[0-9A

Unable to start my application in full screen on iPhone 6.0 Simulator Retina 4 Inch

我是研究僧i 提交于 2019-11-30 01:56:49
I have added Default-568h@2x.png to my project and set it in project settings, I have also set autoresizing options for my view and elements on that view which is initially loading on my application which is landscape-only, but after running my application in iOS 6.0 Simulator Retina 4 inch I see my application moved all the way left, leaving black pixel area on the right. Any idea what should I do beside these things in order to see my application runs in "full screen" on iOS 6.0 Simulator Retina 4 inch? [edit #1: AppDelegate] I also edited my AppDelegate.m like this: viewControllerMain = [

Forcing landscape and autorotate in iOS 7

ⅰ亾dé卋堺 提交于 2019-11-30 01:55:45
问题 My app is supposed to be landscape only, and I had no problem with this when building for iOS 6 and earlier. Now with iOS 7, It won't rotate at all. In my app settings, I have it set to landscape left/right only. In my view controller, i'm using the following: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight; } I also used to use this, which is now deprecated: - (BOOL)shouldAutorotateToInterfaceOrientation:

How to 'Build & Run' on multiple destinations at once in Xcode?

♀尐吖头ヾ 提交于 2019-11-30 01:53:02
How can one run a project on multiple destinations (say, iPhone, iPad and iSimulator) at once ? There are 2 related questions: Xcode 4 - One Click Build to Multiple Devices? Run on simulator and phone with one click The 1ˢᵗ question (supposedly) has an answer, but I can't figure out how exactly should you use the Aggregate target (if this is the right direction at all), and apparently neither could Josh Kahane, the OP; the "answer" still somehow got/remained accepted. The 2ⁿᵈ question was closed down as a "duplicate", as if the 1ˢᵗ one provided a (workable) answer. Added a bounty: (how) can

Reduce the Xcode Simulator (Retina 4 inch)

一世执手 提交于 2019-11-30 01:41:59
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? You can scale it with the following shortcuts: ⌘ + 1 : 100% ⌘ + 2 : 75% ⌘ + 3 : 50% ⌘ + 4 : 33% ⌘ + 5 : 25% Or in iOS Simulator: Window > Scale > ... 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. Now It's more flexible with Xcode 9-Simulator. You can pick & drag any corner or simulator to resize it and set it according to your requirement

Xcode 9 iOS Simulator becoming black screen after installing Xcode 10 beta

痴心易碎 提交于 2019-11-30 01:15:02
问题 I know that so many people have asked this question earlier. But I think my situation is different. In my case Xcode 9.2 was already installed and I upgraded macOS from 10.13.2 to 10.13.5. Then I installed Xcode 10 beta. Now when I'm running any project on Xcode 9.2 and try to use simulator, its becoming black though I can see the xcode logs. Things I have tried so far, Uninstalled Xcode 10 Beta Uninstalling & reinstalling Xcode 9.2 Uninstall Xcode 9.2 and install Xcode 9.4 Reset Content &

how to launch ios simulator from phonegap

和自甴很熟 提交于 2019-11-30 00:59:16
问题 when i try to launch ios simulator from command line by using $ phonegap run ios i get the below error Error: ios-sim was not found. Please download, build and install version 1.5 or greater from https://github.com/phonegap/ios-sim into your path. Or 'brew install ios-sim' using homebrew: http://mxcl.github.com/homebrew/ i even tried copying the above ios-sim folder into my path. still getting an error. 回答1: Best Solution: Make sure you have XCode and its command line tools installed and

Apps manually installed in simulator crashes upon load

混江龙づ霸主 提交于 2019-11-30 00:59:10
问题 I'm installing MyApp on the iOS simulator (Xcode 7, iOS 9) using xcrun simctl install booted MyPath/MyApp.app . This works as expected and the app is installed on the simulator. However, launching the app either manually or using xcrun simctl launch booted com.company.MyApp fails. Giving back the error: An error was encountered processing the command (domain=FBSOpenApplicationErrorDomain, code=1): The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 1.) The app is