Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Fix crash when launching applications on iOS device in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatme Havaluova authored and Fatme Havaluova committed Jan 15, 2016
1 parent a88ac7a commit 1d1f166
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions definitions/mobile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ declare module Mobile {
* Available for iOS only - the value of device's 'DeviceColor' property.
*/
color?: string;

/**
* Optional property describing the architecture of the device
* Available for iOS only - can be "armv7" or "arm64"
*/
activeArchitecture?: string;
}

interface IDevice {
Expand Down
15 changes: 15 additions & 0 deletions mobile/ios/ios-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ export class IOSDevice implements Mobile.IiOSDevice {
this.deviceInfo.version = this.getValue("ProductVersion");
this.deviceInfo.color = this.getValue("DeviceColor");
this.deviceInfo.isTablet = productType && productType.toLowerCase().indexOf("ipad") !== -1;

productType = productType.toLowerCase().trim();
let majorVersionAsString = _.last(productType.split(",")[0]);
let majorVersion = parseInt(majorVersionAsString);
let isArm64Architecture = false;
//https://en.wikipedia.org/wiki/List_of_iOS_devices
if (_.startsWith(productType, "iphone")) {
isArm64Architecture = majorVersion >= 6;
} else if (_.startsWith(productType, "ipad")) {
isArm64Architecture = majorVersion >= 4;
} else if (_.startsWith(productType, "ipod")) {
isArm64Architecture = majorVersion >= 7;
}

this.deviceInfo.activeArchitecture = isArm64Architecture ? "arm64" : "armv7";
}

private static mountImageCallback(dictionary: NodeBuffer, user: NodeBuffer): void {
Expand Down

0 comments on commit 1d1f166

Please sign in to comment.