Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure compatible arch before launching on device #80

Conversation

jmoody
Copy link
Contributor

@jmoody jmoody commented Nov 27, 2014

Motivation

Before launching an app on iOS, ensure that the architecture of the CFBundleExecutable is compatible with the target device. #75

If the binary and the simulator target are not compatible, an error will raised before launch.

RunLoop::IncompatibleArchitecture: Binary at:
/Users/moody/git/run-loop/spec/resources/lipo/x86_64/chou.app/chou
does not contain a compatible architecture for target device.
Expected 'i386' but found ["x86_64"].

Todo

  • I think we need some error handling in the RunLoop::Lipo class. UPDATE: Let's forgo the error handling until becomes an issue.

Missing behaviors

There are two compatibility checks that are missing: is the binary compatible with a physical device and is the binary compatible with the form factor.

Checks against physical devices will require integrating a tool like ideviceinfo because we cannot find information about a device's instruction set using Xcode tools; all we have is the UDID.

We can check that the binary is compatibility with the form factor (e.g. Is this an iPad only app?) by inspecting the Info.plist. This behavior belongs in another PR.

Testing

$ be rake spec/integration/simulator_compatibility_spec.rb
Simulator/Binary Compatibility Check
  raises an error if libraries are not compatible
    targeting i386 simulator with binary that contains only a x86_64 slice
    target only has arm slices
  can launch if library is FAT
    targeting x86_64 simulator with binary that contains only a i386 slice
    can launch if libraries are compatible

@krukow @svevang

jmoody and others added 30 commits November 17, 2014 12:58
Signed-off-by: Sam Vevang <sam.vevang@gmail.com>
Signed-off-by: Sam Vevang <sam.vevang@gmail.com>
Signed-off-by: Joshua Moody <joshuajmoody@gmail.com>
Signed-off-by: Sam Vevang <sam.vevang@gmail.com>
Signed-off-by: Sam Vevang <sam.vevang@gmail.com>
…nching-on-device

Needed changes from develop to ensure passing rspec tests
on Xcode 6.2b and travis ci Xcode 6.1.1.

Also required behaviors from develop to complete task.

Conflicts:
	lib/run_loop/device.rb
To be compatible with the output of `lipo` and ideviceinfo
jmoody added a commit that referenced this pull request Dec 1, 2014
…ore-launching-on-device

Ensure compatible arch before launching on device
@jmoody jmoody merged commit e0b70ab into calabash:develop Dec 1, 2014
@jmoody jmoody deleted the feature/ensure-compatible-arch-before-launching-on-device branch January 30, 2015 15:25
This was referenced Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants