简体   繁体   中英

Unable to start appium inspector for real iOS device with bundle ID

I have a real device (Ipad Mini) hooked up to my Mac Book Pro. With the app I am trying to test already installed on the Ipad Mini. I am trying to run Appium inspector after I launch the server. But unfortunately, Appium Inspector is trying to install the app but failing. It is not just using the bundle ID already provided and proceed to open the app, instead of trying to install it using a blank app path.

I am wanting to know how do I set this up properly?

Here is the logs of the error:

info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"8.4","newCommandTimeout":"999999","automationName":"Appium","deviceName":"iPad Mini"}}
info: Client User-Agent string: Appium (unknown version) CFNetwork/720.5.7 Darwin/14.5.0 (x86_64)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: ****        NEW SESSION           ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 3336a71d-7695-44fb-9ee2-eaacae01c4bd
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Auto-detecting iOS udid...
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.xxxxxxxxx/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.xxxxxxxxxx/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn't exist
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/rj2501511/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/submodules/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/rj2501511/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js

info: [debug] Reusing dynamic bootstrap: /Users/rj2501511/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with udid xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

info: [debug] App is not installed. Will try to install the app.

info: [debug] Cleaning up appium session

info: [debug] Error: Installing com.xxxxxxxxxx failed
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/node-idevice/main.js:159:6
    at ChildProcess.exithandler (child_process.js:742:7)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)

error: Failed to start an Appium session, err was: Error: Installing com.xxxxxxxxx failed

info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Installing com.xxxxxxxx failed)","origValue":"Installing com.xxxxxxx failed"},"sessionId":null}
info: <-- POST /wd/hub/session 500 3264.173 ms - 192

Settings for Appium Server:

Using the Appium UI i have filled out the following:

BundleID: com.xxx.xxxx.xxxx
Force Device: Ipad Mini
Platform Version: 8.4
UDID: xxxxxxxxxxxxxxxxxxx
Show Simulator Log: checked

Then I proceed to launch the Appium server by clicking "Launch"

The following logs are produced:

info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)

info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {"app":"com.xxxxxxxxx","udid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxx","address":"127.0.0.1","deviceName":"iPad Mini","platformName":"iOS","platformVersion":"8.4","showIOSLog":true,"defaultCommandTimeout":7200,"debugLogSpacing":true}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}

info: <-- GET /wd/hub/status 200 6.923 ms - 105 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}

info: --> GET /wd/hub/status {}

So the server started fine.

So, what I did:

Through lots of documentation and reading I found out the basic requirement is:

1) app - absolute path to .ipa or .app file

2) udid - of device for real device automation

3) deviceName - this could be anything, it just can't be a null value

I was attempting to use the bundleId instead of the app path. Thinking if I had the app installed on the device, I could just use the bundleId to when launching the appium inspector. That did not work giving the above errors.

So I switched to app and used the absolute path. Appium will install the app first to my device, and appium inspector was able to launch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM