question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xcode: on deploy to device, Packager re-packages even when no changes

See original GitHub issue

Description

Sometimes I use Xcode to deploy my RN app to a physical device using the Xcode toolbar, e.g. image

As expected, during the ‘Bundle React Native code and images’ build phase… image

…the RN Packager bundles the app. It’s a substantially lengthy process, in my case ~6-8 minutes.

If I don’t change any code and simply deploy the app again using Xcode, the entire packager build restarts.

Is there a way I can persist Packager builds across Xcode deploys?

Feels like the whole point of HMR/Live Reload is to avoid this – how can I bring it to device deploys? Given how clever HMR is, this just seems so unnecessary.

Reproduction

  1. Open an RN project’s ios/app.xcodeproj
  2. Plug in physical iOS device
  3. Deploy RN app to device
  4. Don’t change any code
  5. Deploy again

Additional Information

  • React Native version: 0.33
  • Xcode version: 8.1
  • Platform: iOS
  • Operating System: MacOS El Capitan 10.11.6

Did an Issues search for ‘Xcode’ & ‘Xcode Packager’ – didn’t find anything pertinent, apologies if this is a dupe.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
ephemercommented, Dec 19, 2016

@frantic I appreciate the tip. If I didn’t need anything built I could also just tap the app on the device’s springboard.

What about the case where you’re developing a native plugin which requires constant rebuilding of native code but not of the JS bundle?

It’s possible to work around this (to a degree) by creating a new RN project containing only the component under development, but this involves a fair bit of overhead, including maintenance of an additional project.

To me it’d make sense to have some intelligent way around this built into the tooling, without the overhead. For example, would it be reasonable to at least do the JS build in parallel to the native build instead of in series? I don’t fully understand the bundler yet but from what I gather it shouldn’t matter - in debug / development - whether the app starts before the bundling is complete

2reactions
pviniscommented, Nov 7, 2016

yea this should change. i propose we change the react-native-xcode.sh code, to skip building if its the scheme is Debug. currently it skips if the scheme is Debug AND its running on a simulator. Debugging should be quick and not build the bundle, even on a device.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode 11, deploying to device doesn't reflect code changes
Deploying the app via Xcode to my iPad running the latest beta of iPadOS will most of the time not reflect any code...
Read more >
Deploying Xcode and CLI tools: what's new in Xcode 5
If you deploy Xcode and the command-line tools, a few things have changed ... The app still includes two device development-related packages ......
Read more >
Wrap iOS apps with the Intune App Wrapping Tool
Learn how to wrap your iOS apps without changing the code of the app itself. Prepare the apps so you can apply mobile...
Read more >
Deploying a Third-Party macOS App: Workspace ONE UEM ...
Xcode ; Slack; Microsoft Office for macOS; Microsoft Remote Desktop ... Any device where Workspace ONE UEM triggers an application install from Monday ......
Read more >
Tampering and Reverse Engineering on iOS - OWASP MASTG
Apple will issue a free development provisioning profile even if you're not a paying developer. You can obtain the profile via Xcode and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found