{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/6679","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/6679/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/6679/comments","events_url":"https://api.github.com/repos/appium/appium/issues/6679/events","html_url":"https://github.com/appium/appium/issues/6679","id":166772516,"number":6679,"title":"Appium does not detect the pre-existing app on iOS device","user":{"login":"wildwolfeng","id":10113531,"avatar_url":"https://avatars.githubusercontent.com/u/10113531?v=3","gravatar_id":"","url":"https://api.github.com/users/wildwolfeng","html_url":"https://github.com/wildwolfeng","followers_url":"https://api.github.com/users/wildwolfeng/followers","following_url":"https://api.github.com/users/wildwolfeng/following{/other_user}","gists_url":"https://api.github.com/users/wildwolfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/wildwolfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildwolfeng/subscriptions","organizations_url":"https://api.github.com/users/wildwolfeng/orgs","repos_url":"https://api.github.com/users/wildwolfeng/repos","events_url":"https://api.github.com/users/wildwolfeng/events{/privacy}","received_events_url":"https://api.github.com/users/wildwolfeng/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/appium/appium/labels/NeedsTriage","name":"NeedsTriage","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-21T09:13:16Z","updated_at":"2016-07-21T09:37:05Z","closed_at":null,"body":"## The problem\r\n\r\nWhen I attempt to run appium with iOS bundle id, it says app was not installed\r\n\r\n## Environment\r\n\r\n* Appium version (or git revision) that exhibits the issue:\r\nAppium 1.5.3\r\n* Desktop OS/version used to run Appium:\r\nMAC OSX 10.11.6\r\n* Node.js version (unless using Appium.app|exe):\r\n5.12.0\r\n* Mobile platform/version under test:\r\niPhone 6 with iOS 10\r\n* Real device or emulator/simulator:\r\nReal device\r\n* Appium CLI or Appium.app|exe:\r\nCLI\r\n\r\n## Details\r\n\r\n**My script :**\r\n\r\n```\r\nclass SimpleIOSTests(unittest.TestCase):\r\n    def setUp(self):\r\n        # set up appium\r\n        self.driver = webdriver.Remote(\r\n            command_executor='http://localhost:4723/wd/hub',\r\n            desired_capabilities={\r\n                'app': 'com.XXXX.XXX',\r\n                'udid':'MY UDID',\r\n                'platformVersion': '10.0',\r\n                'platformName': 'iOS',\r\n                'deviceName': 'xPhone'\r\n            })\r\n......\r\n\r\n```\r\n**Appium logs:**\r\n\r\n[debug] [iOS] App is an iOS bundle, will attempt to run as pre-existing\r\n[debug] [iOS] Removing any remaining instruments sockets\r\n[debug] [iOS] Cleaned up instruments socket /var/folders/58/9bpqjjfj2kq6thd7_knk0t5c0000gq/T/instruments_sock\r\n[debug] [iOS] No language specified. Using default strings\r\n[debug] [iOS] Strings file not found. Looking in 'en.lproj' directory\r\n[iOS] Could not file localizable strings file 'Localizable.strings'!\r\n[debug] [iOS] Creating instruments\r\n[debug] [UIAuto] Preparing bootstrap code\r\n[debug] [UIAuto] Dynamic bootstrap dir: /Users/fyu/Library/Application Support/appium/bootstrap\r\n[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\"}\r\n...bug] [UIAuto] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!\r\n[debug] [UIAuto] Dynamic bootstrap path: /Users/fyu/Library/Application Support/appium/bootstrap/bootstrap-c22bb713e711df3f.js\r\n[debug] [UIAuto] Reusing dynamic bootstrap: /Users/fyu/Library/Application Support/appium/bootstrap/bootstrap-c22bb713e711df3f.js\r\n[debug] [iOS] Running ios real device reset flow\r\n[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog\r\n[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'\r\n[debug] [iOS] Creating iDevice object with did MY UDID\r\n[debug] [iOS] App is not installed. Will try to install.\r\n[MJSONWP] Encountered internal error running command: Error: Installing com.XXXX.XXXX failed\r\n    at /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/node-idevice/main.js:159:6\r\n    at ChildProcess.exithandler (child_process.js:193:7)\r\n    at emitTwo (events.js:100:13)\r\n    at ChildProcess.emit (events.js:185:7)\r\n    at maybeClose (internal/child_process.js:850:16)\r\n    at Socket.<anonymous> (internal/child_process.js:323:11)\r\n    at emitOne (events.js:90:13)\r\n    at Socket.emit (events.js:182:7)\r\n    at Pipe._onclose (net.js:484:12)\r\n\r\n\r\n**Then I modify the main.js:**\r\n\r\n```\r\nIDevice.prototype.install = function (app, cb) {\r\n    exec(this._build_cmd(['-i', wrapForExec(app)]), function (err, stdout, stderr) {\r\n\tif (err) {\r\n\t    cb(err, stdout);\r\n\t} else {\r\n\t    if (stdout.indexOf('Complete') != -1) {\r\n\t\tcb(null);\r\n\t    } else {\r\n**Here use cb(null) to instead of threw new error**\r\n  \t\t//cb(new Error('Installing ' + app + ' failed'));\r\n\t\tcb(null);\r\n\t    }\r\n\t}\r\n    });\r\n};\r\n```\r\n\r\n**Then I relaunch appium server and run my script, it works fine.** \r\n\r\nBTW, 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.\r\n"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/234205144","html_url":"https://github.com/appium/appium/issues/6679#issuecomment-234205144","issue_url":"https://api.github.com/repos/appium/appium/issues/6679","id":234205144,"user":{"login":"wildwolfeng","id":10113531,"avatar_url":"https://avatars.githubusercontent.com/u/10113531?v=3","gravatar_id":"","url":"https://api.github.com/users/wildwolfeng","html_url":"https://github.com/wildwolfeng","followers_url":"https://api.github.com/users/wildwolfeng/followers","following_url":"https://api.github.com/users/wildwolfeng/following{/other_user}","gists_url":"https://api.github.com/users/wildwolfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/wildwolfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildwolfeng/subscriptions","organizations_url":"https://api.github.com/users/wildwolfeng/orgs","repos_url":"https://api.github.com/users/wildwolfeng/repos","events_url":"https://api.github.com/users/wildwolfeng/events{/privacy}","received_events_url":"https://api.github.com/users/wildwolfeng/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T09:37:05Z","updated_at":"2016-07-21T09:37:05Z","body":"@mykola-mokhnach Yes, I have tried on another iPhone 6 with iOS 9.1, and I also erase all settings and content of my device, it does not help."}}
{"actor":{"display_login":"wildwolfeng"}}