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

Apple silicon #12333

Merged
merged 13 commits into from Dec 15, 2020
Merged

Apple silicon #12333

merged 13 commits into from Dec 15, 2020

Conversation

sgtcoolguy
Copy link
Contributor

@sgtcoolguy sgtcoolguy commented Dec 10, 2020

JIRA: https://jira.appcelerator.org/browse/TIMOB-28281

Description:

  • Updates to node-ios-device 1.9.0
    • I manually built and uploaded pre-built arm64 Darwin binaries to S3
    • "hacks" that package to not try and download Node 0.10 pre-built binary during our packaging
  • fixes running unit test app hook for iOS when ANDROID_SDK is not set (unrelated to arm64/Apple Silicon)
  • Modified the way we modify Ti.Platform.model to append ' (Simulator)' - instead of runtime arch check to do so (checking for i386 or x86_64), we use macros/guards for TARGET_OS_SIMULATOR (which I've also replaced usage of TARGET_IPHONE_SIMULATOR with, as that's deprecated)

Android is a bit of a beast to get running. Getting set up is easiest by grabbing Android Studio and letting it install the pieces you need. Trying to grab the emulator component from the sdkmanager won't work, it filters it out due to arch. But x86/x86_64 emulators won't launch anyways so that effectively becomes a non-issue.

There's a preview ARM64 emulator at https://github.com/google/android-emulator-m1-preview/releases
You need to launch that manually, then run the app as if it's a "device" for our CLI: ti build -p android -T device

Due to known issues in that emulator, it will hang on the Ti.Media.AudioPlayer test suite. I suspect others would do the same: VideoPlayer, Ti.Ui.WebView, etc. Haven't had a chance to comment out some suite and see.

@build build added this to the 10.0.0 milestone Dec 10, 2020
@build build requested a review from a team December 10, 2020 18:43
@build
Copy link
Contributor

build commented Dec 10, 2020

Fails
🚫 Tests have failed, see below for more information.
Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 13 tests have failed There are 13 tests failing and 1074 skipped out of 17188 total tests.

Tests:

ClassnameNameTimeError
android.emulator.Titanium.UI.Clipboard.methods#hasText() returns true after setData('text/plain', value) (11)0.014
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:313:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#hasText() returns true after setData('text', value) (11)0.011
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:306:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#hasText() returns true after setText() (11)0.006
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:299:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#hasData() returns false for other mimeTypes (11)0.009
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:249:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#hasData() assumes text mimeType with no argument (11)0.007
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:237:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#getText() returns given string after setData('text/plain') (11)0.006
Error: expected null to equal 'setData'
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:178:35)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#getText() returns given string after setData('text') (11)0.007
Error: expected null to equal 'setData'
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:171:35)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#getText() returns given string after setText() (11)0.007
Error: expected null to equal 'setText'
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:164:35)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#getData() returns 'text' data type (11)0.036
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:113:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#clearText() makes hasText() return false after being called (11)0.005
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:83:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.methods#clearData() clears 'text' data type (11)0.009
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:59:42)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.Clipboard.examplesCopy Text to the Clipboard (11)0.008
Error: expected null to equal ''
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Context.<anonymous> (/ti.ui.clipboard.test.js:455:35)
      at Test.Runnable.run (/ti-mocha.js:6535:54163)
      at Runner.runTest (/ti-mocha.js:6535:58604)
      at /ti-mocha.js:6535:59445
      at next (/ti-mocha.js:6535:58013)
      at /ti-mocha.js:6535:57975
      at next (/ti-mocha.js:6535:57665)
      at /ti-mocha.js:6535:57759
android.emulator.Titanium.UI.WebViewblacklistedURLs (11)35.809
Error: timeout of 30000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)

New dependencies added: node-ios-device.

node-ios-device

Author: Axway, Inc.

Description: Simple library for detecting and installing apps on iOS devices

Homepage: https://github.com/appcelerator/node-ios-device

Createdabout 7 years ago
Last Updated13 days ago
LicenseApache-2.0
Maintainers3
Releases64
Direct Dependenciesdebug, nan, node-pre-gyp and node-pre-gyp-init
Keywordsappcelerator, ios, iphone, ipad, install, mobiledevice, mobile, device and devices
README

node-ios-device

Queries connected iOS devices, installs apps, and relays log output.

Prerequisites

node-ios-device only works on macOS 10.11 or newer. It use N-API version 3 and requires Node.js
10.13.0 LTS or newer.

Installation

npm install node-ios-device

CLI

$ node-ios-device

USAGE: node-ios-device <command> [options]

