.ipa
or .apk
from the command line without drag-and-drop in Expo Orbit?I often build my Expo project locally using:
eas build --local --platform ios/android
However, after the build is complete, I have to manually drag and drop the generated .ipa or .apk file into the Expo Orbit menu bar app to install it on my device. This step is tedious and time-consuming.
I would like to automate this process by specifying the path to the generated build file and the target device directly from the command line, something like:
eas build:run \
--local \
--pathToIPAorAPK build-1234567890.ipa/apk \
--deviceId myIPhoneOrAndroidID
This would allow me to skip the drag-and-drop step entirely and install the app programmatically.
I came across this InstallAndLaunchApp.ts file in the Expo Orbit source code, which suggests that the CLI might already support installing and launching apps from the command line by passing appPath and deviceId.
However, I’m unsure how to use this functionality.
Then I also tried eas cli but no luck there too.
$ eas build:run --help
run simulator/emulator builds from eas-cli
USAGE
$ eas build:run [--latest | --id <value> | --path
<value> | --url <value>] [-p android|ios] [-e <value>]
[--offset <value>] [--limit <value>]
FLAGS
-e, --profile=PROFILE_NAME Name of the build profile used to
create the build to run. When
specified, only builds created with
the specified build profile will be
queried.
-p, --platform=(android|ios)
--id=<value> ID of the simulator/emulator build
to run
--latest Run the latest simulator/emulator
build for specified platform
--limit=<value> The number of items to fetch each
query. Defaults to 50 and is capped
at 100.
--offset=<value> Start queries from specified index.
Use for paginating results.
Defaults to 0.
--path=<value> Path to the simulator/emulator
build archive or app
--url=<value> Simulator/Emulator build archive
url
Seems like eas build:run does not have option to run on connected devices. Or am I looking wrong command?
Any guidance or examples would be greatly appreciated!
See the full answer from the Expo team https://github.com/expo/orbit/issues/239#issuecomment-2657991825.
/Applications/Expo\ Orbit.app/Contents/Resources/orbit-cli-arm64 \
install-and-launch \
--app-path /Users/xyz/host.exp.Exponent.ipa \
--device-id 00008130-00084C910021401C
alias orbit-launch='/Applications/Expo\ Orbit.app/Contents/Resources/orbit-cli-arm64 install-and-launch'
orbit-launch \
--app-path /Users/xyz/host.exp.Exponent.ipa \
--device-id 00008130-00084C910021401C
Personally, I prefer Option 1.B: Install IPA/APK to Device via Alias Command.
adb devices -l # Shows list of Android devices
xcrun xctrace list devices # Shows list of iOS devices/simulators
on Android the Orbit CLI uses the device "name" as the id which is different from adb devices, in order to get the correct name for your device you can run /Applications/Expo\ Orbit.app/Contents/Resources/orbit-cli-arm64 list-devices -p android
see original comment
alias orbit-list-android-devices="/Applications/Expo\ Orbit.app/Contents/Resources/orbit-cli-arm64 list-devices -p android"
alias orbit-list-ios-devices="/Applications/Expo\ Orbit.app/Contents/Resources/orbit-cli-arm64 list-devices -p ios"
orbit-list-android-devices
orbit-list-ios-devices