appium / appium-ios-simulator

Module for interacting with iOS simulators
Other
99 stars 44 forks source link

Xcode 9.3 wrong path in buildBundlePathMap #54

Closed makhov closed 7 years ago

makhov commented 8 years ago

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)
imurchie commented 8 years ago

I see. Weird. I didn't see this error when trying the tests out for 9.3

imurchie commented 8 years ago

Fix published as appium-ios-simulator@1.6.0.

nairouz12 commented 8 years ago

Hi guys, I'm facing the same problem. Does anyone can help me on that please? [debug] [iOSSim] Building bundle path map [iOS] Error: ENOENT: no such file or directory, scandir '/Users/admin/Library/Developer/CoreSimulator/Devices/77FFA55F-A877-4DA2-B3C4-8F7C09D19119/data/Containers/Containers/Data/Application' at Error (native) { [Error: ENOENT: no such file or directory, scandir '/Users/admin/Library/Developer/CoreSimulator/Devices/77FFA55F-A877-4DA2-B3C4-8F7C09D19119/data/Containers/Containers/Data/Application'] cause: { [Error: ENOENT: no such file or directory, scandir '/Users/admin/Library/Developer/CoreSimulator/Devices/77FFA55F-A877-4DA2-B3C4-8F7C09D19119/data/Containers/Containers/Data/Application'] errno: -2, code: 'ENOENT', syscall: 'scandir', path: '/Users/admin/Library/Developer/CoreSimulator/Devices/77FFA55F-A877-4DA2-B3C4-8F7C09D19119/data/Containers/Containers/Data/Application' }, isOperational: true, errno: -2, code: 'ENOENT', syscall: 'scandir', path: '/Users/admin/Library/Developer/CoreSimulator/Devices/77FFA55F-A877-4DA2-B3C4-8F7C09D19119/data/Containers/Containers/Data/Application' } [iOS] Could not reset simulator. Leaving as is.

imurchie commented 8 years ago

This has been fixed and will be in Appium 1.5.2.