- Quit Skype
- rm -rf ~/Library/Caches/com.skype.skype
Fuck you Microsoft
2d14654 HEAD@{0}: commit (amend): Other's patch
428555b HEAD@{1}: commit: Other's patch
bd33767 HEAD@{2}: commit: Previous one
$ git reset --hard HEAD~1
HEAD is now at bd33767 Previous one
$ git cherry-pick 428555b
....
$ git diff 428555b 2d14654 | git apply -
這時打 git status 就可以發現當初的修改回來 unstage 的狀態了, 重新 git commit
$ git commit
完成
Tested in KRT16M / KOT49H
Follow the steps here
http://source.android.com/source/building.html
get source code Version
get nexus driver
fix what's missing in nexus driver
link
yes, pull the binary from stock ROM first
If you didn't do that, your SIM cannot be used
(optional) get /system/media/bootanimation.zip Because AOSP android doesn't have nexus animation
(ADD: 2013/11/29 16:55) add Network Location Provider for GMS
link
Fixed Wireless GPS issues. Changed "config_locationProviderPackageNames" from "com.google.android.location" to "com.google.android.gms" in frameworks/base/core/res/res/values/config.xml
start to build
$ source build/envsetup.sh
$ lunch
=> Press AOSP hammerhead userdebug
$ make clobber
$ make -j 4
flash custom recovery (CWM or TWRP)
flash everything other than recovery
fastboot reboot bootloader
Press VOL-UP than power button to enter recovery mode
Choose Advanced -> sideload mode, if you are using TWRP
$ adb sideload gapps
gapps link http://forum.xda-developers.com/showthread.php?t=2397942
$ adb sideload stock_boot_animation or
adb push bootanimation.zip into /system/media/bootanimation.zip
do a factory reset
(ADD: 2013/12/19 16:07)
fix green line issue in camcorder KOT49H (KRT16M has this issue?)
Replace /system/lib/libmmcamera_interface.so by stock one
link
Have fun!
在找 OnSharedPreferenceChangeListener 範例抄時找到這個
SharedPreferences keeps listeners in a WeakHashMap. This means that you cannot use an anonymous inner class as a listener, as it will become the target of garbage collection as soon as you leave the current scope.
SharedPreferences.onSharedPreferenceChangeListener not being called consistently
靠... 這很容易踩到啊 =_=
plurka 廣告設計得太爛,不要怪我對你不義啊
記錄一下
adb shell mount -o rw,remount /system
adb push hosts.for.mobile.txt /etc/hosts
adb reboot
refs: xda
xcode-select --install 後還是不在, 用 Mac Ports 吧
$ sudo ports install apache-ant
啟動後的 navigation bar 跟 orietation 一整個亂七八糟
解法: 升級到 1.3.1
http://stackoverflow.com/questions/19561669/error-on-loading-genymotion-device-on-os-x-mavericks
更新到 10.0 後, 9.0.9 被搬到 /Application/iMovie 9.0.9 下面
iWork 也是還存在
應該可以砍了吧 = ="
以前按一下電源鈕會跑出電源選單,現在只會直接睡著
解法: 長按 1.5 秒
http://support.apple.com/kb/HT5869?viewlocale=en_US
因為我一直以為只對 Keynote 有需求,所以我當初只買了 Keynote
Pages / Numbers 在試用期過後就放著讓他可以開檔案
結果這次搞一搞他就變正式版了 wwwww
http://share.inside.com.tw/posts/2899
gnutar 找不到
暫時解法:
sudo ln -s /usr/bin/tar /usr/bin/gnutar
不過 darwin12 != darwin13 只能等官方修吧 QQ
http://trac.macports.org/wiki/MavericksProblems
陸續更新...
常用的指令例如 status 可以減化成短指令
~/.gitconfig
[alias]
ci = commit
st = status
co = checkout
l = log --stat=140,100
br = branch
p = cherry-pick
r = rebase
f = fetch
up = pull --rebase
指令就變為
$ git st
單獨 git clone 下來的 git repository 不會有 commit-msg hook
所以 push 到 gerrit 時,不會有 Change-Id
沒有 Change-Id 的話,重複 push 不會在同一個 patch 裡繼續疊加
所以 commit-msg hook 是必需要用的
(除非要手動從 gerrit 上 copy 下來...何苦呢...)
$ find . -name commit-msg \<BSP_ROOT>/.repo
把他 copy 到 .git/hooks/ 裡
$ scp -p -P 29418 \<SERVER>:hooks/commit-msg .git/hooks/
每次 git repository commit 時,如果要填寫固定格式
可以先將文字檔存下來,就不會每次都要打一次
進 git repository 寫一個文字檔 .gittemplate
$ git config commit.template=.gittemplate
放在 ~/.gitconfig 裡指定
[commit]
template = ~/.gittemplate
$ git push ssh://\<SERVER>:29418/\<PATH> HEAD:refs/for/\<BRANCH>
PATH 可以使用
$ git config -l | grep url remote.origin.url=ssh://\<SERVER>:29418/here/is/my/branch
在此可以知道路徑是 here/is/my/branch
BRANCH
$ git branch -a
...
remotes/origin/aosp/jb-release
...
在裡面找需要的 branch, 不需要包 remotes/origin
所以這邊需要 aosp/jb-release
$ git push ssh://mickey.acer.com.tw:29418/here/is/my/branch HEAD:refs/for/aosp/jb-release
為了不要每次下指令都指定 user name 也就是
$ repo init -u ssh://my.id@\<SERVER>......
~/.ssh/config
Host \<SERVER>
Port 29418
User XXXX.YYY
跟 Gerrit 裡 Settings -> Profile -> Username 一樣
public class L {
private static boolean BUILDCONFIG_DEBUG = false;
static {
try {
Class<?> c = Class.forName("com.helloworld.BuildConfig");
Field field = c.getField("DEBUG");
BUILDCONFIG_DEBUG = field.getBoolean(null);
} catch (NoSuchFieldException e) {
} catch (ClassNotFoundException e) {
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
}
}
}
$ cd ~/Dropbox/Backup/gitbase脫光光的 git repository 長得像
$ git init --bare HelloWorld
Initialized empty Git repository in /Users/elvis/Dropbox/Backup/gitbase/HelloWorld/
$ ls -l HelloWorld
total 24
drwxr-xr-x 9 elvis staff 306 8 30 14:56 .
drwxr-xr-x 8 elvis staff 272 8 30 14:56 ..
-rw-r--r-- 1 elvis staff 23 8 30 14:56 HEAD
-rw-r--r-- 1 elvis staff 112 8 30 14:56 config
-rw-r--r-- 1 elvis staff 73 8 30 14:56 description
drwxr-xr-x 11 elvis staff 374 8 30 14:56 hooks
drwxr-xr-x 3 elvis staff 102 8 30 14:56 info
drwxr-xr-x 4 elvis staff 136 8 30 14:56 objects
drwxr-xr-x 4 elvis staff 136 8 30 14:56 refs
$ cd ~/work/HelloWorld如果原來已經有一個 master 了, 你也本來沒有 upstream
$ git remote add dropbox ~/Dropbox/Backup/gitbase/HelloWorld
$ git push dropbox master如果原來的 master 已經有 upstream 了,只是備份用,就直接
$ git branch -u dropbox/master master
git push dropbox master
if (isInEditMode()) { // put some item here }這樣在 layout editor 就可以看到,而不是空空的一片