Posts tagged 'apple'

Adding Photos to iOS Simulator

I'm currently using Snapshot, part of Fastlane to automate the testing and screenshot capture of our app.

The problem I had, is that a part of our app involves capturing a photo from the camera or photo library for display in the app. And to do the screenshots justice I needed to use a specific image as opposed to the images shipped with the simulators. You can't use the camera on the simulator (obviously!).

You can simply just drag an image onto the simulator and it will put it into the Photos app on the device. But I needed to script the addition of the photos as the simulators are reset at the start of each run.

Well, I found a way to do it using the hooks provided in Snapshot to prepare the simulator before run, and simctl.

Just add the following callback to your fastlane/Snapfile file:

setup_for_device_change do |device, udid, language|
    puts "Adding food photo to #{device}"
    system("xcrun simctl boot #{udid}")
    system("xcrun simctl addphoto #{udid} kale_salad_photo.jpg")

Obviously change the filename to the image you want to load. You could extend it to load all images from a directory if you wanted.

iOS Deployment and Provisioning - Part III - Tools in Detail - Fastlane

Details of the specific fastlane configuration we use and how we arrange alpha and release builds

iOS Deployment and Provisioning - Part II - Rational

The reasoning behind our build process, how it solves the problems of building and signing builds with a distributed team

I Love our Build System

It's 7:30am, a director has reported a problem with our app whilst at a trade show. Help! How our build system saved the day.

iOS Deployment and Provisioning - Part I - Terminology

The first problem I had coming into iOS development was working out how all the parts related - certs, profiles, keys, schemes, etc