Unable to launch ipa file in IOS 10 real Device using appium 1.6.0 - ios

To start with I got a .ipa file from the development team to test, the developer has mentioned the .ipa file with the device UDID so that I can install it on my iPhone.
[Appium] Welcome to Appium v1.6.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"/Users/apple/Downloads/ReaderManager.ipa","noReset":true,"platformVersion":"10.0","bundleId":"com.hidglobal.pacs.se.readermanager","platformName":"iOS","udid":"1f51471daf2a4674f11ece1a19d6cb4fa5569c02","deviceName":"iPhone 6"},"requiredCapabilities":{}},"desiredCapabilities":{"app":"/Users/apple/Downloads/ReaderManager.ipa","noReset":true,"platformVersion":"10.0","bundleId":"com.hidglobal.pacs.se.readermanager","platformName":"iOS","udid":"1f51471daf2a4674f11ece1a19d6cb4fa5569c02","deviceName":"iPhone 6"},"requiredCapabilities":{}}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","sessionId","id"]} and you sent ["capabilities","desiredCapabilities","requiredCapabilities"]
[HTTP] <-- POST /wd/hub/session 400 6 ms - 201
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/apple/Downloads/ReaderManager.ipa","noReset":true,"platformVersion":"10.0","bundleId":"com.hidglobal.pacs.se.readermanager","platformName":"iOS","udid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","deviceName":"iPhone 6"},"requiredCapabilities":{}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/apple/Downl...
[Appium] Requested iOS support with version >= 10, using XCUITest driver instead of UIAutomation-based driver, since the latter is unsupported on iOS 10 and up.
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Users/apple/Downloads/xyz.ipa'
[Appium] noReset: true
[Appium] platformVersion: '10.0'
[Appium] bundleId: 'xxxxxxxx'(Changed Manually)
[Appium] platformName: 'iOS'
[Appium] udid: 'xxxxxxxxxxxxxxxxxxxxx'(Changed Manually)
[Appium] deviceName: 'iPhone 6'
[debug] [XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Session created with session id: f1a2a222-8e4f-47fb-bbbd-2429f159b403
[debug] [XCUITest] Xcode version set to '8.0'
[debug] [XCUITest] iOS SDK Version set to '10.0'
[debug] [XCUITest] Available devices: xxxxxxxxxxxxxx
[debug] [XCUITest] Creating iDevice object with udid xxxxxxxxxxxxxxxxxxx
[XCUITest] Determining device to run tests on: udid: 'xxxxxxxxxxxxxxxxx', real device: true
[BaseDriver] Using local app '/Users/apple/Downloads/ReaderManager.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/2d/qg1847_14nd90zgq9_m30zhc0000gn/T/2016926-3576-bfkmhz.8l1yycik9/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/2d/qg1847_14nd90zgq9_m30zhc0000gn/T/2016926-3576-bfkmhz.8l1yycik9/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/2d/qg1847_14nd90zgq9_m30zhc0000gn/T/2016926-3576-bfkmhz.8l1yycik9/Payload/ReaderManager.app'
[debug] [XCUITest] Checking whether app is actually present
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[XCUITest] Setting up real device
[debug] [XCUITest] Stdout from app isInstalled check: [....] Waiting for iOS device to be connected
[....] Using iPhone 6 (GSM) 'Iphone 6' (xxxxxxxxxxxxxxx).
true
[debug] [XCUITest] App is installed.
[debug] [XCUITest] Full reset not requested. No need to install.
[XCUITest] Using default agent: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Beginning test with command '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/bin/run-xcodebuild.sh --project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj --scheme WebDriverAgentRunner --destination id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[XCUITest] The real device logger 'idevicesyslog' was unable to start log capture. Please try installing 'deviceconsole' ('npm install -g deviceconsole') and specify the path to it using the 'realDeviceLogger' capability.
[debug] [XCUITest] Log file for xcodebuild test: /Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5D3AF14D-B012-422A-B281-1F3CE59A49EA/Session-WebDriverAgentRunner-2016-10-26_150854-8VLGgF.log
[Xcode] 2016-10-26 15:08:58.437 xcodebuild[3594:21573] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5D3AF14D-B012-422A-B281-1F3CE59A49EA/Session-WebDriverAgentRunner-2016-10-26_150854-8VLGgF.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5D3AF14D-B012-422A-B281-1F3CE59A49EA/Session-WebDriverAgentRunner-2016-10-26_150854-8VLGgF.log}
[Xcode] Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.0'
[Xcode] Signing for "WebDriverAgentRunner" requires a development team. Select a development team in the project editor.enter code here
[Xcode] Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.0'
During my execution of script I am getting the above issue.
Request the team to help me in identifying the issue and how to resolve it.
Thanks,
Goutham

