Test code on older iOS version - ios

I have a piece of code that has a specific behavior under iOS9. However, I know that it didn't always behave in the manner it does under iOS9. I wanted to run it on previous versions, so I could discover when the behavior was fixed.
Unfortunately, Xcode 7 seems to only support simulators back to iOS 8.1.
Short of reinstalling previous iOS versions on an actual device, is there any way to install and run simulators for earlier iOS versions? Or, is there another method to accomplish my goal?
EDIT
This edit is to explain why I do not think this post is a duplicate, as indicated in the close request. Hopefully, in explaining why it is not a duplicate, it also better explains the issue and hopefully results in a solution.
#JeremyHuddlestonSequoia - Thanks for the input. That post has really good information. However, I don't consider this a duplicate for several reasons.
I already knew that information, and it didn't keep me from asking this question. So, for whatever reason, it does not give me what I'm looking for.
I don't consider questions to be duplicates if one is talking about the behavior of a beta release and the other is talking about the behavior oaf a production release.
I don't want to know how to install older simulators. I want to know if there is another way to run the simulators outside of the Xcode preferences. I think it is completely absurd that Apple have determined that nobody in the world needs to run older simulators with newer versions of Xcode. Thus, I'm looking for some alternative to the solutions in the possible duplicate question.
If there is no other way to install the simulators, maybe there is some online resource that has simulators available going back to iOSx.y that may be accessed, even if that access is for-pay. Or, maybe there is some online resource that runs stuff on actual devices, and I can submit my code to that resource.
Maybe there is some other way I haven't thought of for me to get the answers I am looking for. Basically, I want to know in which exact release of iOS a specific behavior changed. Thus, I want to run a small piece of code on different iOS versions until I witness the difference.
The fallback is to reinstall each OS on a device. Maybe someone knows of a way to do this programmatically so I can kick off the process and have it run on it's own. There are a bunch of possibilities, but I am unaware of what's out there to deal with this issue.
I was hoping that there was some way to install older simulators. The first paragraph of the original post explained my ultimate goal. The last sentence of the original post summed up the difference between this post and that post.
I'm not just looking for a way to install older simulators. That would be a WONDERFUL way to accomplish my goal. I'm looking for a way to test code on older iOS versions. Using the simulator is one possibility... if there is some way to convince Xcode to do it on something older than 8.1.

Related

Is there a way to just apply changes in iOS simulator without rebuilding the whole app?

I'm asking because this is a feature of android studio and was wondering if xcode or an external thing had something similar?
Yes, there is:
https://apps.apple.com/app/injectioniii/id1380446739 or from here https://github.com/johnno1962/injectionforxcode Also, I think you can get it through Alcatraz too if you have it on your XCode
Also, another tip if you have not made any changes and just want to attach the debugger and run the app without building you can do: CMD+Control+R which will run the app instantly without building.
It's would be very useful feature for development, if the same would be possible with upcoming version.
But unfortunately, as of now, with current latest version of Xcode, it is not possible to apply source code changes without rebuilding an application.
Nice question, it deserves space in Apple Bug Reporter...

Can I integrate my UIAutomation Tests with XCode and set automitically run them every night?

I need to know if I can do Continuous Integration with XCode server. In example: set run the tests every night or when someone commit changes, and more..
I am trying to decide one iOS Ui Automation tool to integrate with my Xcode server
Thanks
There are a few problems here:
UIAutomation has no built in support in Xcode Server. I've filed bugs, I've chased down people at WWDC. Most I've ever gotten on this problem is basically "shrug." I'm not sure UIAutomation is a priority for Apple right now. So you're not going to get any official support.
As was noted, you might be able to use a trigger. The trigger won't be able to add anything to the Xcode Server report, besides possibly the error logging. But you're not going to get anything added to the nice report table.
Running on actual devices has traditionally been a problem (if you care about that.) The loading the app part has been a problem for us, but Xcode Server might be able to preload the app for you. In addition, it seems like this might have changed in the iOS 8 SDK.
There is just a lot of uncertainty around this sort of workflow. I'm hoping Apple eventually makes an announcement or adds a new tool, but the best answer I've gotten is if you want to go down this path, use UI Unit Tests. That's a shame because it requires knowledge of Obj-C or Swift, and means interacting with the app at an API level instead of an abstract level, but if you're looking for the direction Apple wants to see people go, that's it.
Edit 7/4/2015: As of WWDC 2015, there is a new UI Testing component as part of Xcode 7 that, in my experience, seems totally supported, and is promising Xcode Server support. I would very strongly recommend using that, and not using the Instruments UIAutomation tool.
With Xcode6 right around the corner they are adding some features to XCode Server specifically it looks like "Triggers" will be helpful for running iOS UIAutomation tools. Since you can run UI automation scripts from cmd line it should be possible to utilize triggers to run your scripts post builds. This along side the logic for when a bot should run will let you decide if it should be nightly or on every commit.
https://developer.apple.com/library/prerelease/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_6_0.html#//apple_ref/doc/uid/TP40014509-SW1
I wrote a framework around UIAutomation called Illuminator to handle tasks like nightly test runs, pull request tests, and other automated conveniences.
It provides a flexible and extensible command line that can execute any particular subset of tests that you'd like, and produces reports in JUnit format (used by Jenkins).

Base SDK Missing

