Git Product home page Git Product logo

appium-ios-simulator's Introduction

Stand With Ukraine

Appium

Cross-platform test automation for native, hybrid, mobile web and desktop apps.

NPM version Monthly Downloads FOSSA Status StandWithUkraine


Documentation | Get Started | Ecosystem | Changelog | Roadmap | Discussion Forum


Appium is an open-source automation framework that provides WebDriver-based automation possibilities for a wide range of different mobile, desktop and IoT platforms. Appium is modular and extensible, and supports multiple programming languages, which means there is an entire ecosystem of related software:

  • Drivers add support for automating specific platforms
  • Clients allow writing Appium tests in your programming language of choice
  • Plugins allow to further extend Appium functionality

Migrating From Appium 1 to Appium 2

As of January 1st, 2022, the Appium team no longer maintains or supports Appium 1. All officially supported platform drivers are only compatible with Appium 2.

Please read the Migration Guide if you are still using Appium 1.

Warning

If you use Appium Desktop or Appium Server GUI, you will not be able to upgrade to Appium 2, as both of these tools have been deprecated. Please use Appium Inspector in combination with a standalone Appium 2 server.

Installation

Appium can be installed using npm (other package managers are not currently supported). Please check the installation docs for the system requirements and further information.

If upgrading from Appium 1, make sure Appium 1 is fully uninstalled (npm uninstall -g appium). Unexpected errors might appear if this has not been done.

npm i -g appium

Note that this will only install the core Appium server, which cannot automate anything on its own. Please install drivers for your target platforms in order to automate them.

Drivers

Appium supports app automation across a variety of platforms, like iOS, Android, macOS, Windows, and more. Each platform is supported by one or more "drivers", which know how to automate that particular platform. You can find a full list of officially-supported and third-party drivers in Appium Ecosystem's Drivers page.

Driver management is done using Appium's Extension command-line interface:

# Install an official driver from npm (see documentation for a list of such drivers)
appium driver install <driver-name>
# Install any driver from npm
appium driver install --source=npm <driver-name>
# See documentation for installation from other sources

# List already installed drivers
appium driver list --installed
# Update a driver (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium driver update <driver-name>
# Update a driver to the most recent version (may include breaking changes)
appium driver update <driver-name> --unsafe
# Uninstall a driver (it won't last forever, will it?)
appium driver uninstall <driver-name>

Clients

Client libraries enable writing Appium tests in different programming languages. There are officially-supported clients for Java, Python, Ruby, and .NET C#, as well as third-party clients for other languages. You can find a full list of clients in Appium Ecosystem's Clients page.

Plugins

Plugins allow you to extend server functionality without changing the server code. The main difference between drivers and plugins is that the latter must be explicitly enabled on Appium server startup (all installed drivers are enabled by default):

appium --use-plugins=<plugin-name>

You can find a full list of officially-supported and third-party plugins in Appium Ecosystem's Plugins page.

Similarly to drivers, plugin management is also done using Appium's Extension command-line interface:

# Install an official plugin from npm (see documentation for a list of such plugins)
appium plugin install <plugin-name>
# Install any plugin from npm
appium plugin install --source=npm <plugin-name>
# See documentation for installation from other sources

# List already installed plugins
appium plugin list --installed
# Update a plugin (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium plugin update <plugin-name>
# Update a plugin to the most recent version (may include breaking changes)
appium plugin update <plugin-name> --unsafe
# Uninstall a plugin
appium plugin uninstall <plugin-name>

Server Command Line Interface

In order to start sending commands to the Appium server, it must be running on the URL and port where your client library expects it to listen. Appium's command-line interface is used to launch and configure the server:

# Start the server on the default host (0.0.0.0) and port (4723)
appium server
# You can also omit the 'server' subcommand
appium
# Start the server on the given host, port and use a custom base path prefix (the default prefix is '/')
appium --address 127.0.0.1 --port 9000 --base-path /wd/hub

Appium supports execution of parallel server processes, as well as parallel driver sessions within a single server process. Refer the corresponding driver documentations regarding which mode is optimal for the particular driver or whether it supports parallel sessions.