Run the below command in terminal to open WebDriverAgent project.
Open usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
Now this will open the WebDriverAgent project in xcode.
Go to build settings of the project as shown in below screenshot and add the development team.
If no options are available in development team to select then follow the below procedure to add the account.
a. Click on xcode and navigate to preferences.
b. Click on Accounts.
c. Click on ‘+’ symbol and add the account same as the account used for the code signing activity.
Now you can select the added account in Development Team.
The account selected for the development team should be same as the account selected for code signing activity.
Now add development team for all the targets also similarly by navigating to build settings.
Run the code to check for any errors and build succeeded message should be displayed.
Please refer Bluedev comment as well.

if you are unable to execute appium script even after creating a developer team and building the app in Xcode..
Follow the steps given in the below link and try running appium after those steps, I tried it (note: there were some unthinkable libraries missing installation:) and working for me. I am having Mac OS 10.12.5 and Appium version 1.6.5. Hope this is helpful.
Appium Setup for running on real and emulated devices

Related

Can I do Appium inspector connected simulator without error code 65

I had started a session between appium server and simulator(at xcode).
But xcodebuild failed with code 65
xcodebuild error message:
[debug] [W3C]
[debug] [W3C] at quitAndUninstall (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:588:15)
[debug] [W3C] at /usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:623:11
[debug] [W3C] at wrapped (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:60:13)
[debug] [W3C] at retry (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:43:13)
[debug] [W3C] at retryInterval (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:70:10)
[debug] [W3C] at /usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:603:7
[debug] [iOSSim] The simulator has '0' bundles which have 'WebDriverAgentRunner-Runner' as their 'CFBundleName':
[debug] [WebDriverAgent] No WDAs on the device.
I have kwnown that appium inspector connected with simulator does not need webAgentDriver. It isn't true?
In concolusion,
A simulator must need a WebDriverAgent? not for only a real device?
What is webDriverAgent? I think that it only let appium control iOS devices.
If using xcode 14 we need to have appium 2 and appium inspector installed to be able to access the app
Make sure you have node 16.16, if you don’t you can install nvm and use it to install multiple versions of node on the machine, you can fine NVM here
Install Appium 2 using: npm install -g appium#next
Once Appium is installed run appium -v to confirm that you have version > 2
Install XCUITest driver: appium driver install xcuitest
Install UIAutomator2: appium driver install uiautomator
Run appium driver list to confirm that both drivers are installed
Install Appium Inspector: can be downloaded here, download the latest version.

Appium Desktop terminates after booting ios simulator

I'm trying to inspect the elements of the IntegrationApp.app that comes with the WebDriverAgent project. I built the app on a simulator in xcode but when I:
Open Appium Desktop (v1.15.1) on my MAC (v10.14.6)
Start the server
Select Start Inspector Session magnifying glass icon in the top right corner of the appium window
Provide the following capability set:
{
"automationName": "XCUITest",
"platformName": "iOS",
"deviceName": "iPad Air (3rd generation)",
"platformVersion": "13.1",
"app": "/Users/[MAC_USER]/Desktop/IntegrationApp.app"
}
Start the session
The simulator boots up and then Appium Desktop terminates leaving the ios simulator open without the app being installed. Has anyone encountered similar issues? Any thoughts what could be causing the issue? When running xcrun simctl list it lists the model. Below are the appium logs:
[info] [35m[Appium][39m Non-default server args:
[info] [35m[Appium][39m allowInsecure: {
[info] [35m[Appium][39m }
[info] [35m[Appium][39m denyInsecure: {
[info] [35m[Appium][39m }
[info] [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723[info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m
[info] [35m[HTTP][39m [90m{"desiredCapabilities":{"app":"/Users/testuser/Desktop/IntegrationApp.app","automationName":"XCUITest","deviceName":"iPad Air (3rd generation)","platformName":"iOS","platformVersion":"13.1","newCommandTimeout":0,"connectHardwareKeyboard":true}}[39m
[debug] [35m[MJSONWP][39m Calling AppiumDriver.createSession() with args: [{"app":"/Users/testuser/Desktop/IntegrationApp.app","automationName":"XCUITest","deviceName":"iPad Air (3rd generation)","platformName":"iOS","platformVersion":"13.1","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1574244116561 (10:01:56 GMT+0000 (GMT))
[info] [Appium] Appium v1.15.1 creating new XCUITestDriver (v2.133.1) session
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {
[debug] [BaseDriver] "app": "/Users/testuser/Desktop/IntegrationApp.app",
[debug] [BaseDriver] "automationName": "XCUITest",
[debug] [BaseDriver] "deviceName": "iPad Air (3rd generation)",
[debug] [BaseDriver] "platformName": "iOS",
[debug] [BaseDriver] "platformVersion": "13.1",
[debug] [BaseDriver] "newCommandTimeout": 0,
[debug] [BaseDriver] "connectHardwareKeyboard": true
[debug] [BaseDriver] }
[info] [BaseDriver] Session created with session id: ba3f0114-0bfa-4e5a-8bb8-ee1d30e62166[debug] [XCUITest] Current user: 'testuser'
[info] [HTTP] [37m-->[39m [37mGET[39m [37m/wd/hub/sessions[39m
[info] [HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getSessions() with args: []
[debug] [GENERIC] Responding to client with driver.getSessions() result: []
[info] [HTTP] <-- GET /wd/hub/sessions 200 5 ms - 40
[info] [HTTP]
[info] [XCUITest] iOS SDK Version set to '13.2'[info] [iOSSim] Constructing iOS simulator for Xcode version 11.2.1 with udid 'C360E349-1255-4D96-B146-13D1FD3ACDF5'
[info] [XCUITest] Determining device to run tests on: udid: 'C360E349-1255-4D96-B146-13D1FD3ACDF5', real device: false
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1574244119170 (10:01:59 GMT+0000 (GMT))
[info] [BaseDriver] Using local app '/Users/testuser/Desktop/IntegrationApp.app'
[debug] [BaseDriver] Event 'appConfigured' logged at 1574244119174 (10:01:59 GMT+0000 (GMT))
[debug] [XCUITest] Checking whether app '/Users/testuser/Desktop/IntegrationApp.app' is actually present on file system
[debug] [XCUITest] App is present
[debug] [iOS] Getting bundle ID from app '/Users/testuser/Desktop/IntegrationApp.app': 'com.demo2019.IntegrationApp'
[debug] [BaseDriver] Event 'resetStarted' logged at 1574244119179 (10:01:59 GMT+0000 (GMT))[info] [XCUITest] Not scrubbing third party app in anticipation of uninstall
[debug] [BaseDriver] Event 'resetComplete' logged at 1574244119388 (10:01:59 GMT+0000 (GMT))[warn] [XCUITest] Continuing without capturing device logs: iOS Simulator with udid C360E349-1255-4D96-B146-13D1FD3ACDF5 is not running
[info] [XCUITest] Setting up simulator
[debug] [iOS] No reason to set locale
[debug] [iOS] No iOS / app preferences to set
[debug] [iOS] Setting did not need to be updated
[debug] [iOSSim] Setting preferences of C360E349-1255-4D96-B146-13D1FD3ACDF5 Simulator to {"ConnectHardwareKeyboard":true}
[debug] [iOSSim] Setting common Simulator preferences to {"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":true}
[debug] [iOSSim] Updated C360E349-1255-4D96-B146-13D1FD3ACDF5 Simulator preferences at '/Users/testuser/Library/Preferences/com.apple.iphonesimulator.plist' with {"DevicePreferences":{"C360E349-1255-4D96-B146-13D1FD3ACDF5":{"ConnectHardwareKeyboard":true}},"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":true}[info] [iOSSim] Booting Simulator with UDID C360E349-1255-4D96-B146-13D1FD3ACDF5...[info] [iOSSim] Starting Simulator UI with command: open -Fn /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID C360E349-1255-4D96-B146-13D1FD3ACDF5 -ConnectHardwareKeyboard 1[info] [iOSSim] Simulator with UDID C360E349-1255-4D96-B146-13D1FD3ACDF5 booted in 16 seconds
[debug] [IDB] Connecting idb service to 'C360E349-1255-4D96-B146-13D1FD3ACDF5'
[debug] [IDB] Disconnecting idb service from 'C360E349-1255-4D96-B146-13D1FD3ACDF5'```
This issue is with idb. It seems that idb is not working properly. You need to uninstall idb completely.
pip uninstall fb-idb
brew uninstall idb
brew uninstall idb-companion
And then make sure that below commands should not give any results.
which idb
which idb-companion
Now run your code it should work fine.
Basically we don't need idb to run ios simulator

Appium is creating instances of a simulator

I am trying out automation for IOS simulator with Appium and webdriverio.
Appium is creating simulator with random simulator name like 'appiumTest-4F75F52A-4C52-48F0-B818-60C891F72E95-iPhone XR'.
It is creating number of simulators according the number of tests which has been written. I am trying to figure out why appium is creating instances of the simulators.
Desired capabilities for the test:
capabilities: [{
maxInstances: 1,
deviceName: 'iPhone XR',
platformName: 'iOS',
app: 'app/path',
platformVersion: '12.2',
orientation: 'PORTRAIT',
noReset: true,
automationName: 'XCUITest',
useNewWDA: true,
waitForQuiescence: false,
newCommandTimeout: 240,
}]
Given is the APPIUM log of the test for Ios simulator
[35m[BaseDriver][39m Session created with session id: 6caa6127-91ad-4770-9e6b-6adbbcfbf000
[debug]
[35m[XCUITest][39m iOS SDK Version set to '12.2'
[35m[XCUITest][39m Simulator udid not provided
[35m[XCUITest][39m Using desired caps to create a new simulator
[debug] [35m[simctl][39m Creating simulator with name 'appiumTest-4F76F52A-4C52-48F0-B818-60C891F72E95-iPhone XR', device type id 'iPhone XR' and runtime id 'com.apple.CoreSimulator.SimRuntime.iOS-12-2'
[35m[iOSSim][39m Constructing iOS simulator for Xcode version 10.2.1 with udid '82827AFA-6BE5-4CCF-9506-CB866477427B'
[35m[XCUITest][39m Created simulator with udid '82827AFA-6BE5-4CCF-9506-CB866477427B'.
[35m[XCUITest][39m Determining device to run tests on: udid: '82827AFA-6BE5-4CCF-9506-CB866477427B', real device: false
[debug] [35m[BaseDriver][39m Event 'xcodeDetailsRetrieved' logged at 1562754343205 (15:55:43 GMT+0530 (India Standard Time))
[35m[BaseDriver][39m Using local app '/Users/faizahmed/Downloads/wdio-mobile/wdioApp/iOS-Simulator-NativeDemoApp-0.2.1.app.zip'
[debug] [35m[BaseDriver][39m Unzipping '/Users/faizahmed/Downloads/wdio-mobile/wdioApp/iOS-Simulator-NativeDemoApp-0.2.1.app.zip'
[debug] [35m[BaseDriver][39m Extracted 84 item(s) from '/Users/faizahmed/Downloads/wdio-mobile/wdioApp/iOS-Simulator-NativeDemoApp-0.2.1.app.zip'
[debug] [35m[BaseDriver][39m Matched 84 item(s) in the extracted archive. Assuming 'iOS-Simulator-NativeDemoApp-0.2.1.app' is the correct bundle
[35m[BaseDriver][39m Unzipped local app to '/var/folders/0v/qnp0rbs13j59m597p5ff016c0000gn/T/2019610-76637-1yhuqt3.dn1ul/iOS-Simulator-NativeDemoApp-0.2.1.app'
[debug] [35m[BaseDriver][39m Event 'appConfigured' logged at 1562754343822 (15:55:43 GMT+0530 (India Standard Time))
[debug] [35m[XCUITest][39m Checking whether app '/var/folders/0v/qnp0rbs13j59m597p5ff016c0000gn/T/2019610-76637-1yhuqt3.dn1ul/iOS-Simulator-NativeDemoApp-0.2.1.app' is actually present on file system
[debug] [35m[XCUITest][39m App is present
[debug] [35m[iOS][39m Getting bundle ID from app '/var/folders/0v/qnp0rbs13j59m597p5ff016c0000gn/T/2019610-76637-1yhuqt3.dn1ul/iOS-Simulator-NativeDemoApp-0.2.1.app': 'org.reactjs.native.example.wdioDemoApp'
[debug] [35m[BaseDriver][39m Event 'resetStarted' logged at 1562754343826 (15:55:43 GMT+0530 (India Standard Time))
[debug] [35m[XCUITest][39m Reset: noReset is on. Leaving simulator as is
[debug] [35m[BaseDriver][39m Event 'resetComplete' logged at 1562754343827 (15:55:43 GMT+0530 (India Standard Time))
[35m[XCUITest][39m Continuing without capturing device logs: iOS Simulator with udid 82827AFA-6BE5-4CCF-9506-CB866477427B is not running
[35m[XCUITest][39m Setting up simulator
[debug] [35m[iOS][39m No reason to set locale
[debug] [35m[iOS][39m No iOS / app preferences to set
[debug] [35m[iOS][39m Setting did not need to be updated
[debug] [35m[iOSSim][39m Setting preferences of 82827AFA-6BE5-4CCF-9506-CB866477427B Simulator to {"SimulatorWindowOrientation":"Portrait","SimulatorWindowRotationAngle":0,"ConnectHardwareKeyboard":false}
[debug] [35m[iOSSim][39m Setting common Simulator preferences to {"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false}
[debug] [35m[iOSSim][39m Updated 82827AFA-6BE5-4CCF-9506-CB866477427B Simulator preferences at '/Users/faizahmed/Library/Preferences/com.apple.iphonesimulator.plist' with {"DevicePreferences":{"82827AFA-6BE5-4CCF-9506-CB866477427B":{"SimulatorWindowOrientation":"Portrait","SimulatorWindowRotationAngle":0,"ConnectHardwareKeyboard":false}},"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false}
[35m[iOSSim][39m Booting Simulator with UDID 82827AFA-6BE5-4CCF-9506-CB866477427B...
[35m[iOSSim][39m Starting Simulator UI with command: open -Fn /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID 82827AFA-6BE5-4CCF-9506-CB866477427B -ConnectHardwareKeyboard 0
[35m[iOSSim][39m Simulator with UDID 82827AFA-6BE5-4CCF-9506-CB866477427B booted in 20 seconds
[debug] [35m[IDB][39m Connecting idb service to '82827AFA-6BE5-4CCF-9506-CB866477427B'
[35m[XCUITest][39m idb will not be used for Simulator interaction. Original error: 'idb' has not been found in PATH. Is it installed? Read https://www.fbidb.io for more details
[debug] [35m[BaseDriver][39m Event 'simStarted' logged at 1562754364973 (15:56:04 GMT+0530 (India Standard Time))
[debug] [35m[XCUITest][39m Starting log capture for iOS Simulator with udid '82827AFA-6BE5-4CCF-9506-CB866477427B', using 'xcrun simctl spawn 82827AFA-6BE5-4CCF-9506-CB866477427B log stream --style compact'
[debug]
[debug] [35m[XCUITest][39m Verifying application platform
[debug] [35m[XCUITest][39m CFBundleSupportedPlatforms: ["iPhoneSimulator"]
[debug] [35m[XCUITest][39m Cleaning installd cache to save the disk space
[debug] [35m[XCUITest][39m Installing '/var/folders/0v/qnp0rbs13j59m597p5ff016c0000gn/T/2019610-76637-1yhuqt3.dn1ul/iOS-Simulator-NativeDemoApp-0.2.1.app' on Simulator with UUID '82827AFA-6BE5-4CCF-9506-CB866477427B'...
[debug] [35m[XCUITest][39m The app has been installed successfully.
[debug] [35m[BaseDriver][39m Event 'appInstalled' logged at 1562754373051 (15:56:13 GMT+0530 (India Standard Time))
[35m[XCUITest][39m Using WDA path: '/Users/faizahmed/Downloads/appium-mobile-test/node_modules/appium-webdriveragent'
[35m[XCUITest][39m Using WDA agent: '/Users/faizahmed/Downloads/appium-mobile-test/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
[debug] [35m[XCUITest][39m No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[debug] [35m[XCUITest][39m Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[debug] [35m[XCUITest][39m Capability 'useNewWDA' set to true, so uninstalling WDA before proceeding
[35m[XCUITest][39m Shutting down sub-processes
[debug] [35m[XCUITest][39m Removing WDA application from device
[debug] [35m[BaseDriver][39m Event 'wdaUninstalled' logged at 1562754375211 (15:56:15 GMT+0530 (India Standard Time))
[debug] [35m[XCUITest][39m Trying to start WebDriverAgent 2 times with 10000ms interval
[debug] [35m[XCUITest][39m These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[debug] [35m[BaseDriver][39m Event 'wdaStartAttempted' logged at 1562754375212 (15:56:15 GMT+0530 (India Standard Time))
[35m[XCUITest][39m Launching WebDriverAgent on the device
[35m[WebDriverAgent][39m Fetching dependencies
[35m[WebDriverAgent][39m Dependencies up-to-date
[debug] [35m[XCUITest][39m Killing running processes 'xcodebuild.*82827AFA-6BE5-4CCF-9506-CB866477427B, 82827AFA-6BE5-4CCF-9506-CB866477427B.*XCTRunner' for the device 82827AFA-6BE5-4CCF-9506-CB866477427B...
[debug] [35m[XCUITest][39m 'pgrep -ifn xcodebuild.*82827AFA-6BE5-4CCF-9506-CB866477427B' didn't detect any matching processes. Return code: 1
[debug] [35m[XCUITest][39m 'pgrep -ifn 82827AFA-6BE5-4CCF-9506-CB866477427B.*XCTRunner' didn't detect any matching processes. Return code: 1
[debug] [35m[XCUITest][39m Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Users/faizahmed/Downloads/appium-mobile-test/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=82827AFA-6BE5-4CCF-9506-CB866477427B IPHONEOS_DEPLOYMENT_TARGET=12.2 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Users/faizahmed/Downloads/appium-mobile-test/node_modules/appium-webdriveragent'

The application at <path> does not exist or is not accessible using Appium

I'm learning appium using eclipse and got stuck on launching my emulator. I tried different things such as moving the file around in the folder structure but I keep getting file does not exist or is not accessible I tried searching for the answer but nothing is helping.
package myAppiumTutorial;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;
public class Base {
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
File f = new File("scr");
File fs = new File(f,"ApiDemos-debug.apk");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "MyFirstEmu");
cap.setCapability(MobileCapabilityType.APP, fs.getAbsolutePath());
AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"),cap);
Logs from appium
[Appium] Setting automation to 'UiAutomator1'.
[Appium] Appium v1.13.0 creating new AndroidDriver (v4.15.1) session
[Appium] Capabilities:
[Appium] platformName: android
[Appium] app: C:\Users\Zamranj\eclipse-workspaceNew\AppiumIntro\scr\ApiDemos-debug.apk
[Appium] deviceName: MyFirstEmu
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"app":"C:\\Users\\Zamranj\... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
[BaseDriver] Session created with session id: 638fc0a9-1aa0-4b56-ba69-3c854b8e1816
[ADB] Found 1 'build-tools' folders under 'C:\Users\Zamranj\AppData\Local\Android\Sdk' (newest first):
[ADB] C:/Users/Zamranj/AppData/Local/Android/Sdk/build-tools/28.0.3
[ADB] Using 'adb.exe' from 'C:\Users\Zamranj\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb.exe' from 'C:\Users\Zamranj\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Setting device id to emulator-5554
[debug] [ADB] Running 'C:\Users\Zamranj\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 25
[debug] [ADB] Device API level: 25
[AndroidDriver] Consider setting 'automationName' capability to 'uiautomator2' on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active
[debug] [ADB] Running 'C:\Users\Zamranj\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.unlock'
[debug] [AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1559218980295 (07:23:00 GMT-0500 (Central Daylight Time))
[debug] [W3C] Encountered internal error running command: Error: The application at 'C:\Users\Zamranj\eclipse-workspaceNew\AppiumIntro\scr\ApiDemos-debug.apk' does not exist or is not accessible
[debug] [W3C] at APPLICATIONS_CACHE_GUARD.acquire (C:\Users\Zamranj\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\helpers.js:159:13)
[HTTP] <-- POST /wd/hub/session 500 2956 ms - 835
[HTTP]
Location of my apk
enter image description here
Your app is not in the src folder.
Instead it is in src/myAppiumTutorial folder.
So in line 17 change the folder to "src/myAppiumTutorial".
And see if it work.
I believe your problem lies with the way you're trying to load your file in.
Try the following:
File f = new File(classLoader.getResource("ApiDemos-debug.apk").getFile());
Please also take a look at the following:
Class.getResource(String)
Class.getResourceAsStream(String)
On Windows 10, I had to use the following double backslash syntax for the .apk file to be found.
caps.setCapability(MobileCapabilityType.APP, "C:\\Users\\Dad\\gitRepos\\myProjects\\AppiumJavaTestNGProject\\src\\test\\resources\\apps\\my.apk");
Only after I did that was the .apk findable by Appium server at runtime. Normally I work on Mac and the pathing is completely different.

Could not pre-launch appium and app doesn't get installed in iphone real device using appium

I am using appium version 1.3.7.
I have connected physical device via usb.
I have launched appium server,after a while appium get crashed.
I have pasted that full log below.
I have attached the screen shot below.
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --pre-launch --platform-version "8.1" --platform-name "iOS" --app "/Users/al/work/sample.app" --udid "f5de3fd5ccded92e40e86c652ce2a6f9414fe1a0" --device-name "iPhone 4s"
info: [debug] Starting Appium in pre-launch mode
info: Pre-launching app
info: [debug] Using local app from command line: /Users//al/work/sample.app
info: [debug] Creating new appium session 1cdc5dc0-36d2-40b9-922b-33601f28846b
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.1
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/alk/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/alk/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Reusing dynamic bootstrap: /Users/alk/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone 4s","platformVersion":"8.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 4s (8.1 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole
info: [debug] Not pre-launching simulator
info: [debug] Creating iDevice object with udid f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2
info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle com.vr.iphone.sample
info: [debug] App is not installed. Will try to install the app.
info: [debug] Installing app using cmd: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle "/Users/al/work/sample.app
info: [debug] Cleaning up appium session
error: Could not pre-launch appium: Error: Unable to install [/Users/al/work/sample.app] to device with id [f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2]. Error [Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle "/Users/al/work/sample.app"
Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.afc"), &afcFd, NULL) == 0), function handle_device, file fruitstrap.c, line 523.
]
You can use Appium to install your app on your device, Just uninstall your App manually and in setUp code use absolute path of .apk file like this:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("VERSION", "5.1.1");
capabilities.setCapability("deviceName", "Name");
File appDir = new File("/home/filename/ProjectFile");
File app = new File(appDir, "appname.apk");
capabilities.setCapability("app",app.getAbsolutePath());
It will install your app on your device.
You said you tried to launch on real device, but your logs saying you tried to launch on simulator.
If you are using UI version of appium, Please uncheck Force Device option in appium and give UDID of real device which you connected in appium and prelaunch. your app will be installed.

Resources