React Native on a machine 8081 occupied

Today, as i was setting up a basic React native app on my company’s laptop, I cannot run the RN packager server which is default to port 8081​. I ran the lsof -i :8081 but get nothing. Turns out I have to run it with sudo because the app that uses this port is the Corporate Mcafee.

Ideally i do not want to uninstall/unload Mcafee unless I have to, try to find a work around first . (For iOS, as of Sep/2017, I did not find a way for RN​ to work on a custom port, so have to unload McAfee, which is unfortunate.)

First thing to do is to run the packager server in a different port:

react-native start --port 8088

And now the packager server is up and running. However when i run react-native run-android , it still tells me JS server not recognized , so to get rid of this msg, i have to change some source code in the node module. The logic is in node_modules/react-native/local-cli/util/isPackagerRunning.js, and we just need to change the port in the fetch function from 8081 to the 8088 that we use above.

Now the android app should be able to be installed in the virtual device and run. However we still could not leverage the live reload capability of RN because if we double click r to reload, we get a red screen saying cannot connect to This is because when we use Genymotion virtual device, the code in node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ will return that url. So we need to cmd+M in the emulator, Go to Dev Settings → Debug server host for device, enter ‘localhost:8081’. 

This is to overwrite the emulator’s debug server.(NOTE: if you are connecting your REAL android device, you do not have to change the above host).  Now we have the last step which is to forward the request in our local VD’s 8088 port to our machine’s 8088 port which runs the packager server by doing:

adb reverse tcp:8088 tcp:8088

The first part is VD and 2nd one is for the hosting machine. More about adb reverse. (Note: even for the VD, try to avoid using 8081. It would work for normal development/reload, but will not work with chrome remote debugging which still forwards the http request for  to the host’s 8081 which is used by Mcafee.)

Now you should be able to change your and hit r twice or cmd+M -> Reload to reload the VD.


create a quick android app with rss

现在很多的网站都推出了自己的app,但是对于我们这些普通的小网站来说,自己去做一个app有点得不尝试,也没有去那么的精力去做这些,于是就有人做了这样的服务,AppYet就是这样的而一个服务,只要提供网站的feed rss地址,appyet就能自动的生成一个比较perfect的app,只是对于免费的用户, 嵌套了广告,毕竟是免费的,我们也就没有什么可以说的。

appyet是提供了一种服务,只需你提供网站的feed rss,就能很快的生成一个网站的app出来,对于小网站用户来说足矣。(from this blog

对于webvanta, 提供了rss生成script


  1. <?xml version=”1.0″ encoding=”UTF-8″?>
  2. <rss version=”2.0″>
  3. <channel>
  4.     <title> Latest Articles</title>
  5.     <link></link>
  6.     <description> Latest Articles</description>
  7.     <language>zh-cn</language>
  8.     <copyright>Copyright (C) All rights reserved.</copyright>
  9.     <generator> RSS Generator</generator>
  10.     <item>
  11.     <title>Using WebRequest and WebResponse</title>
  12.     <link></link&gt;
  13.     <description>Description here</description>
  14.     <category></category>
  15.     <author>Bipin Joshi</author>
  16.     <copyright></copyright>
  17.     <pubDate>Sun, 25 Jan 2004 12:00:00 AM GMT</pubDate>
  18.     </item>
  19. </channel>
  20. </rss>

rss:  每个RSS Feed,都有而且只能有一个rss标签,作为顶层元素,属性version是版本号,如2.0
channel:   在rss标签下,必须有且只能有一个channel标签,可包含