Xcode ui test - m1 swipe problem

On an intel mac, my XCUITest test cases which is included swipe actions works perfectly but it doesn't work on my m1 mac. I tried running simulator with Rosetta but it doesnt work out it still gives an error when I run my cases because it clicks instead of swipe.

Does anyone have a solution for swiping problem on the m1?

Hello!

Do you have a sample code you are running to reproduce this error? We would love to help you find a solution here, or dive deeper if there is an issue.

Thanks.

 cells.element(boundBy: 0).swipeLeft()

@DeveloperToolsEngineer

I'm not sure, if it's the same problem or not, but I also faced problems with failing swipes in UI tests (in iOS simulator): at least in certain cases (like swipeLeft() to reveal the standard "accessory menu" on a table row), they behave like clicks. I was able to pinpoint it to running x86_64 build of UI tests on M1 (adding ARCHS=x86_64 to xcodebuild arguments). With the very same native build on M1, swipes in UI tests behave as expected.

Just in case, I'm reproducing it on Xcode 13.4.1 and iOS simulator for iPhone 8 running iOS 15.2. Will check most recent iOS 15.5 a bit later.

I am having the same issue as described by @grigorye on Xcode 14 Beta 6, in iOS Simulator. Running a M1 MacBook Pro with Monterey 12.5.1. Note: running Xcode via Rosetta at the moment. The swipe left gesture on a fairly standard table view cell to reveal the accessory menu fails and behaves as a click when calling element(...).swipeLeft()

I don’t have any input about this issue in general, sorry, but I want to stress that this:

running Xcode via Rosetta at the moment.

is not a supported configuration. If you run Xcode under Rosetta you will encounter all sorts of weird problems, so I recommend that you rule out that as a possibility first. You can do that by:

  1. Running Xcode natively.

  2. If your main project doesn’t compile like that, create a small test project that exercises this case.

  3. Does that still reproduce the problem?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

After loads of investigation, I managed to find out what the cause of the issue was for our project. It worked locally (running through Xcode itself) but for our CI machines it didn't (which is where we use CLI). But basically we were building our UI test bundle on the x86_64 architecture and excluding arm64. You need arm64 (which would make sense) for the M1 Simulators to swipe correctly. This small removal solved all of our problems and the UI tests work as they should. Check your Build Settings in your project.

# Before
xcodebuild build-for-testing -workspace ProjectName/ProjectName.xcworkspace ........ EXCLUDED_ARCHS=arm64

# After
xcodebuild build-for-testing -workspace ProjectName/ProjectName.xcworkspace ........

Some solutions online will tell you to run the simulator in Rosetta - don't, it doesn't solve the issue.

Xcode ui test - m1 swipe problem
 
 
Q