{"id":13609154,"url":"https://github.com/CanonicalLtd/react-native","last_synced_at":"2025-04-12T19:33:28.405Z","repository":{"id":147239534,"uuid":"64276762","full_name":"CanonicalLtd/react-native","owner":"CanonicalLtd","description":"A framework for building native apps with React.","archived":true,"fork":false,"pushed_at":"2017-02-26T23:27:50.000Z","size":63759,"stargazers_count":955,"open_issues_count":1,"forks_count":46,"subscribers_count":51,"default_branch":"ubuntu","last_synced_at":"2024-08-01T19:51:32.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://facebook.github.io/react-native/","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CanonicalLtd.png","metadata":{"files":{"readme":"README-ubuntu.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-27T04:21:26.000Z","updated_at":"2024-04-30T14:32:43.000Z","dependencies_parsed_at":"2023-05-06T10:17:04.892Z","dependency_job_id":null,"html_url":"https://github.com/CanonicalLtd/react-native","commit_stats":null,"previous_names":[],"tags_count":91,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanonicalLtd%2Freact-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanonicalLtd%2Freact-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanonicalLtd%2Freact-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanonicalLtd%2Freact-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CanonicalLtd","download_url":"https://codeload.github.com/CanonicalLtd/react-native/tar.gz/refs/heads/ubuntu","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223538935,"owners_count":17162014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:32.854Z","updated_at":"2024-11-07T15:30:26.898Z","avatar_url":"https://github.com/CanonicalLtd.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","软件打包工具","Developer Tools","Frameworks for Hybrid App","Frameworks for Hybrid Apps"],"sub_categories":["其他","Frameworks For Hybrid Applications","IDE","笔记","Test Tools","写作"],"readme":"\n# React Native Ubuntu\n\n## Introduction\n\n### Platforms\n\nThere is support for applications on both Desktop Ubuntu and Ubuntu Touch.\n\n### Prerequisites\n\nYou should have an Ubuntu 16.04 (Xenial Xerus) installation.\n\nIf you are going to be developing on a device:\n - You must have a device with Ubuntu Touch installed and developer mode\n enabled, see [Touch installation page](https://developer.ubuntu.com/en/phone/devices/installing-ubuntu-for-devices/)\n for more details.\n - Your device must be on the same local network as your development machine.\n\nYou should have some familiarity with developing on Ubuntu platforms.\n\n## Setup\n\nBefore we can go further, git and node, and node's package manager must be\ninstalled.\n\n```\nsudo apt-get install -y git nodejs-legacy npm\n```\n\n### Setup React Native\n\nTo start working on a React Native application, the React Native packages for\nubuntu need to be published to a local package repository.\n\nDownload the port for Ubuntu.\n```\n~$ mkdir src; cd src\n~/src$ git clone https://github.com/CanonicalLtd/react-native -b ubuntu\n```\nAnd then follow the instruction in ~/src/reactnative-ubuntu/react-native-cli/README.md\n\nRoughly they are -\n```\n~/src$ sudo npm install -g sinopia\n~/src$ (edit sinopia config for react)\n~/src$ sinopia\u0026\n~/src$ npm set registry http://localhost:4873/\n~/src$ npm adduser --registry http://localhost:4873/\n~/src$ cd reactnative-ubuntu/react-native-cli; npm publish --force\n~/src/reactnative-ubuntu/react-native-cli$ cd ..; npm publish --force\n```\n\n### Setup node-haste\n\nSome changes to node-haste are required to detect the Ubuntu platform. Clone\nthe patched repo and publish to the local package repository.\n```\n~/src$ git clone https://github.com/justinmcp/node-haste\n~/src$ cd node-haste; npm install\n~/src/node-haste$ (add node-haste to sinopia config - see below)\n~/src/node-haste$ npm publish --force\n```\n\nnode-haste should be added to the packages section of the Sinopia config file\n```\n    packages:\n      'node-haste':\n        allow_access: $all\n        allow_publish: $all\n```\n\n### Install React Native CLI\n\nThe last step in preparing for creating our application to install the CLI\ntools from the local package repository.\n```\n~$ sudo npm install -g react-native-cli\n```\n\n## Creating a new React Native application\n\nNow that React Native has been installed we can get started making an\napplication.\n\n```\n~$ cd ~/src\n~/src$ react-native init AwesomeProject\n~/src$ cd AwesomeProject\n~/src/AwesomeProject$ react-native ubuntu\n~/src/AwesomeProject$ cd ubuntu\n```\n\nThat's it, the skeleton of an application is in place. You can edit\n~/src/AwesomeProject/index.ubuntu.js to start developing.\n\n## Easy path\n\nThe quick and easy way to get started is to use the react-native CLI tool to\nbuild and run the application.\n```\n~/src/AwesomeProject$ react-native run-ubuntu\n```\n\nIf you have a connected Ubuntu device, you can launch onto the device with\n```\n~/src/AwesomeProject$ react-native run-ubuntu --arch=arm\n```\n*Note*; For device builds, the Ubuntu SDK must have been installed as per the\ninstructions below.\n\n\nOther command line arguments can be passed \n```\n~/src/AwesomeProject$ react-native run-ubuntu -h\n```\nTo be able to read the list.\n\n\n### Targeting a device\n\n#### Dependencies\n\nUsually we would want to be installing the ubuntu-sdk, which can be done\ndirectly, but since this is still in preview, we will just install a raw build\nenvironment. The build environment is a chroot provided by the hardworking SDK\nteam, but is not part of the general distribution. We will need to add the SDK\nteam's repository first.\n\n```\n~$ sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa\n~$ sudo apt-get update \u0026\u0026 sudo apt-get upgrade -y\n```\n\nThen we can install all necessary packages.\n```\n~$ sudo apt-get install -y adb click-dev ubuntu-sdk-api-15.04-armhf\n```\n\n\n#### Building\n\nTo build for the device, run the build script through the chroot build\nenvironment.\n```\n~/src/AwesomeProject/ubuntu$ click chroot -a armhf -f ubuntu-sdk-15.04 -n click run ./build.sh\n```\n\n#### Running\n\nMake sure that the device can be connected to via adb. The device will need to\nhave developer mode enabled, instruction on these topics can be found on the\n[Touch installation page](https://developer.ubuntu.com/en/phone/devices/installing-ubuntu-for-devices/).\n\nIn a separate shell, start the React Native packager.\n```\n~/src/AwesomeProject$ npm start\n```\n\nThen it is all good to go. Live reload can be activated by passing the --live-reload flag.\n```\n~/src/AwesomeProject/ubuntu$ ./run-app.sh —on-device —live-reload\n```\n\n### Targeting a desktop\n\n#### Dependencies\n\n```\n~$ sudo apt-get install -y cmake qt5-default qtdeclarative5-dev\n```\n\n#### Building\n\nRun the build script.\n```\n~/src/AwesomeProject/ubuntu$ ./build.sh\n```\n\n#### Running\n\nIn a separate shell, start the React Native packager.\n```\n~/src/AwesomeProject$ npm start\n```\n\nThen it is all good to go. Live reload can be activated by passing the\n--live-reload flag.\n```\n~/src/AwesomeProject/ubuntu$ ./run-app.sh —live-reload\n```\n\n## Developing React Native Ubuntu\n\nIf you would like to contribute, or just want a short cut to trying some React\nNative examples, you can build React Native directly.\n\n#### Dependencies\n\n```\n~$ sudo apt-get install -y cmake qt5-default qtdeclarative5-dev\n~/src/reactnative-ubuntu$ npm install\n```\n\n*Note*; you do not need need to add react-native and react-native-cli to the\nlocal repository if you are building this way, but you must add node-haste, as\nper the instructions above.\n\n#### Building\n\n```\n~/src/reactnative-ubuntu$ mkdir build; cd build; cmake .. \u0026\u0026 make\n```\n\n#### Running\n\nIn a separate shell, start the React Native packager.\n```\n~/src/reactnative-ubuntu$ npm start\n```\n\nThe examples all follow a similar template, e.g to run the TicTacToe app\n```\n~/src/reactnative-ubuntu$ ./build/Examples/TicTacToe/run-example.sh\n```\nTo run the 2048 app\n```\n~/src/reactnative-ubuntu$ ./build/Examples/2048/run-example.sh\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCanonicalLtd%2Freact-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCanonicalLtd%2Freact-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCanonicalLtd%2Freact-native/lists"}