Why Appium?

  1. You usually don't have to recompile your app or modify it in any way, due to the use of standard automation APIs on all platforms.
  2. You can write tests with your favorite dev tools using any WebDriver-compatible language such as Java, Python, Ruby and C#. There are also third party client implementations for other languages.
  3. You can use any testing framework.
  4. Some drivers like xcuitest and uiautomator2 have built-in mobile web and hybrid app support. Within the same script, you can switch seamlessly between native app automation and webview automation, all using the WebDriver model that's already the standard for web automation.
  5. You can run your automated tests locally and in a cloud. There are multiple cloud providers that support various Appium drivers (mostly targeting iOS and Android mobile automation).
  6. Appium Inspector can be used to visually inspect the page source of applications across different platforms, facilitating easier test development.

Investing in the WebDriver protocol means you are betting on a single, free, and open protocol for testing that has become a web standard. Don't lock yourself into a proprietary stack.

For example, if you use Apple's XCUITest library without Appium, you can only write tests using Obj-C/Swift, and you can only run tests through Xcode. Similarly, with Google's UiAutomator or Espresso, you can only write tests in Java/Kotlin. Appium opens up the possibility of true cross-platform native app automation, for mobile and beyond!

If you are looking for a more comprehensive description of what this is all about, please read our documentation on How Does Appium Work?.

Sponsors

Appium has a Sponsorship Program! If you or your company uses Appium and wants to give back financially to the project, we use these funds to encourage development and contributions, as well as support other open source projects we rely on. Become a sponsor via our OpenCollective page.

Development and Strategic Partners

Appium is incredibly grateful to our Development and Strategic Partners for their sustained contribution of project development and leadership!

HeadSpin

Browserstack

Sauce Labs

Other Sponsors

A full list of sponsors is available at our Sponsors page.

License

Apache-2.0

FOSSA Status

@appium/logger package is under ISC License.

appium-ios-simulator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appium-ios-simulator's Issues

Error: Appium - iOS Simulator -[WD Proxy] connect ECONNREFUSED 127.0.0.1:8080

Hi Team,

I am getting the error([WD Proxy] connect ECONNREFUSED 127.0.0.1:8080) while executing my appium script.

Configuration:
Appium version: 1.8.0 ( Have also tried 1.8.1/2)
Xcode version: 11.7
iOS platform version: 13.7
MacOS version: Catalina(10.15.7)

Capabilities:
[debug] [BaseDriver] "alwaysMatch": {
[debug] [BaseDriver] "platformName": "iOS",
[debug] [BaseDriver] "appium:unicodeKeyboard": "true",
[debug] [BaseDriver] "appium:resetKeyboard": "true",
[debug] [BaseDriver] "appium:platformVersion": "13.7",
[debug] [BaseDriver] "appium:deviceName": "iPhone11Pro",
[debug] [BaseDriver] "appium:deviceOrientation": "portrait",
[debug] [BaseDriver] "appium:appiumVersion": "1.18.0",
[debug] [BaseDriver] "appium:app": "/Users/automation/Project/testapp/newTestApp/Build/Products/Debug-iphonesimulator/newTestApp.app",
[debug] [BaseDriver] "appium:name": "RobotAppiumiOS",
[debug] [BaseDriver] "appium:showXcodeLog": "true",
[debug] [BaseDriver] "appium:useNewWDA": "false",
[debug] [BaseDriver] "appium:waitForQuiescence": "false",
[debug] [BaseDriver] "appium:showIOSLog": "true",
[debug] [BaseDriver] "appium:automationName": "XCUITest",
[debug] [BaseDriver] "appium:iosInstallPause": "2000",
[debug] [BaseDriver] "appium:wdaStartupRetries": "2",
[debug] [BaseDriver] "appium:wdaStartupRetryInterval": "15000",
[debug] [BaseDriver] "appium:wdaLocalPort": "8080",
[debug] [BaseDriver] "appium:shouldUseSingletonTestManager": "false"
[debug] [BaseDriver] }

appium-doctor stats:

Digitals-Mini:~ digitalautomation$ appium-doctor --ios
info AppiumDoctor Appium Doctor v.1.15.4
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 15.0.1
info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ Xcode Command Line Tools are installed in: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.36.0
info AppiumDoctor ✔ HOME is set to: /Users/automation
info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor ### Diagnostic for optional dependencies starting ###
WARN AppiumDoctor ✖ opencv4nodejs cannot be found.
WARN AppiumDoctor ✖ ffmpeg cannot be found
WARN AppiumDoctor ✖ mjpeg-consumer cannot be found.
WARN AppiumDoctor ✖ set-simulator-location is not installed
WARN AppiumDoctor ✖ idb and idb_companion are not installed
WARN AppiumDoctor ✖ applesimutils cannot be found
info AppiumDoctor ✔ ios-deploy is installed at: /usr/local/bin/ios-deploy. Installed version is: 1.11.3
info AppiumDoctor ### Diagnostic for optional dependencies completed, 6 fixes possible. ###
info AppiumDoctor
info AppiumDoctor ### Optional Manual Fixes ###
info AppiumDoctor The configuration can install optionally. Please do the following manually:
WARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md
WARN AppiumDoctor ➜ ffmpeg is needed to record screen features. Please read https://www.ffmpeg.org/ to install it
WARN AppiumDoctor ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with 'npm i -g mjpeg-consumer'.
WARN AppiumDoctor ➜ set-simulator-location is needed to set location for Simulator. Please read https://github.com/lyft/set-simulator-location to install it
WARN AppiumDoctor ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb
WARN AppiumDoctor ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/
info AppiumDoctor
info AppiumDoctor ###
info AppiumDoctor
info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!
info AppiumDoctor

Kindly help.

Should be able to get the log path for a simulator

When getting the logs currently we have information about the sim's directory structure bleeding out into other places.

From ios-log.js:

if (ver >= 6) { 
  logger.debug('Starting iOS 8.*/9.* simulator log capture');
  if (_.isUndefined(this.simUdid)) {
    logger.errorAndThrow('iOS 8*/9.* log capture requires a sim udid'); 
  }
  logsPath = path.resolve(process.env.HOME, 'Library', 'Logs', 'CoreSimulator', this.simUdid); 
} else {
  logger.debug('Starting iOS7.* simulator log capture');
  logsPath = path.resolve(process.env.HOME, 'Library', 'Logs', 'iOS Simulator', '7.*');
}

about log

Is there any way to set log mode or level ?

It‘s a little noisy now.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Xcode 9.3 wrong path in buildBundlePathMap

Got error:

Error: ENOENT: no such file or directory, scandir '/Users/amakhov/Library/Developer/CoreSimulator/Devices/8FAF71AF-AA3C-42F9-8F0D-A84CF25C6A8D/data/Containers/Containers/Data/Application'

(full log below)

Guess https://github.com/appium/appium-ios-simulator/blob/master/lib/simulator-xcode-7.3.js#L19-L21 is unnecessesary.

➜ $ ls -la ~/Library/Developer/CoreSimulator/Devices/72889C4E-98D2-461B-95AC-40C48B2D8701/data/Containers
total 0
drwxr-xr-x   5 amakhov  admin  170 29 мар 12:24 .
drwxrwxr-x@ 12 amakhov  admin  408 29 мар 12:25 ..
drwxr-xr-x   6 amakhov  admin  204 29 мар 12:24 Bundle
drwxr-xr-x   9 amakhov  admin  306 29 мар 12:24 Data
drwxr-xr-x   4 amakhov  admin  136 29 мар 12:24 Shared

Full log:

