mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
441c464c2b
Summary: A lot of people try to use a device as the very first thing when trying out React Native. I've observed this at the developer workshop in Prague and on Twitter. However, developing on pre-API 21 devices is quite involved: https://facebook.github.io/react-native/docs/running-on-device-android.html I'm thinking we could recommend installing Android together with Android studio. Android studio installs HAXM for you (hardware acceleration, without this Google emulators are useless) and also creates and starts emulators. So it would be quite a smooth experience similar to pressing 'Run' in Xcode. We'd just need to integrate with Gradle so that installing the app also starts the packager. I think that's something we should do in any case. Probably an even better option is to build a React Native-specific tool that lets you do everything you need: opens the Android SDK Manager, creates and starts emulators, detects whether you have Genymotion and opens it, upgrades node and npm etc. public Reviewed By: vjeux Differential Revision: D2604774 fb-gh-sync-id: c7ffb701b4e5209815faf652926937c22943be95
56 lines
1.9 KiB
JavaScript
56 lines
1.9 KiB
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
|
|
var chalk = require('chalk');
|
|
var path = require('path');
|
|
var yeoman = require('yeoman-generator');
|
|
|
|
module.exports = yeoman.generators.NamedBase.extend({
|
|
writing: function() {
|
|
var templateVars = {name: this.name};
|
|
// SomeApp/ios/SomeApp
|
|
this.fs.copyTpl(
|
|
this.templatePath(path.join('app', '**')),
|
|
this.destinationPath(path.join('ios', this.name)),
|
|
templateVars
|
|
);
|
|
|
|
// SomeApp/ios/SomeAppTests
|
|
this.fs.copyTpl(
|
|
this.templatePath(path.join('tests', 'Tests.m')),
|
|
this.destinationPath(path.join('ios', this.name + 'Tests', this.name + 'Tests.m')),
|
|
templateVars
|
|
);
|
|
this.fs.copy(
|
|
this.templatePath(path.join('tests', 'Info.plist')),
|
|
this.destinationPath(path.join('ios', this.name + 'Tests', 'Info.plist'))
|
|
);
|
|
|
|
// SomeApp/ios/SomeApp.xcodeproj
|
|
this.fs.copyTpl(
|
|
this.templatePath(path.join('xcodeproj', 'project.pbxproj')),
|
|
this.destinationPath(path.join('ios', this.name + '.xcodeproj', 'project.pbxproj')),
|
|
templateVars
|
|
);
|
|
this.fs.copyTpl(
|
|
this.templatePath(path.join('xcodeproj', 'xcshareddata', 'xcschemes', '_xcscheme')),
|
|
this.destinationPath(path.join('ios', this.name + '.xcodeproj', 'xcshareddata', 'xcschemes', this.name + '.xcscheme')),
|
|
templateVars
|
|
);
|
|
},
|
|
|
|
end: function() {
|
|
var projectPath = path.resolve(this.destinationRoot(), 'ios', this.name);
|
|
this.log(chalk.white.bold('To run your app on iOS:'));
|
|
this.log(chalk.white(' Open ' + projectPath + '.xcodeproj in Xcode'));
|
|
this.log(chalk.white(' Hit the Run button'));
|
|
}
|
|
});
|