COMMANDS:
  forward               Connects to a port on an device and relays messages
  i, install            Install an app on the specified device
  ls, list, devices     Lists connected devices
  watch, track-devices  Listens for devices to be connected/disconnected

GLOBAL OPTIONS:
  --no-color     Disable colors
  -h, --help     Displays the help screen
  -v, --version  Outputs the version

Example

import iosDevice from 'node-ios-device';

// get all connected iOS devices
const devices = iosDevice.list();
console.log('Connected devices:', devices);

// continuously watch for devices to be connected or disconnected
const handle = iosDevice.watch();
handle.on('change', devices => {
    console.log('Connected devices:', devices);
});
handle.on('error', console.error);

// install an iOS app
iosDevice.install('<device udid>', '/path/to/my.app');
console.log('Success!');

// relay output from a TCP port created by an iOS app
iosDevice
    .forward('<device udid>', 1337)
    .on('data', console.log)
    .on('end', () => console.log('Device disconnected'));

API

list()

Retrieves an array of all connected iOS devices.

Returns an Array of device objects.

Device objects contain the following information:

  • udid - The device's unique device id (e.g. "a4cbe14c0441a2bf87f397602653a4ac71eb0336")
  • name - The name of the device (e.g. "My iPhone")
  • buildVersion - The build version (e.g. "10B350")
  • cpuArchitecture - The CPU architecture (e.g. "armv7s")
  • deviceClass - The type of device (e.g. "iPhone", "iPad")
  • deviceColor - The color of the device (e.g. "Black", "White")
  • hardwareModel - The device module (e.g. "N41AP")
  • modelNumber - The model number (e.g. "MD636")
  • productType - The product type or model id (e.g. "iPhone5,1")
  • productVersion - The iOS version (e.g. "6.1.4")
  • serialNumber - The device serial number (e.g. "XXXXXXXXXXXX")

There is more data that could have been retrieved from the device, but the properties above seemed
the most reasonable.

watch()

Continuously retrieves an array of all connected iOS devices. Whenever a device is connected or
disconnected, the 'change' event is emitted.

Returns an EventEmitter-based Handle instance that contains a stop() method to discontinue
tracking devices.

Event: 'change'

Emitted when a device is connected or disconnected.

  • {Array<Object>} devices - An array of devices

Example:

const handle = iosDevice.watch()
    .on('change', console.log);

setTimeout(() => {
    // turn off tracking after 1 minute
    handle.stop();
}, 60000);

install(udid, appPath)

Installs an iOS app on the specified device.

  • {String} udid - The device udid
  • {String} appPath - The path to the iOS .app

Currently, an appPath that begins with ~ is not supported.

The appPath must resolve to an iOS .app, not the .ipa file.

forward(udid, port)

Relays messages from a server running on the device on the specified port.

  • {String} udid - The device udid
  • {String} port - The TCP port listening in the iOS app to connect to

Returns a Handle instance that contains a stop() method to discontinue
emitting messages.

NOTE: forward() only supports USB connected devices. Wi-Fi-only connected devices will not work.

Event: 'data'

Emitted for each line of output. Empty lines are omitted.

  • {String} message - The log message.

Event: 'end'

Emitted when the device is physically disconnected. Note that this does not unregister the internal
callback. You must manually call handle.stop() to cleanup.

Example:

const handle = iosDevice
	.forward('<device udid>', 1337)
    .on('log', console.log)
    .on('end', () => console.log('End of forward'));

setTimeout(function () {
	// turn off logging after 1 minute
	handle.stop();
}, 60000);

Advanced

Debug Logging

node-ios-device exposes an event emitter that emits debug log messages. This is intended to help
debug issues under the hood. The average user will never need to use this, however it would be
handy when filing a bug.

iosDevice.on('log', msg => console.log(msg));

Alternatively, node-ios-device uses the amazing snooplogg debug logger where you simply
set the SNOOPLOGG environment variable to node-ios-device (or *) and it will print the debug
log to stdout.

License

This project is open source under the Apache Public License v2 and is developed by
Axway, Inc and the community. Please read the LICENSE file included
in this distribution for more information.

Generated by 🚫 dangerJS against 2eea043

@sgtcoolguy sgtcoolguy force-pushed the apple-silicon branch 4 times, most recently from ac8cc46 to 2bfdae0 Compare December 14, 2020 19:53
@sgtcoolguy sgtcoolguy merged commit 9f3e077 into tidev:master Dec 15, 2020
@sgtcoolguy sgtcoolguy deleted the apple-silicon branch December 15, 2020 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants