Installing the application on the iOS phone is very slow

Xcode - 12.00
Mac 10.15.7
iOS - 14.7.1 Xc
Apium v1.22

Very long install app on my device, before i update to 1.22 it was installed in 25-30 seconds, but now it 201 sec.

My Log:
[Appium] Welcome to Appium v1.22.0
[Appium] Non-default server args:
[Appium] wdaLocalPort: 8101
[Appium] relaxedSecurityEnabled: true
[Appium] allowInsecure: {
[Appium] }
[Appium] denyInsecure: {
[Appium] }
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {“desiredCapabilities”:{“deviceName”:“iPhone XS”,“platformVersion”:“13.4”,“udid”:“00008020-001C48A21EBA002E”,“automationName”:“XCUITest”,“derivedDataPath”:"/Users/myFile/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp",“bundleId”:“au.com.somethink.mobileconnect”,“appPushTimeout”:3000000,“app”:"/Users/myFile/Builds/somethink_Resorts.ipa",“platformName”:“iOS”},“capabilities”:{“firstMatch”:[{“platformName”:“iOS”}]}}
[W3C] Calling AppiumDriver.createSession() with args: [{“deviceName”:“iPhone XS”,“platformVersion”:“13.4”,“udid”:“00008020-001C48A21EBA002E”,“automationName”:“XCUITest”,“derivedDataPath”:"/Users/myFile/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp",“bundleId”:“au.com.somethink.mobileconnect”,“appPushTimeout”:3000000,“app”:"/Users/myFile/Builds/somethink_Resorts.ipa",“platformName”:“iOS”},null,{“firstMatch”:[{“platformName”:“iOS”}]}]
[BaseDriver] Event ‘newSessionRequested’ logged at 1633528996199 (17:03:16 GMT+0300 (Eastern European Summer Time))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: [“deviceName”,“platformVersion”,“udid”,“automationName”,“derivedDataPath”,“bundleId”,“appPushTimeout”,“app”]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver] deviceName
[BaseDriver] platformVersion
[BaseDriver] udid
[BaseDriver] automationName
[BaseDriver] derivedDataPath
[BaseDriver] bundleId
[BaseDriver] appPushTimeout
[BaseDriver] app
[Appium] Appium v1.22.0 creating new XCUITestDriver (v3.53.1) session
[Appium] Applying relaxed security to ‘XCUITestDriver’ as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver] “alwaysMatch”: {
[BaseDriver] “appium:deviceName”: “iPhone XS”,
[BaseDriver] “appium:platformVersion”: “13.4”,
[BaseDriver] “appium:udid”: “00008020-001C48A21EBA002E”,
[BaseDriver] “appium:automationName”: “XCUITest”,
[BaseDriver] “appium:derivedDataPath”: “/Users/myFile/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp”,
[BaseDriver] “appium:bundleId”: “au.com.somethink.mobileconnect”,
[BaseDriver] “appium:appPushTimeout”: 3000000,
[BaseDriver] “appium:app”: “/Users/myFile/Builds/somethink_Resorts.ipa”,
[BaseDriver] “platformName”: “iOS”
[BaseDriver] },
[BaseDriver] “firstMatch”: [
[BaseDriver] {}
[BaseDriver] ]
[BaseDriver] }
[BaseDriver] Session created with session id: 26e4fd9c-1206-495a-9402-8411159ccdc9
[XCUITest] Current user: ‘myFile’
[XCUITest] Available devices: 00008020-001C48A21EBA002E
[XCUITest] Creating iDevice object with udid ‘00008020-001C48A21EBA002E’
[XCUITest] Determining device to run tests on: udid: ‘00008020-001C48A21EBA002E’, real device: true
[BaseDriver] Event ‘xcodeDetailsRetrieved’ logged at 1633528996243 (17:03:16 GMT+0300 (Eastern European Summer Time))
[BaseDriver] Using local app ‘/Users/myFile/Builds/somethink_Resorts.ipa’
[BaseDriver] Will reuse previously cached application at ‘/var/folders/zg/kxqyqh8x4qj3169v15ppfrxw0000gp/T/202196-570-x091yt.scwp/somethink Resorts.app’
[BaseDriver] Event ‘appConfigured’ logged at 1633528996684 (17:03:16 GMT+0300 (Eastern European Summer Time))
[XCUITest] Checking whether app ‘/var/folders/zg/kxqyqh8x4qj3169v15ppfrxw0000gp/T/202196-570-x091yt.scwp/somethink Resorts.app’ is actually present on file system
[XCUITest] App is present
[BaseDriver] Event ‘resetStarted’ logged at 1633528996688 (17:03:16 GMT+0300 (Eastern European Summer Time))
[XCUITest] Reset: running ios real device reset flow
[BaseDriver] Event ‘resetComplete’ logged at 1633528996688 (17:03:16 GMT+0300 (Eastern European Summer Time))
[WebDriverAgent] Using WDA path: ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent’
[WebDriverAgent] Using WDA agent: ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj’
[XCUITest] Crash reports root ‘/Users/myFile/Library/Logs/CrashReporter/MobileDevice/iPhone XS (somethink)’ does not exist. Got nothing to gather.
[BaseDriver] Event ‘logCaptureStarted’ logged at 1633528997729 (17:03:17 GMT+0300 (Eastern European Summer Time))
[XCUITest] Setting up real device
[XCUITest] Verifying application platform
[XCUITest] CFBundleSupportedPlatforms: [“iPhoneOS”]
[XCUITest] Reset requested. Removing app with id ‘au.com.somethink.mobileconnect’ from the device
[XCUITest] Installing ‘/var/folders/zg/kxqyqh8x4qj3169v15ppfrxw0000gp/T/202196-570-x091yt.scwp/somethink Resorts.app’ on device with UUID ‘00008020-001C48A21EBA002E’…
[XCUITest] Pushed the app files successfully after 195626ms
[XCUITest] App installation succeeded after 201847ms
[XCUITest] The app has been installed successfully.
[BaseDriver] Event ‘appInstalled’ logged at 1633529200879 (17:06:40 GMT+0300 (Eastern European Summer Time))
[WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8101 have been found
[DevCon Factory] Requesting connection for device 00008020-001C48A21EBA002E on local port 8101, device port 8101
[DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for 00008020-001C48A21EBA002E:8101
[XCUITest] Starting WebDriverAgent initialization with the synchronization key ‘/Users/myFile/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp’
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8101/status] with no body
[[email protected]:8101] Unexpected data: {“header”:{“length”:294,“version”:1,“type”:8,“tag”:1},“payload”:{“MessageType”:“Result”,“Number”:2}}
[WD Proxy] socket hang up
[WebDriverAgent] WDA is not listening at ‘http://127.0.0.1:8101/
[WebDriverAgent] WDA is currently not running. There is nothing to cache
[XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
[XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[BaseDriver] Event ‘wdaStartAttempted’ logged at 1633529201211 (17:06:41 GMT+0300 (Eastern European Summer Time))
[WebDriverAgent] Launching WebDriverAgent on the device
[WebDriverAgent] WebDriverAgent does not need a cleanup. The sources are up to date (1632535255000 >= 1632535255000)
[WebDriverAgent] Killing running processes ‘xcodebuild.*00008020-001C48A21EBA002E’ for the device 00008020-001C48A21EBA002E…
[WebDriverAgent] xcodebuild exited with code ‘75’ and signal ‘null’
[WebDriverAgent] Beginning test with command ‘xcodebuild build-for-testing test-without-building -project /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/myFile/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp -destination id=00008020-001C48A21EBA002E IPHONEOS_DEPLOYMENT_TARGET=13.4 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO’ in directory ‘/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent’
[WebDriverAgent] Output from xcodebuild will only be logged if any errors are present there. To change this, use ‘showXcodeLog’ desired capability
[WebDriverAgent] Waiting up to 60000ms for WebDriverAgent to start
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8101/status] with no body
[[email protected]:8101] Unexpected data: {“header”:{“length”:294,“version”:1,“type”:8,“tag”:1},“payload”:{“MessageType”:“Result”,“Number”:2}}
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8101/status] with no body
[[email protected]:8101] Unexpected data: {“header”:{“length”:294,“version”:1,“type”:8,“tag”:1},“payload”:{“MessageType”:“Result”,“Number”:2}}
[WD Proxy] socket hang up
[WebDriverAgent] Log file for xcodebuild test: /Users/myFile/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.10.06_17-06-44-+0300.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-9911FA25-041C-4395-AA56-934869A2B80C/WebDriverAgentRunner-8A0B0DBB-B16C-4102-8ABA-BC5A4865991E/Session-WebDriverAgentRunner-2021-10-06_170644-hQ9s2T.log

Might be the old Xcode you are using. You could go up to 12.4 on 10.15 Mac OS:

https://en.wikipedia.org/wiki/Xcode#12.x_series

I updated the Xcode version to 12.4 but the problem remained.

you said your device:

but in logs your caps are:

Yes, it my mistake, i changed it, but it does not affect because it was long time and i had the fast install app.

write your caps when you try fast start.

Sry, i didn’t understand what do u mean “write your caps when you try fast start.” ?

write your capabilities how you open driver. 25-30 sec looks toooo much even when app already installed on phone. it can be only when you reinstall your app with each test.
e.g. i have 2 sec

start from looking at -> Different capabilities for different scenarios

Yes, i reinstalled app with each test because it need for my scenarios.
My capabilities for start driver:
opt.AddAdditionalCapability(MobileCapabilityType.DeviceName, pres.iOSdeviceName);
opt.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, pres.iOSplatformVersion);
opt.AddAdditionalCapability(MobileCapabilityType.Udid, pres.iOSudid);
opt.AddAdditionalCapability(MobileCapabilityType.AutomationName, “XCUITest”);
opt.AddAdditionalCapability(“bundleId”, pres.UATbundelIdiOS);
opt.AddAdditionalCapability(“appPushTimeout”, 3000000);
opt.AddAdditionalCapability(MobileCapabilityType.App, pres.iOSapp);
}
if (isNoreset == true) opt.AddAdditionalCapability(“noReset”, true);

Now i tried change my real device and app installed fast (21 sec) but now i have another erorr:

  • OpenQA.Selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70
    xcodebuild error message:
    . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.

I try reboot but it doesn`t help me.

  1. build WDA app yourself for Generic Device. See ’ Full manual configuration’ in link error.
  2. add capability to use these pre-build WDA:
capabilities.setCapability(IOSMobileCapabilityType.USE_PREBUILT_WDA, true);
  1. make sure that new phone included into developer signature. otherwise you will not be able to install your ipa file on new phone.

I did and it helped, but again with
installation speed problem. In general, what determines the process of installing the application and its speed?

[info][35m[XCUITest][39m Setting up real device
[debug][35m[XCUITest][39m Verifying application platform
[debug][35m[XCUITest][39m CFBundleSupportedPlatforms: [“iPhoneOS”]
[debug][35m[XCUITest][39m Installing ‘/var/folders/zg/kxqyqh8x4qj3169v15ppfrxw0000gp/T/202198-2260-dli0d6.c325j/My_Resorts.app’ on device with UUID ‘00008020-001C48A21EBA002E’…
[debug][35m[XCUITest][39m Pushed the app files successfully after 87477ms
[info][35m[XCUITest][39m App installation succeeded after 94337ms
[debug][35m[XCUITest][39m The app has been installed successfully.

just wonder what size of app? also interesting you use “app” while “ipa” is for real device.

Now 86 651 252 bytes (100,7 MB on disk), but we are still developing and adding new features and it adds size.

I noticed an interesting thing, when I tried again to pass the test on the 11th iPhone, the application was delivered in 15 seconds, I changed the USB connection where the 11th iPhone was connected and connected the 10th iPhone and now on the 10th iPhone the application was delivered in 20 seconds instead of the previous time for 90 sec. Although I had previously run 5 tests on 10 iPhones and all times the application was installed in 90-180 seconds.

maybe problem in cable? our app have similar size. and we have sec…
fullReset: completed in - 41 sec
normal start (no app on phone. installing): completed in - 11 sec
normal start (app installed on phone): completed in - 2 sec

Troubleshooting bad cables can be a nightmare. The instant I suspect one is bad I just replace it.

Thank you, I will try to experiment with the cable on Monday, although at the same input and the same cable showed the result of 200 seconds and 20 seconds. In general, when the process is running, what happens under the hood, can it be traced somehow? Maybe it checks some permissions or certificates or launches something?

Check how app install works with ideviceinstaller

using ideviceinstaller which can be installed using brew install ideviceinstaller
# list installed app on the connected device
# it also lists the identifier of the installed packages
ideviceinstaller -l

# install ipa
ideviceinstaller -i <your-package.ipa>

# uninstall app
ideviceinstaller -U <your-app-id>

Сable replacement does not help, checked the command “ideviceinstaller -i <your-package.ipa>” it installs the application in 10 seconds, provided that XCUITest installs in 180 seconds + -. I checked that as soon as the application is installed for a long time, changing the input (not the cable) helps to return the installation time by + - 20 seconds.

Try [email protected] with https://github.com/appium/appium-xcuitest-driver/pull/1339

Basically, it is now possible to set a custom app installation strategy and to have more control over the app deployment process