Appium v1.3.0-beta1 & xCode 6.1, Failed looking up pid of launched process

Hi All,

I’m totally new to Appium, so sorry in advance if this is a known/noob issue.
I’ve installed Appium and ran a little poc using an iPhone 6 iOS 8.1 simulator and Safari - this worked great.
Then I’ve tried running another test, using other apps (I’ve tried several small apps that all worked on the xCode simulator), but this doesn’t work at all.
What happens is that the simulator does go up, but fails running the app.

After failing several times these messages are the bottom line:
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Failed looking up pid of launched process info: [debug] [INSTSERVER] Instruments exited with code 253 info: [debug] Killall instruments info: [debug] Instruments crashed on startup

&&

error: Failed to start an Appium session, err was: Error: Instruments crashed on startup info: [debug] Error: Instruments crashed on startup at Instruments.onInstrumentsExit (/Users/User/Downloads/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:387:31) at null.<anonymous> (/Users/User/Downloads/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12) at ChildProcess.emit (events.js:98:17) at Process.ChildProcess._handle.onexit (child_process.js:810:12)

info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}
Please let me know if more info needed…

Thanks!

Are you trying to use a zipped file?
What I observed is that Appium 1.3 successfully opens MyApp.app, but it fails on MyApp.app.zip with logged errors similar to yours. FWIW, previous versions of Appium successfully opened both.

If the project contributors could return that functionality (ability to open file.app.zip in addition to file.app) my team would be very appreciative.

Unfortunately not… I’ve tried the same scenario several times:
Download/write some code > xcodebuild -target target -sdk iphoneos8.1 > load the target.app with the iphonesimulator > works fine > load the target.app with Appium > the simulator starts fine but fails to load the app (seems to get in some kind of loop which eventually makes the whole simulator to crash)…

Saw a bunch of those in the logs:
‘Program specified by service does not contain one of the requested architectures’
Did anyone encounter these in the past?

Yes, I have encountered that where the architecture is the bundle id of my app. This only appears if I built the app with xcodebuild on the command line. If I build the app manually, but pressing the “play” button in XCode, and then use the .app file generated from that process, I’m able to successfully open the app with Appium. Because it works in that case, I suspect that I’m not correctly passing some necessary parameter in the xcodebuild command. At this time, my Appium tests are only being run nightly, so instead of wasting more time on this problem, I’m just using the manual XCode process to make my daily builds. Once my team starts running Appium tests more frequently, I’ll need to revisit the xcodebuild command so that I can automate the process of building the iOS app into a file that Appium is actually happy with.

Hello. Have you been able to solve this issue. I am building the application from the command line with code build and am receiving the same error:

‘Program specified by service does not contain one of the requested architectures’

I am using the following Xcode build command:

xcodebuild  -destination 'platform=iOS Simulator,id=F8B6BFA9-4F96-4166-BC8C-XXXXXXXXXXXX' -target DigitalXXUI clean build 

I don’t know what params to add to this in order to make it work with the .app file that is generated from this command. Any help would be appreciated.

Thanks

1 Like

After many failed attempts I fixed this by using the following build command

xcodebuild -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -workspace MyWorkSpace.xcworkspace -scheme MyScheme CONFIGURATION_BUILD_DIR=/Users/MyUserName/Desktop/ clean build

Previously I had been exporting an xcarchive file into an app file, but I think the app needs to be built with the iphonesimulator sdk. This script just specifiers the build directory so I know where it’s saving the .app file.

4 Likes

Go to Settings on device-> Developer -> Enable UI automation