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

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

Closed
jmoody opened this issue Nov 14, 2014 · 3 comments

Comments

@jmoody
Copy link
Contributor

jmoody commented Nov 14, 2014

Quoting @krukow

Let's have Calabash Ruby and UITest sanity check the CFBundleExecutable for compatibility with the targeted device/sim (found with instruments -s devices).

I've had too many support cases where it looks like Calabash is unable to launch but really the app can't run on the desired device.

@jmoody
Copy link
Contributor Author

jmoody commented Nov 14, 2014

@svevang and I did a first pass analysis of this.

With respect to simulators, I believe this problem can only occur in the CoreSimulator environment, but I might be wrong about that.

Sam and I paired on this and could reproduce using $ simctl

  1. You can install an arm binary on the simulator, but it will not launch. Simulator logs indicate that there is an architecture problem.
  2. You can install a x86_64 binary (built for iPhone 6) on an iPhone 4S simulator (i386), but it will not launch. The simulator logs indicate only that the app has crashed.
  3. From the command line, it is difficult to generate a non-FAT binary; we had to use Xcode + Build for Active Architecture Only build setting. Build for Active Architecture Only is the default in Xcode 6 and possibly Xcode 5. We could not coerce a non-FAT binary from the command line.
  4. We can use lipo -info < path to binary > to see the architectures.
  5. We can use lipo < path to binary > -verify_arch <arch> to get back a correct exit code via $?.
  6. There is no programmatic way determine if a simulator is i386 or x86_64. Our only option is maintain a list of i386 and x86_64 simulators.
  7. We can inspect the Info.plist to find the name of the target executable - CFBundleExecutable
  8. If we build for the iPhone 4s from Xcode, we can install on the iPhone 6 simulator.

@jmoody
Copy link
Contributor Author

jmoody commented Nov 19, 2014

@jmoody
Copy link
Contributor Author

jmoody commented Nov 26, 2014

Summary

If the binary contains i386, it can run the x86_64 simulator. The inverse is not true; an x86_64 only binary cannot run on the i386 simulators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant