簡體   English   中英

Appium [iOS]-無法在模擬器上啟動應用

[英]Appium [iOS] - Couldn't launch app on simulator

我已經安裝了Appium和用於通過iOS Simulator運行應用程序的所有必需的東西

然后,我啟動了一個模擬器並啟動了Appium(確保在啟動前已在“設置”中設置了應用程序的路徑)

我不知道是否應在啟動后立即打開該應用程序。 這就是為什么我要運行Inspector。 似乎已連接設備並開始安裝應用程序。 顯示啟動屏幕后,應用程序崩潰了。 我在另一個應用程序上嘗試了相同的流程,獲得了相同的結果。 這是來自Appium的日志:

info: [IOS_SYSLOG_ROW ] Jul 24 10:29:07 MacBook-apple com.apple.CoreSimulator.SimDevice.73F7270E-C69E-4CF5-8586-39358163963A.launchd_sim[6364] (UIKitApplication:com.wholefoods.WholeFoods[0x7ca4][6420]): Program specified by service does not contain one of the requested architectures: �<0
info: [IOS_SYSLOG_ROW ] Jul 24 10:29:07 MacBook-apple.local SpringBoard[6378]: Unable to get pid for 'UIKitApplication:com.wholefoods.WholeFoods[0x7ca4]': No such process (err 3)
info: [IOS_SYSLOG_ROW ] Jul 24 10:29:07 MacBook-apple.local SpringBoard[6378]: Unable to delete job with label UIKitApplication:com.wholefoods.WholeFoods[0x7ca4]. Error: Operation now in progress
info: [IOS_SYSLOG_ROW ] Jul 24 10:29:07 MacBook-apple.local SpringBoard[6378]: Application 'UIKitApplication:com.wholefoods.WholeFoods[0x7ca4]' exited for an unknown reason.
info: [IOS_SYSLOG_ROW ] Jul 24 10:29:07 MacBook-apple com.apple.CoreSimulator.SimDevice.73F7270E-C69E-4CF5-8586-39358163963A.launchd_sim[6364] (UIKitApplication:com.wholefoods.WholeFoods[0x7ca4][6420]): Trampoline was terminated before jumping to service: Killed: 9

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
info: [debug] Attempting to retry launching instruments, this is retry #2
info: [debug] Killall iOS Simulator
info: [IOS_SYSLOG_ROW ] Jul 24 10:29:07 MacBook-apple.local DTMobileIS[6387]: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
info: [IOS_SYSLOG_ROW ] Jul 24 10:29:07 MacBook-apple.local DTMobileIS[6387]: Could not create service named com.apple.instruments.server.services.launchdaemon

info: Launching instruments

info: [debug] Attempting to run app on iPad 2 (8.3 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPad 2 (8.3 Simulator)" /var/folders/7x/pfjm_c_s37ngl66yrs82ry3m0000gn/T/115624-6265-9ypyif/Payload/WholeFoods.app -e UIASCRIPT "/Users/apple/Library/Application Support/appium/bootstrap/bootstrap-4e580d338a12229a.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {"global":90000}

blablabla

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/node_modules/appium-instruments/lib/instruments.js:440:31)
at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/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 117025.667 ms - 182 

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

解決方案很簡單,盡管不簡單

為模擬器構建應用程序后:

  1. 在左側面板的Xcode中找到Products
  2. 在那里您將找到您的應用程序。 右鍵單擊它(即使它是紅色的)
  3. 在右側面板中,您將在Full Path看到Full Path 將其復制到最后一個元素。 例如,查看/projects/.../yourproject-<bhah>/Build/Products/Debug-iphoneos/yourproject.app您需要:/ /projects/.../yourproject-<bhah>/Build/Products 3.1。 或者,您也可以通過以下方式找到它:右鍵單擊它(即使它是紅色的)並選擇show in finder
  4. 轉到一個封閉文件夾(轉到- Go->Enclosing folder
  5. 打開該目錄。 您會在其中找到Debug-iphonesimulatoryourproject.app

那就是你需要的那個

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM