Skip to content

Commit

Permalink
Open xcworkspace (CocoaPods support)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfikes committed Oct 2, 2018
1 parent ce14d38 commit 32150ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ Packager so try to avoid doing so.
- You can launch your app on the simulator without opening Xcode by running
`react-native run-ios` in your app's root directory (since RN 0.19.0).

- To change advanced settings run `re-natal xcode` to quickly open the Xcode project.
- To change advanced settings run `re-natal xcode` to quickly open the Xcode project. (A workspace
will be opened in preference to a project if present.)

- If you have customized project layout and `re-natal upgrade` does not fit you well,
then these commands might be useful for you:
Expand Down Expand Up @@ -450,7 +451,7 @@ $ node ../re-natal/index.js
init [options] <name> create a new ClojureScript React Native project
upgrade upgrades project files to current installed version of re-natal (the upgrade of re-natal itself is done via npm)
add-platform <platform> adds additional app platform: 'windows' - UWP app, 'wpf' - WPF app
xcode open Xcode project
xcode open Xcode project (or workspace if present)
deps install all dependencies for the project
use-figwheel generate index.*.js for development with figwheel
use-android-device <type> sets up the host for android device type: 'real' - localhost, 'avd' - 10.0.2.2, 'genymotion' - 10.0.3.2, IP
Expand Down
12 changes: 8 additions & 4 deletions re-natal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -675,17 +675,21 @@ addPlatform = (platform) ->
logErr message

openXcode = (name) ->
if fs.existsSync "ios/#{name}.xcworkspace"
openTarget = "#{name}.xcworkspace"
else
openTarget = "#{name}.xcodeproj"
try
exec "open ios/#{name}.xcodeproj"
exec "open ios/#{openTarget}"
catch {message}
logErr \
if message.match /ENOENT/i
"""
Cannot find #{name}.xcodeproj in ios.
Cannot find #{openTarget} in ios.
Run this command from your project's root directory.
"""
else if message.match /EACCES/i
"Invalid permissions for opening #{name}.xcodeproj in ios"
"Invalid permissions for opening #{openTarget} in ios"
else
message

Expand Down Expand Up @@ -941,7 +945,7 @@ cli.command 'add-platform <platform>'
addPlatform(platform)

cli.command 'xcode'
.description 'open Xcode project'
.description 'open Xcode project (or workspace if present)'
.action ->
ensureOSX ->
ensureXcode ->
Expand Down

0 comments on commit 32150ac

Please sign in to comment.