Appium does not detect the pre-existing app on iOS device
See original GitHub issueThe problem
When I attempt to run appium with iOS bundle id, it says app was not installed
Environment
- Appium version (or git revision) that exhibits the issue: Appium 1.5.3
- Desktop OS/version used to run Appium: MAC OSX 10.11.6
- Node.js version (unless using Appium.app|exe): 5.12.0
- Mobile platform/version under test: iPhone 6 with iOS 10
- Real device or emulator/simulator: Real device
- Appium CLI or Appium.app|exe: CLI
Details
My script :
class SimpleIOSTests(unittest.TestCase):
def setUp(self):
# set up appium
self.driver = webdriver.Remote(
command_executor='http://localhost:4723/wd/hub',
desired_capabilities={
'app': 'com.XXXX.XXX',
'udid':'MY UDID',
'platformVersion': '10.0',
'platformName': 'iOS',
'deviceName': 'xPhone'
})
......
Appium logs:
[debug] [iOS] App is an iOS bundle, will attempt to run as pre-existing [debug] [iOS] Removing any remaining instruments sockets [debug] [iOS] Cleaned up instruments socket /var/folders/58/9bpqjjfj2kq6thd7_knk0t5c0000gq/T/instruments_sock [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] Creating instruments [debug] [UIAuto] Preparing bootstrap code [debug] [UIAuto] Dynamic bootstrap dir: /Users/fyu/Library/Application Support/appium/bootstrap [debug] [UIAuto] Dynamic env: {“nodePath”:“/usr/local/Cellar/node5/5.12.0/bin/node”,“commandProxyClientPath”:“/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js”,“instrumentsSock”:“/var/folders/58/9bpqjjfj2kq6thd7_knk0t5c0000gq/T/instruments_sock”,“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“autoDismissAlerts”:false,“sendKeyStrategy”:“grouped”} …bug] [UIAuto] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify! [debug] [UIAuto] Dynamic bootstrap path: /Users/fyu/Library/Application Support/appium/bootstrap/bootstrap-c22bb713e711df3f.js [debug] [UIAuto] Reusing dynamic bootstrap: /Users/fyu/Library/Application Support/appium/bootstrap/bootstrap-c22bb713e711df3f.js [debug] [iOS] Running ios real device reset flow [debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog [debug] [iOSLog] Found idevicesyslog: ‘/usr/local/bin/idevicesyslog’ [debug] [iOS] Creating iDevice object with did MY UDID [debug] [iOS] App is not installed. Will try to install. [MJSONWP] Encountered internal error running command: Error: Installing com.XXXX.XXXX failed at /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/node-idevice/main.js:159:6 at ChildProcess.exithandler (child_process.js:193:7) at emitTwo (events.js💯13) at ChildProcess.emit (events.js:185:7) at maybeClose (internal/child_process.js:850:16) at Socket.<anonymous> (internal/child_process.js:323:11) at emitOne (events.js:90:13) at Socket.emit (events.js:182:7) at Pipe._onclose (net.js:484:12)
Then I modify the main.js:
IDevice.prototype.install = function (app, cb) {
exec(this._build_cmd(['-i', wrapForExec(app)]), function (err, stdout, stderr) {
if (err) {
cb(err, stdout);
} else {
if (stdout.indexOf('Complete') != -1) {
cb(null);
} else {
**Here use cb(null) to instead of threw new error**
//cb(new Error('Installing ' + app + ' failed'));
cb(null);
}
}
});
};
Then I relaunch appium server and run my script, it works fine.
BTW, when I run ideviceinstaller -l manually, it prompts “Could not connect to lockdownd. Exiting.”, but I don’t know why this happened. Maybe it’s the root cause.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (2 by maintainers)
Top GitHub Comments
To run automation on iOS10 you need to use appium 1.6 with xcuit driver 😃 appium 1.5.3 won’t work on iOS10.
Meanwhile, After a lot of googling and research, came across this post. Helped me fix the issue. May be a temporary fix, but it works.
http://stackoverflow.com/questions/39035415/ideviceinstaller-fails-with-could-not-connect-to-lockdownd-exiting
Use: sudo chmod -R 777 /var/db/lockdown/