Ditch the Simulator — Running Expo Dev Client natively on an M1 Mac

Derek Stavis
3 min readAug 13, 2022

--

While working on Kilowatt, my side project app that uses Bluetooth to communicate with e-bike controllers to configure them and track rides, I often saw myself switching between Simulator and actual device to be able to test Bluetooth communication.

Having gotten a M1 Mac recently I thought that creating a an Expo Dev Client that could be installed directly on the Mac, like how iOS apps can now be installed on macOS, would be a cool solution to this problem.

Building a signed app

Apple is pretty good at code signature, and so don’t think you will get away by just downloading a custom dev client built by EAS and double clicking. You will receive an error message saying the application could not be verified.

To be able to get the app to be signed, you need to add the M1 MBP to your app’s Provisioning Profile. The Expo way of doing this is by following an URL which registers the device for Ad-hoc building, but accessing that URL on macOS Safari won’t get the profile installed.

Registering the Mac on EAS

To register the machine on EAS, run eas device:create. Select “Input”:

Now you will need to get your Mac UDID. Click on the Apple logo on the top left of the screen, hold Option and click System Information. On the app that opens, copy the Provisioning UDID value.

Next, paste that on the CLI and follow the next steps.

Building the app

Now that the profile is set up, you can proceed to build with eas build. Make sure you are using a profile set as internal:

At some point of the build, the CLI will ask for the devices you want to add to the Provisioning Profile. Make sure you have selected the newly added device. Proceed with the build, and you should get an .IPA file out of Expo dashboard. Download and double click it.

After the installation, the app will appear on the Applications directory and can be launched from Launchpad or Spotlight.

Gotchas

Although this works great, operates much faster than on the Simulator, and gives access to all available hardware (including microphone, camera, bluetooth, etc), there are gotchas:

  • There’s no way to shake the device. Press R to reload the app. All the Dev Menu keyboard shortcuts work. Get familiar with them.
  • There’s no way to resize the window or scale the application. It’s fixed on that tiny size unfortunately.

Hope this helps everyone looking to do some closer to life testing at the comfort of their Mac.

--

--