Why the .app failed to install on device from Appium, but can be installed through Xcode?

Mac 10.11
Xcode 7.2 iOS9.2 Build target iOS9.0
Appium 1.4.13

Issue:
I can generate a debug build signed with developer certificate in Xcode, and install the app successfully on my real device.
Then I copy the .app to a path, in Appium GUI, point the app path to the .app path, input necessary information, then launch, success
Then run my test in eclipse, got below log in Appium GUI:

info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session cbe9d3ba-f42f-4c7a-b21f-87eb5e7132ea
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 iOS.app/Contents/Resources/node_modules/appium/com.ibm.lotus.sametime/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 iOS.app/Contents/Resources/node_modules/appium/com.ibm.lotus.sametime/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/rachel/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {“nodePath”:"/Applications/Appium iOS.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium iOS.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/rachel/Library/Application Support/appium/bootstrap/bootstrap-3eedab70f65297b9.js
info: [debug] Reusing dynamic bootstrap: /Users/rachel/Library/Application Support/appium/bootstrap/bootstrap-3eedab70f65297b9.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with udid 814d53f77e5c5ecf2eca376ae3696dffa692cec8

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

info: [IOS_SYSLOG_ROW ] Mar 17 17:08:22 Ya-min-teki-iPad syslog_relay[709] : syslog_relay found the ASL prompt. Starting…

info: [debug] Cleaning up appium session

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

info: [debug] Error: Installing com.ibm.lotus.sametime failed
at /Applications/Appium iOS.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. (child_process.js:1183:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:485:12)

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Installing com.ibm.lotus.sametime failed)”,“origValue”:“Installing com.ibm.lotus.sametime failed”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 3666.325 ms - 202
info: [IOS_SYSLOG_ROW ] Mar 17 17:08:24 Ya-min-teki-iPad mobile_installation_proxy[180] : 0x1f197000 handle_connection: Could not receive request from host.

I don’t have any idea about this error, could anyone advise me? Thank you!

From the log it looks like you are trying to run the real device code (which is compiled for ARM processor) on a Simulator (X86 processor). Is this what you are trying to do? If so you’ll either need to get a version of the app that is compiled to run on the Simulator or you’ll have to configure Appium to run this on a real device.

If this is failing on a real device please post your capabilities.

@wreed Thank you, please help take a look:
Here is my capabilities:
/*For device/
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, “iOS”);
capabilities.setCapability(“platformName”, “Mac”);
capabilities.setCapability(“deviceName”, “iPad 2”);
capabilities.setCapability(“platformVersion”, “9.0”);
capabilities.setCapability(“appium-version”, “1.4.13”);
String appBID=“com.ibm.lotus.sametime”;
capabilities.setCapability(“app”,appBID);
//capabilities.setCapability(“language”,“es”);
// support Chinese
capabilities.setCapability(“unicodeKeyboard”, “True”);
capabilities.setCapability(“resetKeyboard”, “True”);
try{
driver = new IOSDriver (new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);
}catch(MalformedURLException e){
e.printStackTrace();
}

Can you tell me what appBID represents? What does it expand to?

@wreed the appBID is the bundle identifier of the app I want to test…

Can you try setting it to the path to the app that you want to test?

Wow, it works! Thank you very much! @wreed

1 Like

i am getting the following error when trying to install the app through appium…help me out

[debug] [iOS] Creating iDevice object with udid 4dd7e471d61bbcd88c4050ef054a46b2b77846c8

[debug] [iOS] App is not installed. Will try to install.

[iOSLog] [IOS_SYSLOG_ROW] Sep 22 19:11:42 iPhone mobile_installation_proxy[227] : 0x16e2d3000 handle_connection: Could not receive request from host.

[MJSONWP] Encountered internal error running command: Error: Installing /Users/office/Documents/app/phoenix-reader.app failed
at /Applications/Appium.app/Contents/Resources/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:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Socket. (internal/child_process.js:323:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)

Even i am getting this same error… pasting it below… ( i am trying the automation for iOS native app)

[debug] [iOS] App is not installed. Will try to install.

[MJSONWP] Encountered internal error running command: Error: Installing /var/folders/rf/f4vlhjks42l40bcs9fl19_l00000gn/T/2016828-1057-13yy5xd/Payload/ExamSoft.app failed
at /Applications/Appium.app/Contents/Resources/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:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Socket. (internal/child_process.js:323:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)