I get the "BASE SDK Missing" when re-opeing projects. (I got the latest build of xcode, and latest SDK installed.)
It seems to be happening when I quit a project, (not exiting xcode), and re-open the project after a while. I have tried both, with and without my iPhone plugged in. I have tried to fix the problem like described here, but it does not help for me. - It just makes it even worse! (unrecognizable SDK)
The only way I have managed to get it back to normal, is to do a manual re-boot of my mac, plugged in my phone, waited until it has checked my iPhone, and then, opened xcode. Time consuming and annoying!
Why does it happen and what is the trick to fix this?
Your recent upgrade of Xcode likely removed the earlier SDK that your project was set to use. There are a couple of solutions for the problem. The most simple solution is to always select the "Latest" SDK in your project's settings and not select a specific option. You may be uncomfortable with the idea and want to run your app on an older device but it's important you understand that all of the newer SDKs can generate code that works on older versions of iOS. There's a separate hard to remember option for setting the deploy target. (It took me a while to learn how/why to use this but it's well worth it.)
The second option is to actually find a version of the SDK that your project is set to and attempt to reinstall it. I suggest going this route only if necessary as it's not guaranteed to work in each case. Older SDKs may or may not work in later versions of Xcode (Eg. SDK 3.0 might not work in Xcode 4.3.2) due to major changes in the toolchains. Tools like gcc/gdb are deprecated in favor of llvm/lldb. Still, you may have a valid reason for using an older SDK. You may have to fix a bug that is present only when using the older toolchain or you may need to reproduce a problem that only happens with builds generated from your build server. In many of these cases it might be easier to upgrade where the problem occurs (Eg. upgrade the tools on the build server) or downgrade your dev environment. (Install an older version of Xcode.)
The reasoning behind the frustration is that Apple highly encourages rapid adoption of it's latest tools and technologies. It creates a better product as the dev community is forced to stay current and competitive while the users are forced to maintain upgrades to ensure apps continue to work. This is in contrast with the traditional model of backward compatibility allowing developers to support revision -n of a product/platform. It is also great for business since rapid adoption of the latest often encourages purchase of newer hardware and products to get the best experience. The rapid adoption ensures the more robust software along with bug fixes, enhancements make it to the majority of consumers overall increasing their penetration in the market.
You have to set your target and project's base SDK to "Latest" and not an explicit option. If you choose one explicitly it seems to break if you update xcode versions.

XCode Autosave Broken?

I recently changed from developing iOS apps on a MacMini to a new MacBook Pro (2.2 GHz Intel Core i7). While working in XCode, I occasionally get pop-ups when the system is apparently trying to do an autosave and runs into a problem.
The pop-ups state "The document [filename] could not be autosaved. The file has been changed by another application. Click Save Anyway to keep your changes and save the changes made by the other application as a version, or click Revert to keep the changes from the other application and save your changes as a version."
Examples of the filename are: AppDelegate.m, MyLoginViewController.m. There shouldn't be anything else that is changing those files.
I can't do anything within XCode until I choose one of the options. Sometimes it seems like the system is trying to overwrite my newest code with an old version of my code, sometimes it seems like it is trying to save my newest code. So, sometimes Revert is what I need to do to keep my current version, and other times Save Anyway is what I need to do. However, sometimes, I can't tell what the system is trying to do and I choose the wrong option and lose hours of work.
This has happened numerous times over a span of three weeks.
I am using OS X 10.7.2 and XCode 4.2.1. The code is on my MacBook's hard drive.
Does anybody have any idea why this is happening?
Thank you.
This is a huge problem, and it looks like it's Lion's force-fed "file-versioning" that is destroying work.
I typed quite a bit of code into my source and saved it regularly (pretty much after every complete paragraph). Suddenly I couldn't find an entire section that I'd just written. I even did a project-wide search, in case I'd accidentally entered it in the wrong file. Suddenly Xcode raised a dialog saying it couldn't autosave the file because it had been modified externally. Did I want to "revert", or save what was in the editor?
In the several times I've seen this come up on two systems over the past few weeks, I've chosen to save what's in the editor, thinking that obviously it must be the most recent version. WRONG. I hit "Revert", and the block of code reappeared.
There is so much wrong here, it's hard to decide what's the most offensive.
Confirming that this happens on XCode 4.3.2 on an iMac running 10.7.4.
I have found that this bug may be related to having the same file open in more than one tab or window in XCode. If you carefully avoid ever having more than one window open on a given file at a time I think you can avoid this problem. However, it undermines the very useful ability to apple-click method names to navigate to the file that contains them.
This has cost me hours of original work and been the source of immense frustration. The derisive comments from others are simply inadequate.
I heard they had a complicated fix for it already at Apple, but unfortunately, it was "accidentally lost" and now they can't remember which files need what changes to make it work again. :-/

Blackberry OS 7

I have an App. that was built for BB OS 6. Wanted to know if it will work on the new OS 7 without any glitches.
If not, can it be ported without re-doing the entire thing.
It will work but as the devices probably will have different resolutions maybe you will have to made some code changes so de fields adapt better to the screen even if the code behave dinamically.
You can see it if you try your app in the simulator.
It will work without making any changes, as Blackberry 7 has backward compatibility for the builds. You might get some regulations issues, if your program is coded to behave dynamically then no issues.
Also, You don't really need to build again. Just go ahead and install on Blackberry 7. It will work.

Resources