Appium [iOS] Instruments crashed on startup

家住魔仙堡 提交于 2019-12-18 09:14:18

问题


Maybe somebody can help me.

When appium tries to run application, the screen flashes with app splash screen, as if appium tries to launch app multiple times. This behaviour happens both on simulator and real device.

I set enable on my iOS devices UI Autimation, but when i try start inspector i have this problem:

info: [debug] [INST STDERR] 2015-11-05 15:11:05.082 instruments[1495:39489] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-11-05 15:11:06.049 instruments[1495:39460] Attempting to change event horizon while disengage

error: Failed to start an Appium session, err was: Error: Instruments crashed on startup

info: [debug] [INST STDERR] 2015-11-05 15:11:06.049 instruments[1495:39462] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Permission to debug com.myapp.iphone was denied. The app must be signed with a development identity (e.g. iOS Developer).
info: [IOS_SYSLOG_ROW ] Nov  5 15:11:04 tests-iPod com.apple.xpc.launchd[1] (UIKitApplication:com.myapp.iphone[0xe163][607]) <Notice>: Service exited due to signal: Killed: 9
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
info: [debug] Stopping iOS log capture
info: [debug] Reset not set, not ending sim or cleaning up app state
info: [debug] Cleaning up appium session
info: [debug] Error: Instruments crashed on startup
    at [object Object].Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:440:31)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:353:12)
    at ChildProcess.emit (events.js:110:17)
    at Process.ChildProcess._handle.onexit (child_process.js:1074: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
info: <-- POST /wd/hub/session 500 33841.937 ms - 182}

Application is in form of .ipa

Thanks, Best regards.


回答1:


Target failed to run: Permission to debug com.myapp.iphone was denied. 
The app must be signed with a development identity (e.g. iOS Developer).

You application should be signed with developers key. Click here for documentation




回答2:


If you are using iOS Simulator, do the following...

In Appium, go to Developer Settings, Check Custome Server Flags and write --native-instruments-lib in the text box.

Now start Appium Server.

Hope this helps!




回答3:


BlockquoteTarget failed to run: Permission to debug com.myapp.iphone was denied. The app must be signed with a development identity (e.g. iOS Developer). Blockquote

You should give your developer identity while creating the .ipa...

If you are creating ipa file through terminal, you can follow the given link [blog]: Xcode "Build and Archive" from command line




回答4:


I also struggled with this problem and found that you need to enable UI automation in developer option in you iDevice

How to enable UI Automation 1. switch off the iDevice, 2. then connect it to the Mac running Xcode 3. before switching it back on to have Developer options appear. 4. tap on developer option and Enable UI automation




回答5:


In my case, the following command made my life hell:

rm -rf $HOME/Library/Developer/Xcode/iOS\ DeviceSupport/*

So don't add it to the build step.

To fix the issue: Restart device > run Xcode > connect device > build & run the app > stop & quit Xcode

Now verify launching app without crashing the instruments.



来源:https://stackoverflow.com/questions/33546980/appium-ios-instruments-crashed-on-startup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!