[Appium] Welcome to Appium v1.5.0 (REV a47301174cb01f868bba5cf599e05c9aabb937f0)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"deviceName":"iPhone 5s","app":"/Users/amakhov/Library/Developer/Xcode/DerivedData/Realty-ewsqgcbkzzpdfralgzermtezduxa/Build/Products/Debug-iphon...
[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium]   deviceName: 'iPhone 5s'
[Appium]   app: '/Users/amakhov/Library/Developer/Xcode/DerivedData/Realty-ewsqgcbkzzpdfralgzermtezduxa/Build/Products/Debug-iphonesimulator/ActiAgent.app'
[Appium]   version: '9.3'
[Appium]   platformName: 'iOS'
[Appium]   platformVersion: '9.3'
[Appium]   launchTimeout: 120000
[BaseDriver] The following capabilities were provided, but are not recognized by appium: version.
[BaseDriver] Session created with session id: 1a18e81f-d21b-4b0c-a6aa-37937b716c52
[debug] [iOS] Not auto-detecting udid.
[BaseDriver] Using local app '/Users/amakhov/Library/Developer/Xcode/DerivedData/Realty-ewsqgcbkzzpdfralgzermtezduxa/Build/Products/Debug-iphonesimulator/ActiAgent.app'
[debug] [iOS] Removing any remaining instruments sockets
[debug] [iOS] Cleaned up instruments socket /var/folders/fg/bt1qllgx6s5_tfnj12cj54080000gp/T/instruments_sock
[debug] [iOS] Setting Xcode version
[debug] [iOS] Xcode version set to 7.3
[debug] [iOS] Setting iOS SDK Version
[debug] [iOS] iOS SDK Version set to 9.3
[debug] [iOS] Checking whether instruments supports our device string
[debug] [Instruments] Getting list of devices instruments supports
[debug] [Instruments] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
[iOSSim] Retrieving device name string for Xcode version 7.3
[debug] [iOSSim] Getting device string from options: {"deviceName":"iPhone 5s","platformVersion":"9.3","forceIphone":false,"forceIpad":false}
[debug] [iOSSim] Final device string is 'iPhone 5s (9.3)'
[debug] [iOS] iOS sim UDID is 72889C4E-98D2-461B-95AC-40C48B2D8701
[iOSSim] Constructing iOS simulator for Xcode version 7.3
[debug] [iOS] No language specified. Using default strings
[debug] [iOS] Strings file not found. Looking in 'en.lproj' directory
[iOS] Could not file localizable strings file 'Localizable.strings'!
[debug] [ios-app-utils] Getting bundle ID from app
[iOS] Extracted bundleID: ru.avito.realty.dev from app: /Users/amakhov/Library/Developer/Xcode/DerivedData/Realty-ewsqgcbkzzpdfralgzermtezduxa/Build/Products/Debug-iphonesimulator/ActiAgent.app
[debug] [iOS] Creating instruments
[debug] [UIAuto] Preparing bootstrap code
[debug] [UIAuto] Dynamic bootstrap dir: /Users/amakhov/Library/Application Support/appium/bootstrap
[debug] [UIAuto] Dynamic env: {"nodePath":"/usr/local/Cellar/node/5.6.0/bin/node","commandProxyClientPath":"/usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js","instrumentsSock":"/var/folders/fg/bt1qllgx6s5_tfnj12cj54080000gp/T/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"oneByOne"}
[debug] [UIAuto] Dynamic bootstrap code: // This file is automatically generated. Do not manually m...fy!
[debug] [UIAuto] Dynamic bootstrap path: /Users/amakhov/Library/Application Support/appium/bootstrap/bootstrap-041ea8f892f6b09c.js
[debug] [UIAuto] Reusing dynamic bootstrap: /Users/amakhov/Library/Application Support/appium/bootstrap/bootstrap-041ea8f892f6b09c.js
[debug] [iOS] User specified default device, letting instruments launch it
[debug] [iOS] Running ios sim reset flow
[debug] [iOS] Killing the simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [iOS] Cleaning sim state.
[debug] [iOSSim] Cleaning app data files for 'ActiAgent.app', 'ru.avito.realty.dev'
[iOSSim] Attempted to get an app path from a fresh simulator quickly launching the sim to populate its directories
[debug] [iOSSim] Attempting to launch and quit the simulator, to create directory structure
[debug] [iOSSim] Will launch with Safari? false
[iOSSim] Starting simulator with command: open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID 72889C4E-98D2-461B-95AC-40C48B2D8701
[iOSSim] Tailing simulator logs until we encounter the string "System app "com.apple.springboard" finished startup"
[iOSSim] We will time out after 60000ms
[debug] [iOSSim] Waiting and extra 2000ms for the simulator to really finish booting
[debug] [iOSSim] Done waiting extra time for simulator
[iOSSim] Simulator booted in 20513ms
[debug] [iOSSim] Killing all iOS Simulators
[debug] [iOSSim] Building bundle path map
[iOS] Error: ENOENT: no such file or directory, scandir '/Users/amakhov/Library/Developer/CoreSimulator/Devices/72889C4E-98D2-461B-95AC-40C48B2D8701/data/Containers/Containers/Data/Application'
    at Error (native)
 { [Error: ENOENT: no such file or directory, scandir '/Users/amakhov/Library/Developer/CoreSimulator/Devices/72889C4E-98D2-461B-95AC-40C48B2D8701/data/Containers/Containers/Data/Application']
  cause:
   { [Error: ENOENT: no such file or directory, scandir '/Users/amakhov/Library/Developer/CoreSimulator/Devices/72889C4E-98D2-461B-95AC-40C48B2D8701/data/Containers/Containers/Data/Application']
     errno: -2,
     code: 'ENOENT',
     syscall: 'scandir',
     path: '/Users/amakhov/Library/Developer/CoreSimulator/Devices/72889C4E-98D2-461B-95AC-40C48B2D8701/data/Containers/Containers/Data/Application' },
  isOperational: true,
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/amakhov/Library/Developer/CoreSimulator/Devices/72889C4E-98D2-461B-95AC-40C48B2D8701/data/Containers/Containers/Data/Application' }
[iOS] Could not reset simulator. Leaving as is.
[debug] [iOS] Not setting locale
[debug] [iOS] No iOS / app preferences to set
[debug] [iOSLog] Starting iOS 9.3 simulator log capture
[debug] [iOSLog] System log path: /Users/amakhov/Library/Logs/CoreSimulator/72889C4E-98D2-461B-95AC-40C48B2D8701/system.log
[debug] [iOS] Not pre-launching simulator
[debug] [iOS] Starting UIAutoClient, and launching Instruments.
[debug] [UIAuto] Instruments socket server started at /var/folders/fg/bt1qllgx6s5_tfnj12cj54080000gp/T/instruments_sock
[debug] [Instruments] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
[debug] [Instruments] Attempting to launch instruments, this is try #1
[Instruments] Launching instruments
[debug] [Instruments] Attempting to run app on iPhone 5s (9.3)
[Instruments] On xcode 7.0+, instruments-without-delay does not work, skipping instruments-without-delay
[debug] [Instruments] Found Insruments-Without-Delay: /usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd7
[debug] [Instruments] Spawning instruments with command: '/Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /var/folders/fg/bt1qllgx6s5_tfnj12cj54080000gp/T/appium-instruments/instrumentscli0.trace -w "iPhone 5s (9.3)" /Users/amakhov/Library/Developer/Xcode/DerivedData/Realty-ewsqgcbkzzpdfralgzermtezduxa/Build/Products/Debug-iphonesimulator/ActiAgent.app -e UIASCRIPT "/Users/amakhov/Library/Application Support/appium/bootstrap/bootstrap-041ea8f892f6b09c.js" -e UIARESULTSPATH /var/folders/fg/bt1qllgx6s5_tfnj12cj54080000gp/T/appium-instruments'
[debug] [Instruments] And launch timeouts (in ms): {"global":120000}
[debug] [Instruments] [INST] Waiting for device to boot...
[UIAuto] Instruments is ready to receive commands
[debug] [iOS] Instruments launched. Starting poll loop for new commands.
[debug] [iOS] Setting bootstrap config keys/values
[debug] [UIAuto] Socket data received (2 bytes)
[debug] [UIAuto] Got a result when we were not expecting one! Ignoring it
[debug] [UIAuto] Sending command to instruments: target = $.target();
au = $;
$.isVerbose = true;

[debug] [Instruments] [INST] 2016-03-29 09:25:09 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-03-29 09:25:09 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-03-29 09:25:09 +0000 Debug: Running system command #1: /usr/local/Cellar/node/5.6.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fg/bt1qllgx6s5_tfnj12cj54080000gp/T/instruments_sock 2,{"status":0,"value":true}...
[debug] [UIAuto] Socket data received (27 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":true}
[debug] [iOS] Setting initial orientation to PORTRAIT
[debug] [UIAuto] Sending command to instruments: au.setScreenOrientation('PORTRAIT')
[debug] [Instruments] [INST] 2016-03-29 09:25:10 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation('PORTRAIT')
[debug] [Instruments] [INST] 2016-03-29 09:25:10 +0000 Debug: evaluating au.setScreenOrientation('PORTRAIT')
[debug] [Instruments] [INST] 2016-03-29 09:25:10 +0000 Debug: target.setDeviceOrientation("1")
[debug] [Instruments] [INST] 2016-03-29 09:25:12 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-03-29 09:25:12 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-03-29 09:25:12 +0000 Debug: Running system command #2: /usr/local/Cellar/node/5.6.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/fg/bt1qllgx6s5_tfnj12cj54080000gp/T/instruments_sock 2,{"status":0,"value":"PORTRAIT"}...
[debug] [UIAuto] Socket data received (33 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":"PORTRAIT"}
[debug] [iOS] Waiting for app source to contain elements
[debug] [UIAuto] Sending command to instruments: au.mainApp().getTreeForXML()
[debug] [Instruments] [INST] 2016-03-29 09:25:13 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()
[debug] [Instruments] [INST] 2016-03-29 09:25:13 +0000 Debug: evaluating au.mainApp().getTreeForXML()

… (normal works with my app, but also can't reset simulator after tests passed)

1.5 cleanup

  • Make sure all deps are up to date (and there are no unused deps)
  • Take a look at all TODOs to see if we need to resolve any for the release
  • Set up code coverage
  • Set up CI (unit tests, functional tests, code coverage; should be on all relevant platforms, and should include multi-executor parallelism for long-running testsuites)
  • Ensure that we are using appium-support functions, not home-grown helpers
  • Ensure that we have high unit test code coverage percentage
  • Ensure that we have sufficient/appropriate functional test coverage
  • Write a decent README, explaining (a) what the purpose of the module is, (b) how it relates to other appium modules, and (c) how to use its interface
  • Ensure that code conforms to our style
  • Ensure we are not using any sync functions
  • Ensure that code is well-commented
  • Ensure that non-production code or assets are added to .npmignore to reduce npm install size

setPermission probably doesn't work, WDA stops

#188

Scenario

@@driver.execute_script('mobile: setPermission', {service: 'calendar', state: 'yes', bundleId: 'com.apple.mobilecal'})
@@driver.activate_app('com.apple.mobilecal')

Env

  • xcuitest-driver 2.100.0 (set the version by manual)
  • ios-simulator 3.7.0
  • Appium master
  • iOS 11.4 emulator

1. UnknownError happened after calling setPermission

After calling setPermission, simulator probably restarted and WDA stopped. .app_installed?('com.apple.mobilecal') worked but commands needs WDA didn't.

[HTTP] --> POST /wd/hub/session/b5e6736f-db76-411e-9603-3fac0d64db3e/appium/device/activate_app
[HTTP] {"bundleId":"com.apple.mobilecal"}
[debug] [W3C (b5e6736f)] Calling AppiumDriver.activateApp() with args: ["com.apple.mobilecal",null,null,null,"b5e6736f-db76-411e-9603-3fac0d64db3e"]
[debug] [XCUITest] Executing command 'activateApp'
[debug] [JSONWP Proxy] Proxying [POST /wda/apps/launch] to [POST http://localhost:8100/session/FCC17AF5-FA0A-428A-BC9C-7FD419FD4CD8/wda/apps/launch] with body: {"bundleId":"com.apple.mobilecal"}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [W3C (b5e6736f)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:8100
[debug] [W3C (b5e6736f)]     at /Users/kazuaki/GitHub/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:236:13
[debug] [W3C (b5e6736f)]     at Generator.throw (<anonymous>)
[debug] [W3C (b5e6736f)]     at asyncGeneratorStep (/Users/kazuaki/GitHub/appium/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
[debug] [W3C (b5e6736f)]     at _throw (/Users/kazuaki/GitHub/appium/node_modules/@babel/runtime/helpers/asyncToGenerator.js:29:9)
[debug] [W3C (b5e6736f)]     at <anonymous>
[HTTP] <-- POST /wd/hub/session/b5e6736f-db76-411e-9603-3fac0d64db3e/appium/device/activate_app 500 16 ms - 832
[HTTP]

So, should we make sure WDA running after the command?

2. "unset" after allow permission by manual (The returned value only depends on setPermission command)

I allowed a permission for calrndar after launching 'com.apple.mobilecal' by manual. The returned value was unset.

)> @@driver.execute_script('mobile: getPermission', {service: 'calendar',bundleId: 'com.apple.mobilecal'})
=> "unset"

3. setPermission doesn't work?

Launch calendar app after allowing permission like below, the permission dialog appeared. I think the dialog shouldn't appear.


I guess the change is inspired by https://github.com/wix/AppleSimulatorUtils .
I've used the command line tool in my environment. I've handled permissions before starting Appium session. (I have another CLI to create/delete simulators. I call AppleSimulatorUtils in it.) Then, the permission commands work well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.