idb icon indicating copy to clipboard operation
idb copied to clipboard

idb_companion incorrect simulator architecture checks on M1 macs

Open iainsmith opened this issue 3 years ago • 0 comments

Description

idb-companion hard codes the simulator architecture to be x86_64 in this file, which prevents us from using arm64 simulators on M1 macs, due to checks run in [IDBStorageManager checkArchitecture:error]

  • I installed idb & idb-companion on an M1 Mac from homebrew
  • I ran the following commands (udid's omitted)
idb list-targets
idb boot
idb xctest install path-to-some-arm64/tests.xctest

I received the following error:

Targets architecture x86_64 not in the bundles supported architectures {
  arm64
}

I verified installing from source, that disabling the checks fix the issue.

Reproduction

On an m1 mac, build a test bundle for arm64, and try to install it to the simulator

Solution

There are a few options.

  • Teach idb-companion the correct architecture if running on an M1 Mac (ideal)
  • Provide an IDB_DISABLE_ARCHITECTURE_CHECKS variable

Additional Information

  • Verified that disabling the checks works around the issue, by installing from source.
  • Side effects, idb list-targets shows the wrong simulator architecture
  • I believe the arm64 simulators can support both x86 and arm64 binaries` although I haven't verified this, so the strict checks might not be needed if running on an M1.

e.g

iPhone 12 | 363E6C97-DB9D-44A0-9F85-FB14623B1D45 | Shutdown | simulator | iOS 16.0 | x86_64 | No Companion Connected
iPhone 12 | 654EF4DD-10F2-45FE-B8AC-45D7C4CBB191 | Shutdown | simulator | iOS 16.0 | x86_64 | No Companion Connected

iainsmith avatar Nov 29 '22 09:11 iainsmith