27 Mart 2025'ten itibaren AOSP'yi derlemek ve AOSP'ye katkıda bulunmak için aosp-main yerine android-latest-release kullanmanızı öneririz. Daha fazla bilgi için AOSP'de yapılan değişiklikler başlıklı makaleyi inceleyin.
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Winscope izleme, Android çerçevesinin bir parçasıdır. Bu sayfada, Winscope izleme görüntüleyicisini yerel olarak indirmek, oluşturmak ve çalıştırmak için gereken adımlar özetlenmiştir.
Winscope'u yerel olarak derleme
PC'nizi Winscope izleyicisini çalıştıracak şekilde ayarlamak için aşağıdaki adımları uygulayın:
Kullanılabilir komutların listesini görmek için şu komutu çalıştırın: npm run
Aşağıdakileri kullanarak tüm üretim ve test hedeflerini oluşturun:
npm run build:prod
Winscope'u şu şekilde çalıştırın:
npm run start
Ayrı parçalar oluşturma
Winscope'un ayrı parçalarını aşağıdaki komutları kullanarak ayrı ayrı oluşturabilirsiniz:
Komut
Açıklama
build:trace_processor
Perfetto'nun trace_processor aracının en son sürümünü kontrol edip yeniden oluşturur.
build:protos
Proto tanımlarını yeniden derleyin.
Test çalıştırma
Winscope, birim ve uçtan uca testler içerir. Bunları çalıştırmak için npm run
<command>'ü kullanın:
Komut
Açıklama
test:unit:ci
Birim testlerini CI veya göndermeden önce kanca için daha az ayrıntılı bir biçimde çalıştırır.
test:unit:dev
Birim testlerini yerel geliştirme için daha ayrıntılı bir biçimde çalıştırır.
Bu mod, değişiklikleri izler ve doğru testleri otomatik olarak yeniden çalıştırır.
test:e2e
Araç arası protokol için olanlar gibi uçtan uca testleri çalıştırır.
test:presubmit:quiet
Tüm göndermeden önce birim testlerini, linters'i ve grafik analizini CI veya göndermeden önce kancası için daha az ayrıntılı bir biçimde oluşturur.
test:presubmit
Göndermeden önce tüm birim testlerini, linters'i ve grafik analizini yerel geliştirme için daha ayrıntılı bir biçimde oluşturur.
test:all
Yerel geliştirme için tüm testleri (birim ve uçtan uca), linters'i ve grafik analizini daha ayrıntılı bir biçimde çalıştırır.
@IntDef eşlemesini güncelleme
@IntDef, Android'de bir tam sayının olası değerlerini kısıtlamak için kullanılan bir ek açıklamadır. Winscope, tam sayı yerine değerin adını görüntülemek için bu ek açıklamaların eşlemesini kullanır.
@IntDef eşlemesini güncellemek için aşağıdakileri yapın:
Ek açıklama ön işlemcisinin çalışması için :framework-minus-apex-intdefs'ü derleyin:
mp:framework-minus-apex-intdefs
Oluşturulan intDefMapping.json dosyasını önceden derlenmiş paketler deposuna kopyalayın:
repo upload simgesini kullanarak Winscope'a değişiklikleri yükleyin.
Diğer komutlar
Winscope komut dosyaları, derleme ve testlere ek olarak tabloda gösterildiği gibi başka özellikler de içerir. Bunları çalıştırmak için npm run command'ü kullanın:
Komut
Açıklama
format:check
prettier kullanarak kod biçimlendirme sorunlarını kontrol eder.
format:fix
prettier'ü kullanarak kod biçimlendirme sorunlarını kontrol eder ve otomatik olarak düzeltir.
eslint:check
eslint kullanarak kod biçimlendirme sorunlarını kontrol eder.
eslint:fix
eslint'ü kullanarak kod biçimlendirme sorunlarını kontrol eder ve otomatik olarak düzeltir.
tslint:check
tslint kullanarak kod biçimlendirme sorunlarını kontrol eder.
tslint:fix
tslint'ü kullanarak kod biçimlendirme sorunlarını kontrol eder ve otomatik olarak düzeltir.
deps_graph:check_cycles
Kodu döngüsel bağımlılıklar açısından analiz eder.
Sorunu giderin
Sorun giderme için aşağıdaki ipuçlarını kullanın:
ProtocolError: missing required '<FIELD>' veya TypeError: Cannot
read property '<PROP>' of null hatası
Bu durum, izleme dosyası yeni zorunlu alanları içeren yeni bir proto tanımı ile oluşturulduğunda ortaya çıkar.
İzlemeyi doğru Winscope sürümünde (ana, S veya R) açtığınızdan emin olun.
Proto üzerinde yeni alanı oluşturursanız npm run build:protos kullanarak Winscope'ta protoları yeniden derleyin.
Yüklü bazı bağımlılık sürümleri yanlış (derleme başarısız)
package.json ve package-lock.json için değişiklikleri geri alın. node_modules öğesini kaldırın. npm install'ü tekrar çalıştırın.
Proto dosyalarından birine yeni bir alan ekledim. Nasıl gösterebilirim?
Winscope, derlendiği zamanki proto tanımlarını kullanır. Bu nedenle yeni alanlar varsayılan olarak görünmez. Yeni alanları göstermek için npm run build:protos kullanarak prototipi yeniden oluşturun.
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-24 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-08-24 UTC."],[],[],null,["# Run Winscope\n\nWinscope tracing is part of the Android framework. This page outlines the\nsteps required to download, build, and run the Winscope trace viewer locally.\n\nBuild Winscope locally\n----------------------\n\nFollow these steps to set up your PC to run the Winscope tracer:\n\n1. [Download the Android source](/docs/setup/build/building).\n2. Navigate to the Winscope folder:\n\n cd development/tools/winscope\n\n3. Install dependencies using:\n\n npm install\n\n To see a list of available commands, run: `npm run`\n4. Build all prod and test targets using:\n\n npm run build:prod\n\n5. Run Winscope using:\n\n npm run start\n\n| **Note:** You can also download and build Winscope to host on a standard web server to get a shareable link to the tool.\n\nBuild separate parts\n--------------------\n\nYou can build individual parts of Winscope separately using the following\ncommands:\n\n| Command | Description |\n|-------------------------|-----------------------------------------------------------------------------|\n| `build:trace_processor` | Checks out and rebuilds the latest version of Perfetto's `trace_processor`. |\n| `build:protos` | Recompiles the proto definitions. |\n\nRun tests\n---------\n\n| **Tip:** Winscope doesn't build on Soong and can't be built by Tradefed, so it's recommended to have a local Git hook to the tests in your local environment.\n\nWinscope contains unit and end-to-end tests. To run them use `npm run\n\u003ccommand\u003e`:\n\n| Command | Description |\n|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `test:unit:ci` | Runs the unit tests in a less verbose format for CI or presubmit hook. |\n| `test:unit:dev` | Runs the unit tests in a more verbose format for local development. This mode watches for changes and automatically reruns the correct tests. |\n| `test:e2e` | Runs the end-to-end tests, such as those for the cross-tool protocol. |\n| `test:presubmit:quiet` | Builds all presubmit unit tests, linters, and graph analysis in a less verbose format for CI or presubmit hook. |\n| `test:presubmit` | Builds all presubmit unit tests, linters, and graph analysis in a more verbose format for local development. |\n| `test:all` | Runs all tests (unit and end-to-end), linters, and graph analysis in a more verbose format for local development. |\n\n### Update @IntDef mapping\n\n`@IntDef` is an annotation used in Android to restrict the possible values of an\ninteger. Winscope uses a mapping of these annotations to display the name of the\nvalue instead of the integer.\n\nTo update the `@IntDef` mapping, do the following:\n\n1. Build `:framework-minus-apex-intdefs` for the annotation preprocessor to run:\n\n mp :framework-minus-apex-intdefs\n\n2. Copy the generated `intDefMapping.json` file to the prebuilts repository:\n\n $ python3 -c 'import sys,json,collections; print(json.dumps(collections.OrderedDict(sorted(collections.ChainMap(*map(lambda x:json.load(open(x)), sys.argv[1:])).items())), indent=2))' $(find out/soong/.intermediates/frameworks/base -iname intDefMapping.json) \u003e ./development/tools/winscope/src/common/intDefMapping.json\n\n3. Upload the changes in Winscope using `repo upload`.\n\nOther commands\n--------------\n\nIn addition to build and tests, Winscope scripts contain other capabilities, as\nshown in the table. To run them use `npm run `\u003cvar translate=\"no\"\u003ecommand\u003c/var\u003e:\n\n| Command | Description |\n|---------------------------|----------------------------------------------------------------|\n| `format:check` | Checks for code formatting issues using `prettier`. |\n| `format:fix` | Checks and auto fixes code formatting issues using `prettier`. |\n| `eslint:check` | Checks for code formatting issues using `eslint`. |\n| `eslint:fix` | Checks and auto fixes code formatting issues using `eslint`. |\n| `tslint:check` | Checks for code formatting issues using `tslint`. |\n| `tslint:fix` | Checks and auto fixes code formatting issues using `tslint`. |\n| `deps_graph:check_cycles` | Analyzes the code for cyclical dependencies. |\n\nTroubleshoot\n------------\n\nUse the following tips for troubleshooting:\n\n- **Error `ProtocolError: missing required '\u003cFIELD\u003e'` or `TypeError: Cannot\n read property '\u003cPROP\u003e' of null`**\n\n - This occurs when the trace file was created with a new proto definition,\n containing new *required* fields.\n\n 1. Make sure you're opening the trace on the correct Winscope version (master, S, or R).\n 2. If you create the new field on the proto, recompile the protos in\n Winscope using `npm run build:protos`.\n\n | **Note:** You shouldn't need a new required field, because the protos should be backward compatible.\n- **Some installed dependency versions are wrong (build fails)**\n\n - Revert changes to `package.json` and `package-lock.json`. Remove `node_modules`. Run `npm install` again.\n- **I added a new field to one of the proto files. How do I display it?**\n\n - Winscope uses the proto definitions from when it was compiled, so new fields won't appear by default. To show new fields, rebuild the protos using `npm run build:protos`."]]