appium / appium-ios-simulator Goto Github PK
View Code? Open in Web Editor NEWModule for interacting with iOS simulators
License: Other
Module for interacting with iOS simulators
License: Other
If a settings method updates the settings it ought to return true
, otherwise false
, so calling code can decide if it needs to do anything (stop the sim, for instance).
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.*');
}
When setting locale with empty calendar, for instance: https://github.com/appium/appium/blob/master/test/functional/ios/testapp/localization/locale-specs.js#L32-L41
info: [debug] [iOSSim] New locale: fr@calendar=
should be : fr
Is there any way to set log mode or level ?
It‘s a little noisy now.
appium-ios-simulator/lib/simulator-xcode-6.js
Line 407 in 75a8a21
The result is always 'false', because [e.stderr == undefined], use [e.toString()] or another correct property.
Appium: 1.18.2
MacOS: 10.13.6
Xcode: 10.1
Node: 12.18.4
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.
@@driver.execute_script('mobile: setPermission', {service: 'calendar', state: 'yes', bundleId: 'com.apple.mobilecal'})
@@driver.activate_app('com.apple.mobilecal')
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?
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"
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.
🚨 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.
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.