Detect Detached Expo App

Expo CLI 3.4.1 environment info:
OS: macOS 10.15.2
Shell: 3.2.57 - /bin/bash
Node: 10.16.3 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
expo: ^35.0.0 => 35.0.0
react: 16.8.3 => 16.8.3
react-native: => 0.59.8
react-navigation: ^3.12.0 => 3.13.0
expo-cli: 3.4.1

I have ejected Expo and it become detached project.

 "isDetached": true,
    "detach": {
      "iosExpoViewUrl": "",
      "androidExpoViewUrl": ""

I publish to Expo like this.
expo publish --release-channel dev

For UI development, I usually uneject and development on Expo app since it is much faster.
Problem is that I delete isDetached in App.json and I put it back for building APK, IPA. Sometimes, I forgot to put back and build wrong APK, IPA.

Is there a way expo can detect whether it is detached app or not? Like if I run ‘expo isDetached’ and if it can return true or false, I can fully automate the process. If it is true, I will proceed to build IPA, APK and if it is false, I won’t proceed. Is it possible ? or is there a way to do?


You could perhaps script this with jq.

If isDetached is false or null:

$ jq -e '.expo.isDetached' <app.json 
$ echo $?

If isDetached is true:

$ jq -e '.expo.isDetached' <app.json 
$ echo $?

But also have a look at the following which might be a better way to go:

oh …this solves my issue. Thanks a lot for idea. You are the best.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.